3 class CreateLanguages < ActiveRecord::Migration
5 create_table :languages, innodb_table do |t|
6 t.string :code, :null => false
7 t.string :english_name, :null => false
11 add_primary_key :languages, [:code]
13 Language.load("#{Rails.root}/config/languages.yml")
15 add_foreign_key :users, [:locale], :languages, [:code]
16 add_foreign_key :diary_entries, [:language_code], :languages, [:code]
20 raise IrreversibleMigration.new