Add the VideoPolicy model, to hold all the base prices and periods
[cs356-p2-videostore.git] / db / schema.rb
index 13107c5..c89ecac 100644 (file)
@@ -2,7 +2,13 @@
 # migrations feature of ActiveRecord to incrementally modify your database, and
 # then regenerate this schema definition.
 
-ActiveRecord::Schema.define(:version => 3) do
+ActiveRecord::Schema.define(:version => 22) do
+
+  create_table "bitems", :force => true do |t|
+    t.column "customer_id",    :integer, :null => false
+    t.column "merchandise_id", :integer, :null => false
+    t.column "date",           :date,    :null => false
+  end
 
   create_table "coitems", :force => true do |t|
     t.column "customer_id", :integer
@@ -13,15 +19,64 @@ ActiveRecord::Schema.define(:version => 3) do
 
   create_table "customers", :force => true do |t|
     t.column "name",    :string
-    t.column "address", :string
+    t.column "address", :text,    :limit => 255
     t.column "email",   :string
     t.column "phone",   :string
-    t.column "debt",    :decimal, :precision => 8, :scale => 2, :default => 0.0
+    t.column "debt",    :decimal,                :default => 0.0
+  end
+
+  create_table "medias", :force => true do |t|
+    t.column "name", :string, :null => false
+  end
+
+  create_table "merchandise_purchases", :force => true do |t|
+  end
+
+  create_table "merchandises", :force => true do |t|
+    t.column "title",    :string,                                                 :null => false
+    t.column "quantity", :integer,                               :default => 0,   :null => false
+    t.column "price",    :decimal, :precision => 8, :scale => 2, :default => 0.0
+  end
+
+  create_table "purchases", :force => true do |t|
+    t.column "type",           :string
+    t.column "customer_id",    :integer
+    t.column "date",           :date
+    t.column "price",          :decimal, :default => 0.0
+    t.column "rentable_id",    :integer
+    t.column "merchandise_id", :integer
+    t.column "quantity",       :integer
+  end
+
+  create_table "rentable_policies", :force => true do |t|
+    t.column "name",        :string,  :null => false
+    t.column "value",       :integer
+    t.column "description", :string,  :null => false
   end
 
   create_table "rentables", :force => true do |t|
-    t.column "title", :string
-    t.column "genre", :string
+    t.column "type",        :string
+    t.column "title",       :string
+    t.column "newrelease",  :boolean, :default => false
+    t.column "video_genre", :integer
+    t.column "director",    :string
+    t.column "media",       :integer
+    t.column "game_genre",  :integer
+    t.column "platform",    :integer
+  end
+
+# Could not dump table "sqlite_sequence" because of following StandardError
+#   Unknown type '' for column 'name'
+
+  create_table "video_policies", :force => true do |t|
+    t.column "day",         :integer,                               :null => false
+    t.column "fee",         :decimal, :precision => 8, :scale => 2, :null => false
+    t.column "period",      :integer
+    t.column "description", :string
+  end
+
+  create_table "videogenres", :force => true do |t|
+    t.column "name", :string, :null => false
   end
 
 end