summaryrefslogtreecommitdiff
path: root/modules/system/system.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-01-23 16:44:58 +0000
committerDries Buytaert <dries@buytaert.net>2007-01-23 16:44:58 +0000
commitf83368fdf5bd0e11d120cdd905d085276c28fe92 (patch)
tree10b21f63e7432508e8b220d2e0ec49a6efe8eec1 /modules/system/system.install
parent05ffca40a1aefb349c04e23f5c8a9d005ecf5a5d (diff)
downloadbrdo-f83368fdf5bd0e11d120cdd905d085276c28fe92.tar.gz
brdo-f83368fdf5bd0e11d120cdd905d085276c28fe92.tar.bz2
- Patch #92630 by RobRoy: simplify adding new blocks.
Diffstat (limited to 'modules/system/system.install')
-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.
*/