Hello, I'm just taking a look at migrations, seems like a fantastic way to maintain the database. I am wonder if there is a way to maintain what I'll call "reference data" along with the migrations. A lot of times in apps your have tables that have pretty static data, often used to generate select lists. Is there a way to insert the reference data into these tables using migrations?
on 2006-04-04 21:50
on 2006-04-04 21:53
Nevermind, RTFM class AddSystemSettings < ActiveRecord::Migration def self.up create_table :system_settings do |t| t.column :name, :string t.column :label, :string t.column :value, :text t.column :type, :string t.column :position, :integer end SystemSetting.create :name => "notice", :label => "Use notice?", :value => 1 end
on 2006-04-04 21:57
http://wiki.rubyonrails.com/rails/pages/Understand... About three quarters of the way down that page is a brief mention of adding look up data from a migration. Anthony