Sha256: 6d2e4dfb3c4ff60e68430e487a72369376b4e1fe6893499db527dc3eb76abdc8
Contents?: true
Size: 1.2 KB
Versions: 36
Compression:
Stored size: 1.2 KB
Contents
# encoding: utf-8 class AddMagicLocales < ActiveRecord::Migration def up # ## Locales create_table :mgclang_locales do |t| # t.string :name t.string :natural_name t.string :iso_code t.string :locale_state, default: "inactive" t.timestamps end add_index :mgclang_locales, :iso_code, unique: true MagicLocales::Locale.create_translation_table! :name => :string # ## (spoken) Languages create_table :mgclang_languages do |t| t.string :level t.references :owner, polymorphic: true t.references :locale t.timestamps end add_index :mgclang_languages, [:owner_type, :owner_id] add_index :mgclang_languages, :locale_id # ## seed default Locales load "#{ Rails.root }/db/seeds/locales.rb" end def down ## Addresses remove_index :mgclang_locales, :iso_code drop_table :mgclang_locales MagicAddresses::Address.drop_translation_table! remove_index :mgclang_languages, :locale_id remove_index :mgclang_languages, [:owner_type, :owner_id] drop_table :mgclang_languages end end
Version data entries
36 entries across 23 versions & 1 rubygems