Add Customer users

This commit is contained in:
Aditya Siregar
2025-08-03 23:55:51 +07:00
parent 96743cf50b
commit 5741243425
69 changed files with 3005 additions and 158 deletions
@@ -0,0 +1,17 @@
-- Units table
CREATE TABLE units (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
outlet_id UUID REFERENCES outlets(id) ON DELETE CASCADE,
name VARCHAR(50) NOT NULL,
abbreviation VARCHAR(10),
is_active BOOLEAN DEFAULT true,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Indexes
CREATE INDEX idx_units_organization_id ON units(organization_id);
CREATE INDEX idx_units_outlet_id ON units(outlet_id);
CREATE INDEX idx_units_is_active ON units(is_active);
CREATE INDEX idx_units_created_at ON units(created_at);