Espigah / dbdeploy

Automatically exported from code.google.com/p/dbdeploy
0 stars 0 forks source link

Add db refactoring capability #15

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As a software developer, I want to be able to specify high level 
refactorings (e.g. rename a column, rename a table, move a column from one 
table to another, change the type of a column, etc.) to perform on my 
database, which dbdeploy would then apply, so that I don't have to write 
the scripts myself.

* dbdeploy should write both the alter table statement AND the data 
migration script required to perform the specified refactoring.

I suggest that this could be implemented as a DSL, which would output a 
change script.

Possible issues:

* Not all refactorings will be easy to support - but some will be.
* Integrating the execution of DSL scripts with the execution of standard 
change scripts, in a easy-to-use manner could be interesting.

It is possible that this could be viewed as a separate project to dbdeploy, 
but it does seem to fit well with the overall purpose of dbdeploy.  If it 
were viewed separately, then dbdeploy would be left as just a sequential 
script executor, with the proposed DSL being a script generator.  There 
does seem to be an area of overlap, though.

Original issue reported on code.google.com by akn...@gmail.com on 26 Mar 2009 at 10:27

GoogleCodeExporter commented 9 years ago
This sounds interesting, but not something that (imho) should be in the core of
dbdeploy, which should remain a simple way of applying handwritten (or program
generated) change scripts.

Hence I lean towards your suggestion of a tool that processes input files and
generates change scripts ready for dbdeploy.

Or, as there are a few requests this kind of non-core activity (see issue 6, 
issue 5,
issue 16) dbdeploy should support some kind of plugin architecture that can
preprocess change scripts.  In fact, the undo script processing is a bit like 
that
right now.

Original comment by gtack...@googlemail.com on 29 Mar 2009 at 11:52

GoogleCodeExporter commented 9 years ago

Original comment by gtack...@googlemail.com on 29 Mar 2009 at 11:57

GoogleCodeExporter commented 9 years ago
I'm not sure if you're aware of this, but there is an existing java project 
called mysql-diff that can compare 2 dbs 
and generate migration scripts from one to the other.

mysql-diff could be used to generate scripts difference of dbs and dbdeploy 
would be used to apply them.

http://bitbucket.org/stepancheg/mysql-diff/

Original comment by tar...@gmail.com on 3 Dec 2009 at 6:44