How the schema migration tools work?

旧街凉风 提交于 2019-12-23 18:05:25

问题


I have db based application and I delete the schema & db content every time whenever there is any changes in the schema. Now it is in development mode. Soon we release the application in production. But we suspect there could be many changes after we release the application in production use. The software shall be installed on many locations across the globe. (Not a web based app)

How the schema migration tool work in this case? or How can we use them in typical database based applications where we suspect the changes in the schema?


回答1:


Download the RedGate tools and find out. I believe that they all have trial periods and I'm sure that SQL Compare does.

Typically, you point them to two databases and they list out all of the differences between the two. You can configure them to ignore certain things, like comments, constraint names, etc. From there you can select which items you want to synchronize and in which direction and the tool will either generate a script for you to do it or it will make the changes for you.

In your situation you would probably generate the script and then use that as a basis for what you would send to your customers or what you would include in your install scripts. Just keep a database for each version of your application and you can then generate scripts to go from one version to another by pointing at the two databases. You can keep them empty (or just fill the lookup tables) so that they don't take up too much space.

You can also use SQL Data Compare to keep lookup tables synchronized. Just use it for the lookup tables though, not the actual main data tables.

No matter which route you go, you're going to have to do some custom coding, either because you need to convert data while changing structure or for a similar reason.




回答2:


Consider RoundhousE as a sql migration tool.

Rather than editing your schema creation scripts you write migrations that move your schema up from the current version of the database to the new version. RoundhousE adds information to the database to keep track of which version it is currently on and applies migration scripts to your database as required.

I am researching these tools and RoundhousE is top of my list at the moment.



来源:https://stackoverflow.com/questions/2051340/how-the-schema-migration-tools-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!