Closed (fixed)
Project:
Schema
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2009 at 18:01 UTC
Updated:
15 Feb 2010 at 17:20 UTC
Jump to comment: Most recent file
I have drupal running on a site with 2 databases, Drupal, and a secondary database where our legacy data is stored. I've created several tables in this separate legacy database using drupal modules and the schema_install hook. I would like to use schema module to analyze my second database.
usually I call
db_set_active('external-db');
to switch to the second database. Is it possible to add in some code so I can use this module on external databases that use drupal's schema?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | schema.module.multi.database.support.diff | 1.71 KB | markDrupal |
Comments
Comment #1
moshe weitzman commenteddb_set_active('external-db');
schema_invoke('inspect');
Comment #2
markDrupal commentedWhere would I put that code?
I think it would be better if that code were in this module (I.E. Submit that code as a patch to be committed) so I could use this module's web front end to analyze my secondary database.
I still think it is a valid feature request to support more than one database connection.
All the database connections are saved to $db_url variable in the settings.php file. We could use that variable to add a new select box form element to the web front end. That would give the user a way to select between the default database or use a secondary database connection
Then switch to the database in the form submit call
Comment #3
markDrupal commentedI worked out a patch and tested it with my multi database setup. This allows schema module to work with more than just the default database connection.
You have to set up your secondary database connection in your settings.php file for this to work.
Comment #4
markDrupal commentedComment #5
mikeryanCommitted, thanks!