My product is required to run under a variety of common database platforms (mysql/sqlserver/oracle), and in development it is necessary to strictly follow the relevant specifications to ensure that cross-database type requirements are met. (Related points in my "your system really because of the use of Hibernate can adapt to various databases?" "It has been mentioned in the article." In the initial development, there is a problem that bothers my team, we develop the time must be based on a specific database development (such as MySQL), but in the testing phase is the need for a different database platform for compatibility testing, Because the database structure and the seed data change very quickly in the development process, all writing the SQL Way is a waste of time, how to find an efficient database migration tool, is our urgent solution.
In fact, there is no choice, the more common Database Migration Tool is SQL Server's own DTS, this thing in the SQL Server database data import/export, it is really easy to use, in different types of database operations, there will be a lot of problems, such as: type conversion needs to manually specify/ The Export field has double quotes ...
So the final choice is to do a DTS of their own well, the idea is as follows:
1. Select source database connection and Target database connection
2, according to the source database traverse all database objects (table), as a benchmark
3, delete the target database all table foreign key and index, delete all kinds of Word data (according to Convention) data, fields are allowed null
4, traversing all the tables in the source database to modify the structure of the target database (such as adding and deleting fields, field change type, size)
5. Copy the seed data table data from the source database to the target database
6, based on the source database for the table in the target database to create foreign keys and indexes, set whether to allow null