diff options
Diffstat (limited to 'modules-available/main/install.inc.php')
-rw-r--r-- | modules-available/main/install.inc.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/modules-available/main/install.inc.php b/modules-available/main/install.inc.php index b7dd2c4d..a19a069d 100644 --- a/modules-available/main/install.inc.php +++ b/modules-available/main/install.inc.php @@ -28,10 +28,13 @@ $res[] = tableCreate('property', " $res[] = tableCreate('property_list', " `name` varchar(50) NOT NULL, + `subkey` int(10) unsigned NOT NULL AUTO_INCREMENT, `dateline` int(10) unsigned NOT NULL DEFAULT '0', `value` text NOT NULL, KEY (`name`), - KEY `dateline` (`dateline`) + KEY `dateline` (`dateline`), + ADD KEY (`subkey`), + UNIQUE KEY `compound` (`name`, `subkey`) "); $res[] = tableCreate('user', " @@ -116,6 +119,19 @@ if (!tableHasColumn('user', 'serverid')) { Database::exec("ALTER TABLE `user` ADD `serverid` int(10) unsigned NULL DEFAULT NULL"); } +// +// +if (!tableHasColumn('property_list', 'subkey')) { + $ret = Database::exec("ALTER TABLE property_list + ADD COLUMN `subkey` int(10) unsigned NOT NULL AUTO_INCREMENT AFTER `name`, + ADD KEY (`subkey`), + ADD UNIQUE KEY `compound` (`name`, `subkey`)"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Cannot add subkey to property_list: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + // Make sure that if any users exist, one of the has UID=1, otherwise if the permission module is // used we'd lock out everyone $someUser = Database::queryFirst('SELECT userid FROM user ORDER BY userid ASC LIMIT 1'); |