1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/db/migrate/20220712153708_create_products.rb

20 lines
524 B
Ruby
Raw Normal View History

2022-07-13 15:06:46 +02:00
class CreateProducts < ActiveRecord::Migration[5.2]
def change
create_table :products do |t|
t.string :name
t.string :slug
t.string :sku
t.text :description
t.boolean :is_active, default: false
t.belongs_to :product_category, foreign_key: true
t.integer :amount
t.integer :quantity_min
t.jsonb :stock, default: { internal: 0, external: 0 }
t.boolean :low_stock_alert, default: false
t.integer :low_stock_threshold
t.timestamps
end
end
end