Rob Sanheim
2006-Jul-06 06:01 UTC
[Rails] migrations work from script/console, but not command line
Having a weird issue where I can migration to version 1, but then go no further, and cannot go back to 0 -- but only from the command line. If I open up script/console I can do migrations just fine - down to 0 or up to 2, via ActiveRecord::Migrator. So I know the migrations must be valid, and I can verify that tables are created or destroyed in the database. Does anyone have any idea why this would happen? Platform is mac os x, Rails 1.12, Ruby 1.84, etc, just playing around with the Simplelog blog app. - rob -- http://www.robsanheim.com http://www.seekingalpha.com http://www.ajaxian.com
Rob Sanheim
2006-Jul-06 06:05 UTC
[Rails] Re: migrations work from script/console, but not command line
On 7/6/06, Rob Sanheim <rsanheim@gmail.com> wrote:> Having a weird issue where I can migration to version 1, but then go > no further, and cannot go back to 0 -- but only from the command line.[snip] Also, here is the log output for a failed migration from the command line, this is doing a plain "rake migrate" when the schema version is at 1 in the db, and I have a 002_xxx migration in db/migrate. This same migration works fine from the console. SQL (0.000000) Mysql::Error: Table ''schema_info'' already exists: CREATE TABLE schema_info (version int(11)) SQL (0.000267) SELECT version FROM schema_info SQL (0.000218) SELECT version FROM schema_info SQL (0.000162) SELECT version FROM schema_info SQL (0.000486) SELECT * FROM schema_info SQL (0.000624) SHOW TABLES SQL (0.068066) SHOW FIELDS FROM posts SQL (0.000620) SHOW KEYS FROM posts - rob