I think if you change one of them to 002_ ... it will probably work.

On Tue, Apr 28, 2009 at 2:36 PM, Olly <[email protected]>wrote:

>
> As far as I understand the command line for sequel, it should be
> possible to apply a database schema (even with more than one table/
> file) by the following:
>  sequel -E -m migations sqlite://db/dev.db
>
> But Sequel does only apply one file of that directory.
>
> This is my structure:
> /tmp
> /tmp/migrations
> /tmp/migrations/001_tablea.rb
> /tmp/migrations/001_tableb.rb
> /tmp/db
>
> I run 'sequel -E -m migrations sqlite://db/dev.db' (at /tmp level)
> with this result:
> I, [2009-04-28T23:16:09.640000 #1800]  INFO -- : SELECT * FROM
> `schema_info` LIMIT 1
> I, [2009-04-28T23:16:09.640000 #1800]  INFO -- : CREATE TABLE
> `schema_info` (`version` integer)
> I, [2009-04-28T23:16:09.790000 #1800]  INFO -- : SELECT * FROM
> `schema_info` LIMIT 1
> I, [2009-04-28T23:16:09.810000 #1800]  INFO -- : Transaction.begin
> I, [2009-04-28T23:16:09.810000 #1800]  INFO -- : CREATE TABLE `b`
> (`id` integer PRIMARY KEY AUTOINCREMENT)
> I, [2009-04-28T23:16:09.820000 #1800]  INFO -- : SELECT * FROM
> `schema_info` LIMIT 1
> I, [2009-04-28T23:16:09.830000 #1800]  INFO -- : SELECT * FROM
> `schema_info` LIMIT 1
> I, [2009-04-28T23:16:09.830000 #1800]  INFO -- : INSERT INTO
> `schema_info` (`version`) VALUES (1)
> I, [2009-04-28T23:16:09.921000 #1800]  INFO -- : Transaction.commit
>
> But where is table 'a'? Why was it not created?
>
> Here the table definitions:
>
> 001_tablea.rb
> class CreateA < Sequel::Migration
>  def up
>    create_table :a do
>      primary_key :id, :integer
>    end
>  end
>
>  def down
>    drop_table :a
>  end
> end
>
> 001_tableb.rb
> class CreateB < Sequel::Migration
>  def up
>    create_table :b do
>      primary_key :id, :integer
>    end
>  end
>
>  def down
>    drop_table :b
>  end
> end
>
> How are migrations supposed to use?! Am I completely wrong?
>
> Thank you very much in advance!
>
> Oliver.
> >
>


-- 
Scott
http://steamcode.blogspot.com/

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