Added locales table.
This commit is contained in:
parent
46557532aa
commit
25cbaf1111
1 changed files with 25 additions and 0 deletions
25
db/migrate/20150421000000_create_locale.rb
Normal file
25
db/migrate/20150421000000_create_locale.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
class CreateLocale < ActiveRecord::Migration
|
||||
def up
|
||||
create_table :locales do |t|
|
||||
t.string :locale, :limit => 20, :null => false
|
||||
t.string :alias, :limit => 20, :null => true
|
||||
t.string :name, :limit => 255, :null => false
|
||||
t.boolean :active, :null => false, :default => true
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
|
||||
add_index :locales, [:locale], :unique => true
|
||||
add_index :locales, [:name], :unique => true
|
||||
|
||||
Locale.create(
|
||||
:locale => 'en-us',
|
||||
:alias => 'en',
|
||||
:name => 'English (United States)',
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue