views:

404

answers:

6

Hi! Is there any standalone alternative to activerecord-like migrations. Something like a script that is able to track current schema version and apply outstanding migrations. Basically, these migration files could be just a plain SQL files, something like:

[timestamp]_create_users.sql
reverse_[timestamp]_create_users.sql

Language of implementation isn't very important — it could be anything that is usually installed/pre-installed on *nix systems.

I tried to find something out — but failed. I can certainly develop my own in an hour or two, but I am just curious — may be something nice is out there already.

A: 

Not a linux option, but might answer this question for some people:

SQLYog can do this for MySQL - its a windows GUI tool:

http://www.webyog.com/en/

It can (amongst other things) compare schemas and make one schema look like another, or generate the sql required to do this if you want to do that instead. We use it for making sql patch files that we can use for upgrades. Its easier than manually maintaining a file as you make changes in development.

benlumley
I am on OSX :( but thanks anyway!
Yurii Rashkovskii
Me too ... but we only have one license for it - we have a virtual machine running windows on a server downstairs for single licensed products, its installed on that and we all access over remote desktop. So it doesn't matter anyway.
benlumley
+2  A: 

Try http://freshmeat.net/projects/liquibase/

If you are using MySQL specifically, have a look at: http://www.mysqldiff.org/ I used this to synchronize the schema of two databases (so you would have to apply the changes to a "master").

There's also http://phpmyversion.sourceforge.net/

Mike Crowe
Thanks for the link to liquibase (even though it is Java)
Yurii Rashkovskii
Even though it is Java based, this is one of the best stand alone schema change set management tools I've worked with. Plus its easy to integrate into a build/configuration management system.
David
A: 

Check out AutoPatch

Alvaro Rodriguez
Thanks! Although it is a heavyweight Java solution, it seems to be very close to what I need :)
Yurii Rashkovskii
A: 

The ezComponents library has a database schema component that can compare and apply schema differences between two databases (or a database and a file).

Eran Galperin
A: 

https://sourceforge.net/projects/migrations/

This is a tool for managing structural changes to database schemas based on Active Record migrations from Rails. Features multiple schema interactions, runtime substitution of values, script generations, and more.

Plus it has both a command line interface and a graphical interface. Also is actively developed and our company has been using it for over a year now and it has greatly improved the lives of everyone from development to dbas to operations to streamlined deployments and rollbacks. Management takes db changes for granted now (sometimes not a good thing) because it is so automated now thanks to this tool.