[Dbix-class] DBIx::Class::Schema::Loader with multiple schemas
Nick Anderson
nick at webcraftcs.com
Wed Dec 19 20:06:18 GMT 2012
Hi,
I am trying to use DBIx::Class::Schema::Loader to create a schema for
two inter-related databases but am having trouble where it insists on
prefixing with the database name:
__PACKAGE__->table(db_prefix.table_name);
With one database, it doesn't include the prefix.
With two it includes it even where there are no conflicting table names.
I need to run many individual copies of database A (client virtual host
databases), which are each linked to a master/lookup database B
For the schema I would like it to produce:
__PACKAGE__->table(table_name); - for database A tables (no prefix)
__PACKAGE__->table(B.table_name); - for database B tables (prefix)
The reason I don't want the database A prefix is because I can then
operate many copies of database A (e.g. same structure, different users)
and can ignore the database name.
The only way I can find to get around this at the moment is to manually
change the "__PACKAGE__->table" lines, but clearly this is not an
acceptable long term solution.
moniker_map/moniker_parts seem to refer to something else and don't
alter the "__PACKAGE__->table(dbic_name)"
Does anyone have any ideas please?
Thank you
Nick Anderson
More information about the DBIx-Class
mailing list