Class: CreateZLocalizeTranslationsTable

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/zlocalize/rails/generators/templates/translations_migration_template.rb

Class Method Summary collapse

Class Method Details

.downObject



18
19
20
# File 'lib/zlocalize/rails/generators/templates/translations_migration_template.rb', line 18

def self.down
  drop_table :translations
end

.upObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/zlocalize/rails/generators/templates/translations_migration_template.rb', line 4

def self.up
   create_table :translations do |t|
     t.string :translated_type
     t.integer :translated_id
     t.string :name
     t.string :locale
     t.text :value

     t.timestamps
  end
  add_index 'translations', ['translated_type','translated_id'], :name => 'index_on_translated'
  add_index 'translations', ['name','locale'], :name => 'index_for_lookup'
end