开发者

Any ideas how to compare two SQL DDL and create alter/delete/create script with keeping DB data?

开发者 https://www.devze.com 2023-02-12 09:44 出处:网络
Can you suggest any ideas how to compare two SQL DDL scripts and create alter/delete/create SQL script keeping the current DB data?

Can you suggest any ideas how to compare two SQL DDL scripts and create alter/delete/create SQL script keeping the current DB data?

I tried SQLAlchemy-migration and it requires to do python declara开发者_如何学Ction alter script manually that is not as solution, as I can do the same manually with SQL DDL (what I do currently)

I looked to python SQLAlechemy solutions that can do it and was not able to find anything like Django South or many RoR migration plugins.

Still checking for ideas how to do it, if there is no current solution, maybe, I'll need to write some simple solution do it by my own, but still need suggestions.

Any suggestions are welcome :)


My interpretation of your question is that you have two different SQL DDL scripts, and you want to produce a 'diff' script that transforms one into the other? My first thought would be Ruby on Rail's migrations, but you say you've already looked into that. Perhaps you need to simply write the diff script manually?

Here's a blog post about using migrations without Rails.

You could try out SqlDelta, but it looks like a commercial product.

See also this stackoverflow question.

0

精彩评论

暂无评论...
验证码 换一张
取 消