29 Mar
Sexy migration plugin
Un plug-in per semplificare la scrittura delle migrazioni compatibile al 100% con le vostre vecchie migrazioni.
si passa da così:
1 2 create_table :updates do |t| 3 t.column :user_id, :integer 4 t.column :group_id, :integer 5 t.column :body, :text 6 t.column :type, :string 7 8 t.column :created_at, :datetime 9 t.column :updated_at, :datetime 10 end 11 12 13 drop_table :updates 14 end 15 end
a così:
1 2 create_table :updates do 3 foreign_key :user 4 foreign_key :group 5 6 text :body 7 string :type 8 9 timestamps! 10 end 11 12 13 drop_table :updates 14 end 15 end
Come installarlo?
Come si è soliti fare per intallare un plug in:
1 $ ./script/plugin install \ svn://errtheblog.com/svn/plugins/sexy_migrations
Grazie ai ragazzi di ErrtheBlog.


Love it!
Thanks Duccio.