1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-12 23:09:03 +01:00
fab-manager/db/migrate/20220712153708_create_products.rb
2022-08-03 10:18:00 +02:00

22 lines
555 B
Ruby

# frozen_string_literal: true
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