How to handle schema migrations?

1 view
Skip to first unread message

Kent Johnson

unread,
Jan 2, 2008, 6:19:55 PM1/2/08
to blogmak...@googlegroups.com
There are some issues with the database migrations in blogmaker that I'm
not sure how to resolve.

The migrations use DbMigration
http://www.aswmc.com/dbmigration/

If you don't have DbMigration installed then I think the migrations will
be ignored. This is not so bad for new users but still leaves existing
users with a problem if the schema changes (which it will, sooner or later).

If you *do* have DM installed then you have a different sort of problem
or two.

- the migrations as supplied are specific to Postgres so if you are
using another DB too bad.

- the migrations as supplied are somewhat broken because the changes
needed to migrate the models from blogmaker to blogmaker.blog cannot all
be applied automatically. (See the comments in MakeBlogPackage.sql:
http://blogmaker.googlecode.com/svn/trunk/blogmaker/blog/migrations/sql/MakeBlogPackage.sql)
This means that DM cannot actually create a DB from scratch.


A few options:

- Drop migrations completely. This is not really an option, I need some
kind of migration support. The schema *will* change.

- Reset the migrations to the current schema. In other words,
- take the current schema as the initial schema
- get rid of all the current migrations
- create a new init.sql that sets up the database

This fixes the problem with MakeBlogPackage.sql and possibly allows the
migrations to work with other databases; the init.sql at least could be
provided for Postgres and sqlite and many of the migrations are simple
enough that they will work with multiple databases.


Any thoughts? Other options?

Kent

Kumar McMillan

unread,
Jan 22, 2008, 12:35:50 PM1/22/08
to blogmak...@googlegroups.com

[sorry, delayed reply]

I think resetting the schema is the best solution. It seems early
enough in the project and it doesn't sound like anyone else has an
objection :) I think it's fairly safe to say that the app names will
not change in the future. The schema will, yes, but *probably* not
the app names.

Kent Johnson

unread,
Apr 15, 2008, 4:15:21 PM4/15/08
to blogmak...@googlegroups.com
Kent Johnson wrote:
> There are some issues with the database migrations in blogmaker that I'm
> not sure how to resolve.
>
> - Reset the migrations to the current schema. In other words,
> - take the current schema as the initial schema
> - get rid of all the current migrations
> - create a new init.sql that sets up the database

I have done this, see
http://code.google.com/p/blogmaker/source/detail?r=90

I did not update the sample database, anyone using sqlite who could
contribute an up-to-date sample DB?

Kent

Reply all
Reply to author
Forward
0 new messages