[ic] how to add prefix to all SQL table names

Kevin Walsh interchange-users@icdevgroup.org
Sun Jun 9 22:38:01 2002


> 
> I'm stuck. I can't figure out how to change the names of all the SQL tables 
> (using MySQL) for a particular catalog installation. I've got a virtual 
> hosting situation where Interchange is sharing a databases with other apps, 
> and I'd like to be able to add a prefix to all the interchange SQL table 
> names. So I'd end up with table names like ic_procucts, ic_userdb, ic_state, 
> ic_pricing, etc. etc. I've seen how to change the table name for products, 
> and how to add an arbitrary table, but I can't figure out how to change the 
> names of the default tables. I'm just not getting it. Can anybody help??
> 
One quick way would be to modify the dbconf/mysql/*mysql files to
make use of the REAL_NAME option:

    Database  userdb  userdb.txt  dbi:mysql:whatever
    Database  userdb  REAL_NAME   ic_userdb
    Database  userdb  ...         ...
    Database  userdb  ...         ...
    etc.

In this case, the Interchange facilities will continue to refer to the
table as 'userdb', but actual table used would be called 'ic_userdb'.

I think that the best method would be to create a separate database
for the Interchange tables.  I don't see the point in changing the
table names so that all tables from all apps can be lumped together
into a single database.  MySQL allows you to create multiple databases
and allows SQL queries to reference tables from any of the databases
you have access to.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/