Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
3 May 2010 at 14:34 UTC
Updated:
22 Oct 2013 at 08:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedwatching
Comment #2
Crell commentedNo patch attached. :-( But I'm interested in this as well.
Comment #3
mikejoconnor commentedSorry, I forgot the attachment, here is the actual patch.
I've applied this locally, and it doesn't seem to make a significant difference in the install time, however it did slighly lower the memory consumption.
Without the patch
With the patch
Comment #5
tstoecklerThere is no drupal_install_modules() in D7.
module_enable() calls drupal_get_schema_versions though, so the problem is the same.
The only reason it is calling that is to set the schema version (drupal_set_installed_schema_version).
I don't really see a feasible way around that or a way to get the Schema version without including and parsing the whole update.inc
Comment #6
Anonymous (not verified) commentedI would suggest a defined constant like HOOK_SCHEMA_VERSION that defines the latest N of hook_update_N where HOOK is replaced by the module name.
I would suggest a file hook_N.schema where N is the latest hook_update_N number, hook is replaced by the module name and that this file is included from within hook_schema and that hook_schema be modified to accept the schema version.
The hook_N.schema file would not contain a function but only the $schema definition.
In the hook_update_N one could then include the schema file by calling the hook_schema implementation and then using it's own version of the schema.
This in general will keep the install file smaller and also allow for tracking the changes to the schema in separated files. The hook_update_N could then be separated into hook_N.update files allow each update to be included individually. The update system would know where to begin and then end with HOOK_SCHEMA_VERSION. So a file foo_7001.update would be included that defines the foo_update_7001 function and then is executed.
Comment #7
tstoecklerThat sounds like a terrific idea!
I'm not sure, whether we should split .install and .schema though. Since modules are automatically installed and uninstalled in Drupal 7 hook_schema will be the only hook in .install for a lot of modules.
Shouldn't hold up a patch, though either way.
Comment #8
pasqualle#497408: Move hook_update_N() to module.update