By jeff00seattle on
Hi
Please correct me where I am wrong.
I am assuming that the implementation of hook_schema() is for drupal_install_schema() is to install a module's schema into the default database used also by Drupal's site components (nodes, menus, views, etc...).
However, is it appropriate to alter where to load implemented hook_schema() besides using default when calling drupal_install_schema()?
For example, if in settings.php there is defined two database aliases: default and example. And in the implementation of hook_install() for an example module example, have it be:
function example_install() {
// Choose Database 'example'
db_set_active('example');
// Load schema into example database
drupal_install_schema('example');
// Return to Database 'example'
db_set_active('default');
}
function example_schema() {
// Tables for Database 'example'
}
Is this an appropriate Drapal database install?
Thanks
Jeff in Seattle
Comments
Hi, Thank you very much. It
Hi,
Thank you very much.
It works like a charm!
Ciao