diff options
author | Jean-Michel Vedrine <vedrine@vedrine.org> | 2013-04-27 22:54:57 +0200 |
---|---|---|
committer | Jean-Michel Vedrine <vedrine@vedrine.org> | 2013-04-27 22:54:57 +0200 |
commit | fcf99b5bc918837d990e638b613da7357ad36532 (patch) | |
tree | c404c7cf45877cca8b0eef7a588dcf15afa8c1fa /db | |
parent | 14da1f7131ac7ddd33c97b6e131beb2d13fb208e (diff) |
Changes before release
Diffstat (limited to 'db')
-rw-r--r-- | db/install.xml | 8 | ||||
-rw-r--r-- | db/upgrade.php | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/db/install.xml b/db/install.xml index edab580..748b8d5 100644 --- a/db/install.xml +++ b/db/install.xml @@ -4,16 +4,16 @@ xsi:noNamespaceSchemaLocation="../../../../lib/xmldb/xmldb.xsd" > <TABLES> - <TABLE NAME="qtype_algebra" COMMENT="Options for algebra questions" NEXT="qtype_algebra_variables"> + <TABLE NAME="qtype_algebra_options" COMMENT="Options for algebra questions" NEXT="qtype_algebra_variables"> <FIELDS> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="questionid"/> <FIELD NAME="questionid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="compareby"/> <FIELD NAME="compareby" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="evaluated" SEQUENCE="false" PREVIOUS="questionid" NEXT="nchecks"/> <FIELD NAME="nchecks" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="10" SEQUENCE="false" PREVIOUS="compareby" NEXT="tolerance"/> <FIELD NAME="tolerance" TYPE="float" NOTNULL="true" SEQUENCE="false" PREVIOUS="nchecks" NEXT="disallow"/> - <FIELD NAME="disallow" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="tolerance" NEXT="allowedfuncs"/> - <FIELD NAME="allowedfuncs" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="disallow" NEXT="answerprefix"/> - <FIELD NAME="answerprefix" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="allowedfuncs"/> + <FIELD NAME="disallow" TYPE="text" NOTNULL="true" SEQUENCE="false" PREVIOUS="tolerance" NEXT="allowedfuncs"/> + <FIELD NAME="allowedfuncs" TYPE="text" NOTNULL="true" SEQUENCE="false" PREVIOUS="disallow" NEXT="answerprefix"/> + <FIELD NAME="answerprefix" TYPE="text" NOTNULL="true" SEQUENCE="false" PREVIOUS="allowedfuncs"/> </FIELDS> <KEYS> <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="questionid"/> diff --git a/db/upgrade.php b/db/upgrade.php index ed8c060..6ddf1db 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -67,6 +67,16 @@ function xmldb_qtype_algebra_upgrade($oldversion=0) { } upgrade_plugin_savepoint(true, 2012061701, 'qtype', 'algebra'); } - return true; + + // Change table name one more time. + if ($oldversion < 2012061702) { + // Renaming old table. + $table = new xmldb_table('qtype_algebra'); + if ($dbman->table_exists($table)) { + $dbman->rename_table($table, 'qtype_algebra_options'); + } + upgrade_plugin_savepoint(true, 2012061702, 'qtype', 'algebra'); + } + return true; } |