Merged from MOODLE_15_STABLE - Created config_plugins table to manage configuration entries on a per-module/plugin. This breaks the rules a little bit, but it has been discussed with MD.
This commit is contained in:
+14
-1
@@ -1370,7 +1370,20 @@ function main_upgrade($oldversion=0) {
|
||||
table_column('user', '', 'trackforums', 'int', '4', 'unsigned', '0', 'not null', 'autosubscribe');
|
||||
}
|
||||
|
||||
|
||||
if ($oldversion < 2005053000 ) { // Add config_plugins table
|
||||
|
||||
// this table was created on the MOODLE_15_STABLE branch
|
||||
// so it may already exist.
|
||||
$result = execute_sql("CREATE TABLE IF NOT EXISTS `{$CFG->prefix}config_plugins` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`plugin` varchar(250) NOT NULL default 'core',
|
||||
`name` varchar(250) NOT NULL default '',
|
||||
`value` text NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `plugin_name` (`plugin`, `name`)
|
||||
) TYPE=MyISAM
|
||||
COMMENT='Moodle modules and plugins configuration variables';");
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -23,6 +23,21 @@ CREATE TABLE `prefix_config` (
|
||||
) TYPE=MyISAM COMMENT='Moodle configuration variables';
|
||||
# --------------------------------------------------------
|
||||
|
||||
#
|
||||
# Table structure for table `config_plugins`
|
||||
#
|
||||
|
||||
CREATE TABLE `prefix_config_plugins` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`plugin` varchar(255) NOT NULL default 'core',
|
||||
`name` varchar(255) NOT NULL default '',
|
||||
`value` text NOT NULL default '',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `plugin_name` (`plugin`, `name`)
|
||||
) TYPE=MyISAM COMMENT='Moodle modules and plugins configuration variables';
|
||||
# --------------------------------------------------------
|
||||
|
||||
|
||||
#
|
||||
# Table structure for table `course`
|
||||
#
|
||||
|
||||
@@ -1090,6 +1090,20 @@ function main_upgrade($oldversion=0) {
|
||||
table_column('grade_category', 'weight', 'weight', 'numeric(5,2)', '', '', '0.00', '', '');
|
||||
}
|
||||
|
||||
if ($oldversion < 2005053000 ) { // Add config_plugins table
|
||||
|
||||
// this table was created on the MOODLE_15_STABLE branch
|
||||
// so it may already exist. Therefore we hide potential errors
|
||||
// (Postgres doesn't support CREATE TABLE IF NOT EXISTS)
|
||||
execute_sql("CREATE TABLE {$CFG->prefix}config_plugins (
|
||||
id SERIAL PRIMARY KEY,
|
||||
plugin varchar(255) NOT NULL default 'core',
|
||||
name varchar(255) NOT NULL default '',
|
||||
value text NOT NULL default '',
|
||||
CONSTRAINT {$CFG->prefix}config_plugins_plugin_name_uk UNIQUE (plugin, name)
|
||||
);", false);
|
||||
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,14 @@ CREATE TABLE prefix_config (
|
||||
CONSTRAINT prefix_config_name_uk UNIQUE (name)
|
||||
);
|
||||
|
||||
CREATE TABLE prefix_config_plugins (
|
||||
id SERIAL PRIMARY KEY,
|
||||
plugin varchar(255) NOT NULL default 'core',
|
||||
name varchar(255) NOT NULL default '',
|
||||
value text NOT NULL default '',
|
||||
CONSTRAINT prefix_config_plugins_plugin_name_uk UNIQUE (plugin, name)
|
||||
);
|
||||
|
||||
CREATE TABLE prefix_course (
|
||||
id SERIAL PRIMARY KEY,
|
||||
category integer NOT NULL default '0',
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2005052400; // YYYYMMDD = date
|
||||
$version = 2005053000; // YYYYMMDD = date
|
||||
// XY = increments within a single day
|
||||
|
||||
$release = '1.6 development'; // Human-friendly version name
|
||||
|
||||
Reference in New Issue
Block a user