Class: CreateStringTranslations

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/mobility/templates/create_string_translations.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/generators/mobility/templates/create_string_translations.rb', line 3

def change
  create_table :mobility_string_translations do |t|
    t.string  :locale
    t.string  :key
    t.string  :value
    t.integer :translatable_id
    t.string  :translatable_type
    t.timestamps
  end
  add_index :mobility_string_translations, [:translatable_id, :translatable_type, :locale, :key], unique: true, name: :index_mobility_string_translations_on_keys
  add_index :mobility_string_translations, [:translatable_id, :translatable_type], name: :index_mobility_string_translations_on_translatable
end