]> git.openstreetmap.org Git - rails.git/blobdiff - db/migrate/033_change_diary_entries_language.rb
Merge pull request #31 from zerebubuth/routing-ui-tweaks-2
[rails.git] / db / migrate / 033_change_diary_entries_language.rb
index 7d4fa1713e6722f8e5b6afaebceb5239209e9b2d..674ae3d49a7486e0f09a275df8dd81b90bc32b6c 100644 (file)
@@ -1,9 +1,11 @@
 class ChangeDiaryEntriesLanguage < ActiveRecord::Migration
   def self.up
 class ChangeDiaryEntriesLanguage < ActiveRecord::Migration
   def self.up
-    change_column "diary_entries", "language", :string, :default => "en", :null => false
+    remove_column "diary_entries", "language"
+    add_column "diary_entries", "language_code", :string, :null => false, :default => "en"
   end
 
   def self.down
   end
 
   def self.down
-    change_column "diary_entries", "language", :string, :limit => 3, :default => nil, :null => true
+    remove_column "diary_entries", "language_code"
+    add_column "diary_entries", "language", :string, :limit => 3
   end
 end
   end
 end