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? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060404/27272521/attachment.html
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 4/4/06, Paul Barry <mail@paulbarry.com> wrote:> > 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? >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060404/c6d81c67/attachment.html
http://wiki.rubyonrails.com/rails/pages/UnderstandingMigrations About three quarters of the way down that page is a brief mention of adding look up data from a migration. Anthony On 4/4/06, Paul Barry <mail@paulbarry.com> wrote:> 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? > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >