I am trying to create a wrapper for a simple table that is just used as an enumeration. Therefore, I want to immediately populate the table with my values. I tried the following:
class CreateUserTypes < ActiveRecord::Migration def self.up create_table :user_types do |t| t.column :type, :string t.timestamps end end def self.down drop_table :user_types end UserType.create :type => "System administrator" UserType.create :type => "Simulation controller" end
but I get this error:
rake aborted! An error has occurred, all later migrations canceled: Could not find table 'user_types'
I followed the Rails wiki and expected it to work.
Thanks. But what you suggested does not seem to work. Well, I do not see the lines.
sqlite> select * from user_types; 1||2009-02-08 12:00:56|2009-02-08 12:00:56 2||2009-02-08 12:00:57|2009-02-08 12:00:57
source share