3 class CreateLanguages < ActiveRecord::Migration
5 create_table :languages, innodb_table do |t|
6 t.string :code, :limit => 5, :null => false
7 t.string :name, :null => false
8 t.boolean :translation_available, :null => false, :default => false
11 add_primary_key :languages, [:code]
13 Language.create do |l|
16 l.translation_available = true
19 add_foreign_key :users, [:locale], :languages, [:code]
20 add_foreign_key :diary_entries, [:language], :languages, [:code]
24 raise IrreversibleMigration.new