Skip to content

Commit

Permalink
CRM-16860 - Declare civicrm_upgrade table
Browse files Browse the repository at this point in the history
  • Loading branch information
totten committed Dec 14, 2015
1 parent 86c92de commit f1b2530
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ CRM/Core/DAO/UFField.php
CRM/Core/DAO/UFGroup.php
CRM/Core/DAO/UFJoin.php
CRM/Core/DAO/UFMatch.php
CRM/Core/DAO/Upgrade.php
CRM/Core/DAO/Website.php
CRM/Core/DAO/WordReplacement.php
CRM/Core/DAO/Worldregion.php
Expand Down
27 changes: 27 additions & 0 deletions sql/civicrm_upgrade.mysql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
-- This code has been copied from the auto-generated civicrm.mysql
-- It is required to facilitate upgrades.

-- /*******************************************************
-- *
-- * civicrm_upgrade
-- *
-- * Track individual upgrade steps
-- *
-- *******************************************************/
CREATE TABLE `civicrm_upgrade` (


`id` int unsigned NOT NULL AUTO_INCREMENT ,
`module` varchar(127) NOT NULL COMMENT 'The module or extension for which upgrades were handled.',
`name` varchar(255) COMMENT 'Unique name for upgrade',
`created_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'When was the upgrade executed'
,
PRIMARY KEY ( `id` )

, UNIQUE INDEX `index_module_name`(
module
, name
)


) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
53 changes: 53 additions & 0 deletions xml/schema/Core/Upgrade.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="iso-8859-1" ?>

<table>
<base>CRM/Core</base>
<class>Upgrade</class>
<name>civicrm_upgrade</name>
<comment>Track individual upgrade steps</comment>
<add>4.7</add>
<field>
<name>id</name>
<title>Step ID</title>
<type>int unsigned</type>
<required>true</required>
<add>4.7</add>
</field>
<primaryKey>
<name>id</name>
<autoincrement>true</autoincrement>
</primaryKey>
<field>
<name>module</name>
<title>Upgrade Module</title>
<type>varchar</type>
<length>127</length>
<required>true</required>
<comment>The module or extension for which upgrades were handled.</comment>
<add>4.7</add>
</field>
<field>
<name>name</name>
<title>Upgrade Name</title>
<type>varchar</type>
<length>255</length>
<comment>Unique name for upgrade</comment>
<add>4.7</add>
</field>
<field>
<name>created_date</name>
<title>Upgrade Created Date</title>
<type>timestamp</type>
<comment>When was the upgrade executed</comment>
<required>false</required>
<default>CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP</default>
<add>4.7</add>
</field>
<index>
<name>index_module_name</name>
<fieldName>module</fieldName>
<fieldName>name</fieldName>
<unique>true</unique>
<add>4.7</add>
</index>
</table>
1 change: 1 addition & 0 deletions xml/schema/Core/files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<xi:include href="UFField.xml" parse="xml" />
<xi:include href="UFMatch.xml" parse="xml" />
<xi:include href="UFJoin.xml" parse="xml" />
<xi:include href="Upgrade.xml" parse="xml" />
<xi:include href="Timezone.xml" parse="xml" />
<xi:include href="Worldregion.xml" parse="xml" />
<xi:include href="OpenID.xml" parse="xml" />
Expand Down

0 comments on commit f1b2530

Please sign in to comment.