chore: initial commit Dutra Store POS app
This commit is contained in:
15
supabase/migrations/20240101_add_cancel_and_min_stock.sql
Normal file
15
supabase/migrations/20240101_add_cancel_and_min_stock.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- 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;
|
||||
20
supabase/migrations/20240102_add_harga_pokok_and_profit.sql
Normal file
20
supabase/migrations/20240102_add_harga_pokok_and_profit.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- Migration: Add harga_pokok to products and total_cost to sales
|
||||
-- Run this in Supabase Dashboard > SQL Editor
|
||||
|
||||
-- Add harga_pokok column to products table
|
||||
ALTER TABLE products
|
||||
ADD COLUMN IF NOT EXISTS harga_pokok numeric DEFAULT 0;
|
||||
|
||||
-- Add total_cost column to sales table
|
||||
ALTER TABLE sales
|
||||
ADD COLUMN IF NOT EXISTS total_cost numeric DEFAULT 0;
|
||||
|
||||
-- Update existing products to have default harga_pokok if null
|
||||
UPDATE products
|
||||
SET harga_pokok = 0
|
||||
WHERE harga_pokok IS NULL;
|
||||
|
||||
-- Update existing sales to have default total_cost if null
|
||||
UPDATE sales
|
||||
SET total_cost = 0
|
||||
WHERE total_cost IS NULL;
|
||||
9
supabase/migrations/20240103_add_payment_method.sql
Normal file
9
supabase/migrations/20240103_add_payment_method.sql
Normal file
@@ -0,0 +1,9 @@
|
||||
-- Migration: add payment method fields to sales table
|
||||
-- Run this in Supabase SQL Editor before using payment features
|
||||
|
||||
ALTER TABLE sales
|
||||
ADD COLUMN IF NOT EXISTS payment_method text NOT NULL DEFAULT 'tunai',
|
||||
ADD COLUMN IF NOT EXISTS split_payment jsonb;
|
||||
|
||||
-- Optional: add index for filtering by payment method
|
||||
CREATE INDEX IF NOT EXISTS idx_sales_payment_method ON sales(payment_method);
|
||||
Reference in New Issue
Block a user