Sha256: e58202f02e84c356f63841f31dd47ca1f70d5cecf57d1ae4874461226d4c7ce2

Contents?: true

Size: 667 Bytes

Versions: 4

Compression:

Stored size: 667 Bytes

Contents

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
translated_attributes-0.5.4 MIGRATION
translated_attributes-0.5.3 MIGRATION
translated_attributes-0.5.2 MIGRATION
translated_attributes-0.5.1 MIGRATION