class AddTranslations < ActiveRecord::Migration def self.up #you can remove the limit/null constrains #this is simply my recommended way of setting things up (save + limits needed storage space) create_table :translations do |t| t.column :translatable_id, :integer, :null=>false t.column :translatable_type, :string, :limit=>40, :null=>false t.column :language, :string, :limit=>2, :null=>false t.column :attribute, :string, :limit=>40, :null=>false t.column :text, :text, :null=>false end add_index :translations, [:translatable_id, :translatable_type] end def self.down drop_table :translations end end