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:
martinlanghoff
2005-05-30 05:22:07 +00:00
parent f7d18493f6
commit a13e99bd67
5 changed files with 52 additions and 2 deletions
+14 -1
View File
@@ -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;
}
+15
View File
@@ -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`
#
+14
View File
@@ -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;
}
+8
View File
@@ -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
View File
@@ -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