This commit is contained in:
aditya.siregar
2025-07-18 20:10:29 +07:00
parent 1bceae010b
commit 4f5950543e
511 changed files with 24132 additions and 34137 deletions
@@ -0,0 +1,18 @@
-- Outlets table
CREATE TABLE outlets (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
name VARCHAR(255) NOT NULL,
address TEXT,
timezone VARCHAR(50),
currency VARCHAR(3) DEFAULT 'USD',
tax_rate DECIMAL(5,4) DEFAULT 0.0000 CHECK (tax_rate >= 0 AND tax_rate <= 1),
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_outlets_organization_id ON outlets(organization_id);
CREATE INDEX idx_outlets_is_active ON outlets(is_active);
CREATE INDEX idx_outlets_created_at ON outlets(created_at);