On Mar 17, 1:12 pm, Scott LaBounty <[email protected]> wrote:
> Say I have two migration files 001_TestMigration1.rb and
> 002_TestMigration2.rb with the first containing a create_table and the
> second containing an alter_table/add_column for up and the down containing
> drop_table and drop_column respectively.
>
> What do I need to do to apply these migrations? I've tried a couple of
> things:
>
> sequel -m . -M 1 sqlite://test.db

Don't specify -M unless you want to migrate to a specific version.  If
you just want to migrate to the current version, just leave off -M.
You can use the -E option to echo the SQL it sends to the database, so
you can see what migrations are run.

> which I thought would run the first migration but didn't. I also tried
> programatically running:

Hmm, it should just run the first migration if you are using -M 1 and
no migrations have yet been run.  If you put your reply with your
migration code, I'll test it.

> require 'rubygems'
> require 'sequel'
> Sequel::Migrator.apply(DB, '.', 1, 1) # To current version

I don't think you want both of those numbers to be 1. I believe one
specifies the version you are migrating from and the other the version
to migrate to, so if they are equal it shouldn't do much.

Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to