Re: [SQLObject] bug in sqlobject-admin
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2010-04-20 11:45:42
|
On Mon, Apr 19, 2010 at 04:11:09PM +0300, Imri Goldberg wrote: > Re using sqlobject-admin: I'm curious - what is your preferred way of > managing db migrations (i.e. versioning schema changes)? I seldom do a simple ADD/DELETE COLUMN. Usually when I change the schema it's more like "collect some info, ADD COLUMN, put info into the new column". Something like this (code from a real script upgradedb5.py): log.open("upgradedb5.log") if db_conn.dbName == 'sqlite': db_conn.use_table_info = True if 'userID' not in ExportResult.sqlmeta.columns: ExportResult.sqlmeta.addColumn(ForeignKey('User', name="user", default=None), changeSchema=True) for result in ExportResult.select(ExportResult.q.plate <> None): result.user = result.plate.user commit() log.close() This is a rather simple example. Sometime there is a lot of code to collect information before schema changing and even more code that puts the collected information into the new columns. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |