Files
app-grosir/supabase/migrations/20240101_add_cancel_and_min_stock.sql
2026-07-23 22:12:32 +07:00

16 lines
483 B
SQL

-- Migration: Add is_cancelled to sales and min_stock to products
-- Run this in Supabase Dashboard > SQL Editor
-- Add is_cancelled column to sales table
ALTER TABLE sales
ADD COLUMN IF NOT EXISTS is_cancelled BOOLEAN DEFAULT false;
-- Add min_stock column to products table
ALTER TABLE products
ADD COLUMN IF NOT EXISTS min_stock INTEGER DEFAULT 5;
-- Update existing products to have default min_stock if null
UPDATE products
SET min_stock = 5
WHERE min_stock IS NULL;