Kevin Dangoor wrote:
On 12/30/05, Ian Bicking <[EMAIL PROTECTED]> wrote:

That's one nice thing about the Rails "migrations". They're database
independent, whereas a bunch of ALTER statements likely isn't...

How do they do that?

Anyway, right now you can provide multiple upgrade scripts for different
databases (each upgrade script gets the database name in its filename).
 There's no Python upgrade scripts, which could be useful.


There's no magic to Rails migrations, from what I saw. Think of it as
sqlbuilder for create and alter statements...

Well, if Python scripts were supported, then it would be relatively easy to provide a couple functions specifically for adding and removing columns. Maybe it would look like:

  from myproject import models
  models.MyTable.sqlmeta.columns['foo'].forceAlterAdd()
  models.MyTable.sqlmeta.columns['bar'].forceAlterRemove()

SQLObject *can* do alter statements for different databases (with the sqlmeta.addColumn() method), but that's not used by sqlobject-admin.

That covers a useful amount of situations, but there's also many situations that require custom SQL to do well.

--
Ian Bicking  /  [EMAIL PROTECTED]  /  http://blog.ianbicking.org

Reply via email to