简体   繁体   中英

how to create/alter a mysql table on multiple customer databases

We have a dozen customers who each have their own database (they are all on the same RDS instance). The database schema is exactly the same for all customers.

When a new code deployment feature requires a new database table, is there a 'best practice' for creating this table on all customer databases?

We currently use a custom script that iterates over all databases and runs the 'create table xxxx' statement.

Was wondering if this is a common technique that is used, or if there's a better/safer way.

Sometimes I use your approach. Sometimes I create a SQL file with the create table for each database. According to me, this is a good method. The CREATE statement is safe because it doesn't remove or change anything so your approach is safe respect to the data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM