Commit 8b3f3a31 authored by Maria Sorica's avatar Maria Sorica Committed by Robert Lyon

Bug 1734182: Create the 'site_content_version' table

behatnotneeded

Change-Id: I2cecf16fbbd54b8e4b95ba9d78c51c34d19171f4
parent 63256d28
......@@ -1378,5 +1378,21 @@
<INDEX NAME="connectionk" UNIQUE="true" FIELDS="name" COMMENT="the connections can be repeated but the name must be unique for a given type and institution"/>
</INDEXES>
</TABLE>
<TABLE NAME="site_content_version">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" />
<FIELD NAME="type" TYPE="char" LENGTH="100" NOTNULL="true" />
<FIELD NAME="content" TYPE="text" LENGTH="big" NOTNULL="true" />
<FIELD NAME="author" TYPE="int" LENGTH="10" NOTNULL="true" />
<FIELD NAME="institution" TYPE="char" LENGTH="255" NOTNULL="true" />
<FIELD NAME="version" TYPE="char" LENGTH="15" NOTNULL="true" />
<FIELD NAME="ctime" TYPE="datetime" NOTNULL="true" />
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" />
<KEY NAME="institutionfk" TYPE="foreign" FIELDS="institution" REFTABLE="institution" REFFIELDS="name" />
<KEY NAME="authorfk" TYPE="foreign" FIELDS="author" REFTABLE="usr" REFFIELDS="id" />
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
......@@ -5588,5 +5588,26 @@ function xmldb_core_upgrade($oldversion=0) {
add_key($table, $key);
}
if ($oldversion < 2018010600) {
log_debug('Create "site_content_version" table');
$table = new XMLDBTable('site_content_version');
create_table($table);
$table->addFieldInfo('id', XMLDB_TYPE_INTEGER, 10, null, XMLDB_NOTNULL, XMLDB_SEQUENCE);
$table->addFieldInfo('type', XMLDB_TYPE_CHAR, 100, null, XMLDB_NOTNULL);
$table->addFieldInfo('content', XMLDB_TYPE_TEXT, 'big', null, XMLDB_NOTNULL);
$table->addFieldInfo('author', XMLDB_TYPE_INTEGER, 10, null, XMLDB_NOTNULL);
$table->addFieldInfo('institution', XMLDB_TYPE_CHAR, 255, null, XMLDB_NOTNULL);
$table->addFieldInfo('version', XMLDB_TYPE_CHAR, 15, null, XMLDB_NOTNULL);
$table->addFieldInfo('ctime', XMLDB_TYPE_DATETIME, null, null, XMLDB_NOTNULL);
$table->addKeyInfo('primary', XMLDB_KEY_PRIMARY, array('id'));
$table->addKeyInfo('institutionfk', XMLDB_KEY_FOREIGN, array('institution'), 'institution', array('name'));
$table->addKeyInfo('authorfk', XMLDB_KEY_FOREIGN, array('author'), 'usr', array('id'));
create_table($table);
}
return $status;
}
......@@ -16,7 +16,7 @@ $config = new stdClass();
// See https://wiki.mahara.org/wiki/Developer_Area/Version_Numbering_Policy
// For upgrades on stable branches, increment the version by one. On master, use the date.
$config->version = 2018010500;
$config->version = 2018010600;
$config->series = '18.04';
$config->release = '18.04dev';
$config->minupgradefrom = 2015030409;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment