Skip to content

Commit

Permalink
Fix issues with entity definition and regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jun 30, 2019
1 parent 6e5acd0 commit f1e6388
Show file tree
Hide file tree
Showing 7 changed files with 144 additions and 9 deletions.
96 changes: 96 additions & 0 deletions sql/auto_install.sql
Original file line number Diff line number Diff line change
@@ -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
) ;


38 changes: 38 additions & 0 deletions sql/auto_uninstall.sql
Original file line number Diff line number Diff line change
@@ -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;
10 changes: 5 additions & 5 deletions sql/upgrade_3000.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@

<field>
<name>basic_rate_tax</name>
<type>decimal(4,2)</type>
<type>decimal</type>
<length>4,2</length>
<required>true</required>
<title>Basic Rate Tax</title>
<comment>Basic rate tax for the batch.</comment>
<add>4.4</add>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>

<tables xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="BatchSettings.xml" parse="xml" />
<xi:include href="BatchSettings.xml" parse="xml" />
</tables>
2 changes: 1 addition & 1 deletion xml/schema/Schema.xml.inc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<xi:include href="CRM/BatchSettings/files.xml" parse="xml" />
<xi:include href="CRM/Civigiftaid/files.xml" parse="xml" />

0 comments on commit f1e6388

Please sign in to comment.