Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Migrations will not run on a fresh database

#1

When migrating to a specified version on a clean db, the schema_migrations table can't be found, and an error is raised.

On a clean rails app:

  script/generate migration Foo
         create  db/migrate
         create  db/migrate/20080414172731_foo.rb

  rake db:migrate VERSION=20080414172731
         rake aborted!
         SQLite3::SQLException: no such table: schema_migrations: SELECT version FROM schema_migrations

Reported by Ian White · April 14th, 2008 @ 06:33 PM

State: committed
Milestone: none
Assigned to: josh josh
Importance: none

Activity

  1. Ian White
    Ian White

    Here's a git patch that adds a test for the above ticket, and fixes it

    April 14th, 2008 @ 06:40 PM

  2. Ian White
  3. Ian White
  4. Sam Granieri
    Sam Granieri

    +1

    Nice catch Ian, but the workflow you describe in getting to the problem is something i've never experienced

    April 14th, 2008 @ 11:08 PM

  5. Ian White
    Ian White

    If your test/ci stuff wipes out a database then migrates up to a particular version, then you'll see this.

    The reason I saw is that this is exactly what rspec does. See http://rspec.lighthouseapp.com/p...

    April 15th, 2008 @ 10:15 AM

  6. Ian White
  7. josh
    josh
    • State changed from new to open
    • Assigned user set to josh
    • Title changed from Since r9244, migrations broken on clean db to Migrations will not run on a fresh database

    April 17th, 2008 @ 07:33 PM

  8. Repository
    Repository
    • State changed from open to resolved

    (from [82b4faf81218bbd8916ab559590db236c7f80e46]) Fix migrations when migrating to a specified version number with a fresh database [#1 state:resolved]

    Signed-off-by: Joshua Peek

    http://github.com/rails/rails/co...

    April 17th, 2008 @ 07:44 PM

  9. Repository
    Repository
    • Tag set to activerecord, migrations, patch

    (from [38136f86dc5504bde94dc7399d4a854023d7481f]) DDL transactions and savepoints for sqlite

    Sqlite has had DDL transactions since 2.0.0[1] and savepoints since 3.6.8[2]. This patch updates the connection_adapters.

    [1] http://tinyurl.com/sqlite-v2-0-0 [2] http://tinyurl.com/sqlite-v3-6-8

    Signed-off-by: Michael Koziarski michael@koziarski.com [#2080 state:committed] http://github.com/rails/rails/co...

    March 2nd, 2009 @ 05:47 AM

  10. Repository
    Repository

    (from [38136f86dc5504bde94dc7399d4a854023d7481f]) DDL transactions and savepoints for sqlite

    Sqlite has had DDL transactions since 2.0.0[1] and savepoints since 3.6.8[2]. This patch updates the connection_adapters.

    [1] http://tinyurl.com/sqlite-v2-0-0 [2] http://tinyurl.com/sqlite-v3-6-8

    Signed-off-by: Michael Koziarski michael@koziarski.com [#2080 state:committed] http://github.com/rails/rails/co...

    March 2nd, 2009 @ 05:47 AM