awferreira / c5-db-migration

Automatically exported from code.google.com/p/c5-db-migration
0 stars 0 forks source link

Support ability to upgrade and downgrade to a specific revision #24

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Rails and Migrator.net both have the ability to go up and down to specific 
versions. This would be great to have so that you can rollback db schema 
migrations along with the code. I could possibly be implemented as a simple 
file name convention (eg [up_script_name]_down.sql) and then some simple 
logic to determine which migrations to run based on the requested version. 

Original issue reported on code.google.com by mail.col...@gmail.com on 24 Apr 2009 at 9:05

GoogleCodeExporter commented 8 years ago
Sorry, this should have been an enhancement as opposed to a defect.

Original comment by mail.col...@gmail.com on 24 Apr 2009 at 9:06

GoogleCodeExporter commented 8 years ago
I'd also like to see this getting implemented

Original comment by kristof....@gmail.com on 8 May 2009 at 12:39

GoogleCodeExporter commented 8 years ago
I just had a drawn out discussion with a manager over this, if not for my 
bleeding
ears, please put this in :D

Original comment by michael....@gmail.com on 8 Jul 2009 at 11:02

GoogleCodeExporter commented 8 years ago
Trust me, this is a feature that I've spent a lot of time thinking about and 
it's
something some people feel really strongly about.  I personally haven't really 
needed
or wanted down scripts in any of the java or rails development I've done.  
While some
people at my firm say they're useful, no one's really felt like they're 
critical.

I don't mind adding features that only some users would use, or features that I 
might
not use myself, as long as there's a nice clean implementation.  All of the 
migration
tools that support up and down scripts also use a proprietary format for 
capturing
scripts, so it's easy to capture both the up and down parts in a single file.  
We
don't have that same luxury since migrations are raw SQL and there's no way to
differentiate the two sets of SQL.  Having two files feels pretty crufty to me,
especially since it's a feature that many people won't use.

Let me think about it some more... if we can think of an implementation that 
doesn't
change how the forward-only/up-only users use db-migrations, retains backwards
compatibility, and also supports down migrations without being too hairy... I'll
reconsider.

Original comment by christia...@gmail.com on 30 Dec 2009 at 11:48

GoogleCodeExporter commented 8 years ago
If the _down file is there then you can go down.  If the file isn't there then 
you can't.  I doubt I'd use them but that would be another tick in the support 
box.  

My real problem with down migrations is giving them adequate testing.  You 
don't want to shove one in that you aren't confident about because your release 
people will invariably use it and it will, without a doubt, not work.

Original comment by nik9...@gmail.com on 8 Feb 2011 at 6:44