Ideally, I just want to add a new column to a table in my data model, and
the tool should automatically add this in the existing database. TG1
provided "tg-admin sql update" for this purpose. Options:
1) We can add such a tool as a paster command (since we have "setup-app",
we may want to have "update-app").
2) We can improve sqlalchemy-migrate so that it grows an automatic and
semi-automatic mode. My idea is that in the automatic mode, migrate would
do something similar to "tg-admin sql update", and in the semi-automatic
mode, it would generate upgrade and downgrade scripts that you can modify
and improve as you like. Currently you need to manually write upgrade and
downgrade scripts. This should be possible with the
--
Ticket URL: <http://trac.turbogears.org/ticket/2239>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
+1 on both, with a preference for #2 we'll have to talk to the sa-migrate
people to see if they want the contribution.
--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:1>
"... with the schema reflection features of SA." I wanted to end my
sentence, i.e. by using reflection and comparing the metadata.
--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:2>
> It is recommended to use sqlalchemy-migrate for database migration in
> TG2. This tool is surely helpful once your application is in production
> and the database contains real data. But as long as you're under heavy
> development, you don't want to bring out such big guns - a simpler tool
> is preferable.
>
> Ideally, I just want to add a new column to a table in my data model, and
> the tool should automatically add this in the existing database. TG1
> provided "tg-admin sql update" for this purpose. Options:
>
> 1) We can add such a tool as a paster command (since we have "setup-app",
> we may want to have "update-app").
>
> 2) We can improve sqlalchemy-migrate so that it grows an automatic and
> semi-automatic mode. My idea is that in the automatic mode, migrate would
> do something similar to "tg-admin sql update", and in the semi-automatic
> mode, it would generate upgrade and downgrade scripts that you can modify
> and improve as you like. Currently you need to manually write upgrade and
> downgrade scripts. This should be possible with the
New description:
It is recommended to use sqlalchemy-migrate for database migration in TG2.
This tool is surely helpful once your application is in production and the
database contains real data. But as long as you're under heavy
development, you don't want to bring out such big guns - a simpler tool is
preferable.
Ideally, I just want to add a new column to a table in my data model, and
the tool should automatically add this in the existing database. TG1
provided "tg-admin sql update" for this purpose. Options:
1) We can add such a tool as a paster command (since we have "setup-app",
we may want to have "update-app").
2) We can improve sqlalchemy-migrate so that it grows an automatic and
semi-automatic mode. My idea is that in the automatic mode, migrate would
do something similar to "tg-admin sql update", and in the semi-automatic
mode, it would generate upgrade and downgrade scripts that you can modify
and improve as you like. Currently you need to manually write upgrade and
downgrade scripts. This should be possible with the with the schema
reflection features of SA.
--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:3>
I need to correct myself. There was actually never a "tg-admin sql update"
command in TG1. I probably confused this with "tg-admin sql status" which
detected the changes, but without updating. Or maybe I confused it with
"tg-admin sql upgrade", but that worked only for SQLObject and probably
needed manually written upgrade scripts as well.
Anyway, this does not change the fact that this would be a highly
desirable tool.
--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:4>
* milestone: 2.x => 2.1
--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:5>
* milestone: 2.1 => 2.2
--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:7>