Class: CreateLocalizedFields
- Inherits:
-
ActiveRecord::Migration
- Object
- ActiveRecord::Migration
- CreateLocalizedFields
- Defined in:
- lib/generators/localized_fields/templates/migration.rb
Class Method Summary collapse
Class Method Details
.down ⇒ Object
16 17 18 |
# File 'lib/generators/localized_fields/templates/migration.rb', line 16 def self.down drop_table :localized_fields end |
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/generators/localized_fields/templates/migration.rb', line 2 def self.up create_table :localized_fields do |t| t.string :localized_object_type t.integer :localized_object_id t.string :locale t.string :field_name t.text :value #Any additional fields here t. end add_index :localized_fields,[:localized_object_type,:localized_object_id], :name => 'index_localized_fields_on_object_type_and_id' end |