Added availability date to product table
[depot.git] / db / migrate / 20090202124100_add_product_date_available.rb
diff --git a/db/migrate/20090202124100_add_product_date_available.rb b/db/migrate/20090202124100_add_product_date_available.rb
new file mode 100644 (file)
index 0000000..4c05607
--- /dev/null
@@ -0,0 +1,13 @@
+class AddProductDateAvailable < ActiveRecord::Migration
+  def self.up
+    add_column :products, :date_available, :date
+    
+    Product.update(1, :date_available => Time.utc(2008, 12, 25))
+    Product.update(2, :date_available => Time.utc(2010, 12, 25))
+    Product.update(3, :date_available => Time.utc(2009,  1,  1))
+  end
+
+  def self.down
+    remove_column :products, :date_available
+  end
+end