From c54234d71a6f1a6857e74ffd1e76e5e0604833de Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 8 Dec 2005 08:40:10 +0000 Subject: - 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. --- includes/install.inc | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 includes/install.inc (limited to 'includes') diff --git a/includes/install.inc b/includes/install.inc new file mode 100644 index 000000000..6f8a86f65 --- /dev/null +++ b/includes/install.inc @@ -0,0 +1,75 @@ +name] = $row->schema_version; + } + } + + return $versions[$module]; +} + +/** + * Update the installed version information for a module. + * + * @param $module + * A module name. + * @param $version + * The new schema version. + */ +function drupal_set_installed_schema_version($module, $version) { + db_query("UPDATE {system} SET schema_version = %d WHERE name = '%s'", $version, $module); +} -- cgit v1.2.3