diff options
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; } |