20160609193416_create_available_products.rb 434 B

1234567891011121314
  1. class CreateAvailableProducts < ActiveRecord::Migration
  2. def change
  3. drop_table :available_products if (table_exists? :available_products)
  4. create_table :available_products do |t|
  5. t.belongs_to :product, index: true
  6. t.belongs_to :pointsale, index: true
  7. t.decimal :stock_min, null: true
  8. t.decimal :stock_max, null: true
  9. t.decimal :stock, null: true
  10. t.timestamps null: false
  11. end
  12. end
  13. end