OSDN Git Service

t#29312:any update
[pettanr/pettanr.git] / db / migrate / 20120815021444_add_md5.rb
diff --git a/db/migrate/20120815021444_add_md5.rb b/db/migrate/20120815021444_add_md5.rb
new file mode 100644 (file)
index 0000000..51c2684
--- /dev/null
@@ -0,0 +1,13 @@
+class AddMd5 < ActiveRecord::Migration
+  def up
+    add_column :original_pictures, :md5, :string, :null => false, :limit => 32, :default => '00000000000000000000000000000000'
+    add_column :pictures, :md5, :string, :null => false, :limit => 32, :default => '00000000000000000000000000000000'
+    add_column :resource_pictures, :md5, :string, :null => false, :limit => 32, :default => '00000000000000000000000000000000'
+  end
+
+  def down
+    remove_column :original_pictures, :md5
+    remove_column :pictures, :md5
+    remove_column :resource_pictures, :md5
+  end
+end