Re: [CDBI] Re: odd swapping database issue on vhost / mason install
Alan <[email protected]> Mon, 2 Apr 2007 20:23:14 -0700
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
> Another option I thought of was go combine the databases into one, and
> separate data with a table prefix.
>
> So CMS::DBI packages are still separate, but they both connect to the
> same database, then they define their tables differently. IE:
>
> # site 1
> package CMS::Page;
> use base 'CMS::DBI';
> __PACKAGE__->set_up_table('site1_pages');
>
> # site 2
> package CMS::Page;
> use base 'CMS::DBI';
> __PACKAGE__->set_up_table('site2_pages');
>
> A bit more work in the setup phase, but easier copying of code across
> (to create site 3 I just cp -a /home/user/site1 /home/user/site3, then
> search/replace in the /home/user/site3/lib/CMS/DBI.pm and the
> schema.sql).
>
> Or do you think this would still cause issues? I suppose if both are
> still called CMS::DBI then they'd possibly be accessing different the
> wrong ones. Bah. I'll give it quick try now though, and see what
> happens.
Nope, back to the same thing. I'm going to give the overriding db_Main
link a shot.
--
Alan <[email protected]> - http://arcterex.net
--------------------------------------------------------------------
"Backups are for people who don't pray." -- big Mike