feat: add database schema migrations and seed data
8 SQL migration files covering all 10 tables, RLS policies with SECURITY DEFINER helpers, and seed data for SCW1 site + 3 zones. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AWxyMibCuGGtSQSqfajDQ7
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
-- supabase/migrations/20260709000008_seed.sql
|
||||
-- Test site: Setia Corp Warehouse 1
|
||||
INSERT INTO sites (id, name, address, region, active)
|
||||
VALUES (
|
||||
'00000000-0000-0000-0000-000000000001'::UUID,
|
||||
'SCW1',
|
||||
'No. 1, Jalan Industri 1, Shah Alam, Selangor',
|
||||
'Central',
|
||||
true
|
||||
)
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
|
||||
-- Zones for SCW1
|
||||
INSERT INTO zones (id, site_id, name, qr_code_token)
|
||||
VALUES
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000010'::UUID,
|
||||
'00000000-0000-0000-0000-000000000001'::UUID,
|
||||
'Dock A',
|
||||
'scw1-dock-a-qr-2026'
|
||||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000011'::UUID,
|
||||
'00000000-0000-0000-0000-000000000001'::UUID,
|
||||
'Cold Storage',
|
||||
'scw1-cold-storage-qr-2026'
|
||||
),
|
||||
(
|
||||
'00000000-0000-0000-0000-000000000012'::UUID,
|
||||
'00000000-0000-0000-0000-000000000001'::UUID,
|
||||
'Loading Bay',
|
||||
'scw1-loading-bay-qr-2026'
|
||||
)
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
Reference in New Issue
Block a user