[TurboGears] #2239: Simplify database migration in TG2

6 views
Skip to first unread message

TurboGears

unread,
Feb 26, 2009, 6:39:16 AM2/26/09
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
-------------------------+--------------------------------------------------
Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.x
Component: SQLAlchemy | Version: 2.0b6
Severity: normal | Keywords: sqlalchemy migrate
-------------------------+--------------------------------------------------
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

--
Ticket URL: <http://trac.turbogears.org/ticket/2239>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development

TurboGears

unread,
Feb 26, 2009, 10:32:40 PM2/26/09
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
--------------------------------+-------------------------------------------

Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.x
Component: SQLAlchemy | Version: 2.0b6
Severity: normal | Resolution:
Keywords: sqlalchemy migrate |
--------------------------------+-------------------------------------------
Comment (by jorge.vargas):

+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>

TurboGears

unread,
Feb 27, 2009, 11:37:46 AM2/27/09
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
--------------------------------+-------------------------------------------

Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.x
Component: SQLAlchemy | Version: 2.0b6
Severity: normal | Resolution:
Keywords: sqlalchemy migrate |
--------------------------------+-------------------------------------------
Comment (by chrisz):

"... 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>

TurboGears

unread,
Feb 28, 2009, 1:52:31 PM2/28/09
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
--------------------------------+-------------------------------------------

Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.x
Component: SQLAlchemy | Version: 2.0b6
Severity: normal | Resolution:
Keywords: sqlalchemy migrate |
--------------------------------+-------------------------------------------
Old 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

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>

TurboGears

unread,
Mar 4, 2009, 11:18:42 AM3/4/09
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
--------------------------------+-------------------------------------------

Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.x
Component: SQLAlchemy | Version: 2.0b6
Severity: normal | Resolution:
Keywords: sqlalchemy migrate |
--------------------------------+-------------------------------------------
Comment (by chrisz):

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>

TurboGears

unread,
Mar 13, 2009, 10:00:06 PM3/13/09
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
--------------------------------+-------------------------------------------

Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.1
Component: SQLAlchemy | Version: 2.0b6

Severity: normal | Resolution:
Keywords: sqlalchemy migrate |
--------------------------------+-------------------------------------------
Changes (by jorge.vargas):

* milestone: 2.x => 2.1

--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:5>

TurboGears

unread,
Dec 1, 2009, 11:10:56 PM12/1/09
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
--------------------------------+-------------------------------------------
Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.1
Component: SQLAlchemy | Version: 2.0b6
Severity: normal | Resolution:
Keywords: sqlalchemy migrate |
--------------------------------+-------------------------------------------
Comment (by jorge.vargas):

FYI, SQLAlchemy 0.6 now has some interesting migration capabilities. It is
rumored to have a "mini-migration-framework" in the next release.

--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:6>

TurboGears

unread,
Feb 22, 2010, 7:51:23 PM2/22/10
to turbogear...@googlegroups.com
#2239: Simplify database migration in TG2
--------------------------------+-------------------------------------------

Reporter: chrisz | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 2.2
Component: SQLAlchemy | Version: 2.0b6

Severity: normal | Resolution:
Keywords: sqlalchemy migrate |
--------------------------------+-------------------------------------------
Changes (by mramm):

* milestone: 2.1 => 2.2

--
Ticket URL: <http://trac.turbogears.org/ticket/2239#comment:7>

Reply all
Reply to author
Forward
0 new messages