diff --git a/sql/auto_install.sql b/sql/auto_install.sql new file mode 100644 index 0000000..a5e21df --- /dev/null +++ b/sql/auto_install.sql @@ -0,0 +1,96 @@ +-- +--------------------------------------------------------------------+ +-- | CiviCRM version 5 | +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC (c) 2004-2019 | +-- +--------------------------------------------------------------------+ +-- | This file is a part of CiviCRM. | +-- | | +-- | CiviCRM is free software; you can copy, modify, and distribute it | +-- | under the terms of the GNU Affero General Public License | +-- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | +-- | | +-- | CiviCRM is distributed in the hope that it will be useful, but | +-- | WITHOUT ANY WARRANTY; without even the implied warranty of | +-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | +-- | See the GNU Affero General Public License for more details. | +-- | | +-- | You should have received a copy of the GNU Affero General Public | +-- | License and the CiviCRM Licensing Exception along | +-- | with this program; if not, contact CiviCRM LLC | +-- | at info[AT]civicrm[DOT]org. If you have questions about the | +-- | GNU Affero General Public License or the licensing of CiviCRM, | +-- | see the CiviCRM license FAQ at http://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from schema.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +-- + + +-- +--------------------------------------------------------------------+ +-- | CiviCRM version 5 | +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC (c) 2004-2019 | +-- +--------------------------------------------------------------------+ +-- | This file is a part of CiviCRM. | +-- | | +-- | CiviCRM is free software; you can copy, modify, and distribute it | +-- | under the terms of the GNU Affero General Public License | +-- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | +-- | | +-- | CiviCRM is distributed in the hope that it will be useful, but | +-- | WITHOUT ANY WARRANTY; without even the implied warranty of | +-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | +-- | See the GNU Affero General Public License for more details. | +-- | | +-- | You should have received a copy of the GNU Affero General Public | +-- | License and the CiviCRM Licensing Exception along | +-- | with this program; if not, contact CiviCRM LLC | +-- | at info[AT]civicrm[DOT]org. If you have questions about the | +-- | GNU Affero General Public License or the licensing of CiviCRM, | +-- | see the CiviCRM license FAQ at http://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from drop.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +-- +-- /******************************************************* +-- * +-- * Clean up the exisiting tables +-- * +-- *******************************************************/ + +SET FOREIGN_KEY_CHECKS=0; + +DROP TABLE IF EXISTS `civicrm_civigiftaid_batchsettings`; + +SET FOREIGN_KEY_CHECKS=1; +-- /******************************************************* +-- * +-- * Create new tables +-- * +-- *******************************************************/ + +-- /******************************************************* +-- * +-- * civicrm_civigiftaid_batchsettings +-- * +-- * FIXME +-- * +-- *******************************************************/ +CREATE TABLE `civicrm_civigiftaid_batchsettings` ( + + + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique BatchSettings ID', + `batch_id` int unsigned COMMENT 'FK to Batch', + `financial_types_enabled` text COMMENT 'Financial type enabled for this batch', + `globally_enabled` tinyint COMMENT 'Globally enabled for this batch', + `basic_rate_tax` decimal(4,2) NOT NULL COMMENT 'Basic rate tax for the batch.' +, + PRIMARY KEY (`id`) + + +, CONSTRAINT FK_civicrm_civigiftaid_batchsettings_batch_id FOREIGN KEY (`batch_id`) REFERENCES `civicrm_batch`(`id`) ON DELETE CASCADE +) ; + + diff --git a/sql/auto_uninstall.sql b/sql/auto_uninstall.sql new file mode 100644 index 0000000..59f4082 --- /dev/null +++ b/sql/auto_uninstall.sql @@ -0,0 +1,38 @@ +-- +--------------------------------------------------------------------+ +-- | CiviCRM version 5 | +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC (c) 2004-2019 | +-- +--------------------------------------------------------------------+ +-- | This file is a part of CiviCRM. | +-- | | +-- | CiviCRM is free software; you can copy, modify, and distribute it | +-- | under the terms of the GNU Affero General Public License | +-- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | +-- | | +-- | CiviCRM is distributed in the hope that it will be useful, but | +-- | WITHOUT ANY WARRANTY; without even the implied warranty of | +-- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | +-- | See the GNU Affero General Public License for more details. | +-- | | +-- | You should have received a copy of the GNU Affero General Public | +-- | License and the CiviCRM Licensing Exception along | +-- | with this program; if not, contact CiviCRM LLC | +-- | at info[AT]civicrm[DOT]org. If you have questions about the | +-- | GNU Affero General Public License or the licensing of CiviCRM, | +-- | see the CiviCRM license FAQ at http://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from drop.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +-- +-- /******************************************************* +-- * +-- * Clean up the exisiting tables +-- * +-- *******************************************************/ + +SET FOREIGN_KEY_CHECKS=0; + +DROP TABLE IF EXISTS `civicrm_civigiftaid_batchsettings`; + +SET FOREIGN_KEY_CHECKS=1; diff --git a/sql/upgrade_3000.sql b/sql/upgrade_3000.sql index e1ffed9..f6d063f 100644 --- a/sql/upgrade_3000.sql +++ b/sql/upgrade_3000.sql @@ -3,11 +3,11 @@ -- *******************************************************/ CREATE TABLE IF NOT EXISTS `civicrm_civigiftaid_batchsettings` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key.', - `batch_id` INT UNSIGNED COMMENT 'Foreign key for the batch in `civicrm_batch`.', - `financial_types_enabled` TEXT COMMENT 'Only enabled for selected financial types for the batch.', - `globally_enabled` TINYINT COMMENT 'Enabled for all financial types for the batch.', - `basic_rate_tax` DECIMAL(4,2) NOT NULL COMMENT 'Basic rate tax for the batch.', + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique BatchSettings ID', + `batch_id` int unsigned COMMENT 'FK to Batch', + `financial_types_enabled` text COMMENT 'Financial type enabled for this batch', + `globally_enabled` tinyint COMMENT 'Globally enabled for this batch', + `basic_rate_tax` decimal(4,2) NOT NULL COMMENT 'Basic rate tax for the batch.', PRIMARY KEY (`id`), CONSTRAINT FK_civicrm_civigiftaid_batchsettings_batch_id FOREIGN KEY (`batch_id`) REFERENCES `civicrm_batch` (`id`) ON DELETE CASCADE ) diff --git a/xml/schema/CRM/BatchSettings/BatchSettings.entityType.php b/xml/schema/CRM/Civigiftaid/BatchSettings.entityType.php similarity index 97% rename from xml/schema/CRM/BatchSettings/BatchSettings.entityType.php rename to xml/schema/CRM/Civigiftaid/BatchSettings.entityType.php index c84ef02..18c40a7 100644 --- a/xml/schema/CRM/BatchSettings/BatchSettings.entityType.php +++ b/xml/schema/CRM/Civigiftaid/BatchSettings.entityType.php @@ -2,7 +2,6 @@ // This file declares a new entity type. For more details, see "hook_civicrm_entityTypes" at: // http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference return [ - 0 => [ 'name' => 'BatchSettings', 'class' => 'CRM_Civigiftaid_DAO_BatchSettings', diff --git a/xml/schema/CRM/BatchSettings/BatchSettings.xml b/xml/schema/CRM/Civigiftaid/BatchSettings.xml similarity index 94% rename from xml/schema/CRM/BatchSettings/BatchSettings.xml rename to xml/schema/CRM/Civigiftaid/BatchSettings.xml index 0f713b7..0f605f8 100644 --- a/xml/schema/CRM/BatchSettings/BatchSettings.xml +++ b/xml/schema/CRM/Civigiftaid/BatchSettings.xml @@ -52,7 +52,9 @@ basic_rate_tax - decimal(4,2) + decimal + 4,2 + true Basic Rate Tax Basic rate tax for the batch. 4.4 diff --git a/xml/schema/CRM/BatchSettings/files.xml b/xml/schema/CRM/Civigiftaid/files.xml similarity index 66% rename from xml/schema/CRM/BatchSettings/files.xml rename to xml/schema/CRM/Civigiftaid/files.xml index 3c7d2a9..8c97dce 100644 --- a/xml/schema/CRM/BatchSettings/files.xml +++ b/xml/schema/CRM/Civigiftaid/files.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/xml/schema/Schema.xml.inc b/xml/schema/Schema.xml.inc index 4ef445b..bfed30c 100644 --- a/xml/schema/Schema.xml.inc +++ b/xml/schema/Schema.xml.inc @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file