summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-12-08 08:40:10 +0000
committerDries Buytaert <dries@buytaert.net>2005-12-08 08:40:10 +0000
commitc54234d71a6f1a6857e74ffd1e76e5e0604833de (patch)
tree05bc03c2079a8760734982ef765677f8c9b9847f /database
parent7b5a8d936cbc856020318928d50e73078ee4c679 (diff)
downloadbrdo-c54234d71a6f1a6857e74ffd1e76e5e0604833de.tar.gz
brdo-c54234d71a6f1a6857e74ffd1e76e5e0604833de.tar.bz2
- Patch #40341 by Neil: fixed problems with database schema versions.
- When user #1 creates an account (we can assume this happens only once), system.module's schema version is set to the latest availiable. - system_get_files_database() now includes a 'schema_version' child of each file object. - That new information is re-saved when Drupal re-populates the system table. - An array of newly-enabled modules is built, module_list() is reloaded, and the schema versions of each newly-enabled module are set to the most recent availiable. If the schema version is already set (presumably from a previous installation) it is not changed.
Diffstat (limited to 'database')
-rw-r--r--database/database.mysql32
-rw-r--r--database/database.pgsql33
2 files changed, 31 insertions, 34 deletions
diff --git a/database/database.mysql b/database/database.mysql
index d29567b9b..5cbc889f3 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -656,7 +656,7 @@ CREATE TABLE system (
status int(2) NOT NULL default '0',
throttle tinyint(1) DEFAULT '0' NOT NULL,
bootstrap int(2) NOT NULL default '0',
- schema_version smallint(2) unsigned NOT NULL,
+ schema_version smallint(2) unsigned NOT NULL default 0,
PRIMARY KEY (filename)
) TYPE=MyISAM;
@@ -818,20 +818,20 @@ CREATE TABLE watchdog (
-- Insert some default values
--
-INSERT INTO system VALUES ('modules/block.module','block','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/comment.module','comment','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/filter.module','filter','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/help.module','help','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/menu.module','menu','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/node.module','node','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/system.module','system','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/user.module','user','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/watchdog.module','watchdog','module','',1,0,0,1);
-INSERT INTO system VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine','', 1,0,0,1);
-INSERT INTO system VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1,0,0,1);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/block.module', 'block', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/comment.module', 'comment', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/filter.module', 'filter', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/help.module', 'help', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/menu.module', 'menu', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/node.module', 'node', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/page.module', 'page', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/story.module', 'story', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/system.module', 'system', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/taxonomy.module', 'taxonomy', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/user.module', 'user', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/watchdog.module', 'watchdog', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0, 0);
INSERT INTO users (uid, name, mail) VALUES ('0', '', '');
INSERT INTO users_roles (uid, rid) VALUES (0, 1);
@@ -841,8 +841,6 @@ INSERT INTO permission VALUES (1,'access content',0);
INSERT INTO role (rid, name) VALUES (2, 'authenticated user');
INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0);
-REPLACE variable SET name='update_start', value='s:10:"2005-03-21";';
-
REPLACE variable SET name='theme_default', value='s:10:"bluemarine";';
REPLACE blocks SET module = 'user', delta = '0', theme = 'bluemarine', status = '1';
diff --git a/database/database.pgsql b/database/database.pgsql
index 27e5997dd..fc992e2f9 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -650,7 +650,7 @@ CREATE TABLE system (
status integer NOT NULL default '0',
throttle smallint NOT NULL default '0',
bootstrap integer NOT NULL default '0',
- schema_version smallint NOT NULL default 1,
+ schema_version smallint NOT NULL default 0,
PRIMARY KEY (filename)
);
@@ -814,22 +814,21 @@ CREATE TABLE watchdog (
-- Insert some default values
--
-INSERT INTO system VALUES ('modules/block.module','block','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/comment.module','comment','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/filter.module','filter','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/help.module','help','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/menu.module','menu','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/node.module','node','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/system.module','system','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/user.module','user','module','',1,0,0,1);
-INSERT INTO system VALUES ('modules/watchdog.module','watchdog','module','',1,0,0,1);
-INSERT INTO system VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine','',1,0,0,1);
-INSERT INTO system VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine',1,0,0,1);
-
-INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2005-03-21";');
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/block.module', 'block', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/comment.module', 'comment', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/filter.module', 'filter', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/help.module', 'help', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/menu.module', 'menu', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/node.module', 'node', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/page.module', 'page', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/story.module', 'story', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/system.module', 'system', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/taxonomy.module', 'taxonomy', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/user.module', 'user', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('modules/watchdog.module', 'watchdog', 'module', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/engines/phptemplate/phptemplate.engine', 'phptemplate', 'theme_engine', '', 1, 0, 0, 0);
+INSERT INTO system (filename, name, type, description, status, throttle, bootstrap, schema_version) VALUES ('themes/bluemarine/page.tpl.php', 'bluemarine', 'theme', 'themes/engines/phptemplate/phptemplate.engine', 1, 0, 0, 0);
+
INSERT INTO variable(name,value) VALUES('theme_default','s:10:"bluemarine";');
INSERT INTO users(uid,name,mail) VALUES(0,'','');
INSERT INTO users_roles(uid,rid) VALUES(0, 1);