Tweak migration to ensure that migrating from a database with existing
authorTom Hughes <tom@compton.nu>
Sun, 7 Jun 2009 10:01:28 +0000 (10:01 +0000)
committerTom Hughes <tom@compton.nu>
Sun, 7 Jun 2009 10:01:28 +0000 (10:01 +0000)
diary entries sets a default language for those entries.

db/migrate/033_change_diary_entries_language.rb

index 2ca844884610b1902651f2cac2233987797be644..674ae3d49a7486e0f09a275df8dd81b90bc32b6c 100644 (file)
@@ -1,7 +1,7 @@
 class ChangeDiaryEntriesLanguage < ActiveRecord::Migration
   def self.up
     remove_column "diary_entries", "language"
-    add_column "diary_entries", "language_code", :string
+    add_column "diary_entries", "language_code", :string, :null => false, :default => "en"
   end
 
   def self.down