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

22 lines
555 B
Ruby
Raw Normal View History

2022-07-22 18:48:28 +02:00
# frozen_string_literal: true
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