summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.install19
1 files changed, 18 insertions, 1 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index e99453d54..1b11c3914 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -209,7 +209,7 @@ function system_install() {
) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
db_query("CREATE TABLE {boxes} (
- bid int NOT NULL auto_increment,
+ bid int NOT NULL,
body longtext,
info varchar(128) NOT NULL default '',
format int NOT NULL default '0',
@@ -3516,6 +3516,23 @@ function system_update_1021() {
*/
/**
+ * Remove auto_increment from {boxes} to allow adding custom blocks with
+ * visibility settings.
+ */
+function system_update_2000() {
+ $ret = array();
+ switch ($GLOBALS['db_type']) {
+ case 'mysql':
+ case 'mysqli':
+ $max = (int)db_result(db_query('SELECT MAX(bid) FROM {boxes}'));
+ $ret[] = update_sql('ALTER TABLE {boxes} CHANGE COLUMN bid bid int NOT NULL');
+ $ret[] = update_sql("REPLACE INTO {sequences} VALUES ('{boxes}_bid', $max)");
+ break;
+ }
+ return $ret;
+}
+
+/**
* @} End of "defgroup updates-5.0-to-x.x"
* The next series of updates should start at 3000.
*/