foobar
foobar

Reputation: 637

Why is schema.rb not generated (properly) when running rake db:migrate?

I've just started working through the Rails 3 tutorials so that I can develop a bit of familiarity with the framework, but I'm running into issues with the generation of schema.rb. My operating system is Windows 7 x64, Ruby 1.9.2, MySQL2 gem 0.2.6, Rails 3.0.3.

I have two migrations created, one for my lists:

class CreateLists < ActiveRecord::Migration
def self.up
  create_table :lists do |t|
    t.string :name
    t.text :description

    t.timestamps
  end
end

def self.down
    drop_table :lists
  end
end

and one for my List items:

class CreateItems < ActiveRecord::Migration
  def self.up
    create_table :items do |t|
      t.string :name
      t.string :type
      t.boolean :completed
      t.references :list

      t.timestamps
    end
  end

  def self.down
    drop_table :items
  end

end

Rake migrates successfully and the application works as expected, but schema.rb shows only:

ActiveRecord::Schema.define(:version => 20101126074332) do

# Could not dump table "items" because of following ArgumentError
#   invalid date  

# Could not dump table "lists" because of following ArgumentError
#   invalid date

Is anyone a bit more experienced with Rails that could offer advice on what might be causing the problem? Googling turned up nothing.

Upvotes: 4

Views: 1930

Answers (2)

triemstr
triemstr

Reputation: 176

Get the mysql 5.1 libmysql.dll as described in:

https://github.com/brianmario/mysql2/issues#issue/71

Upvotes: 2

Paul Schreiber
Paul Schreiber

Reputation: 12589

Try rake db:schema:dump.

Upvotes: 2

Related Questions