mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-01 12:24:28 +01:00
20 lines
524 B
Ruby
20 lines
524 B
Ruby
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
|