init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
-- Outlet settings table
|
||||
CREATE TABLE outlet_settings (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
outlet_id UUID NOT NULL REFERENCES outlets(id) ON DELETE CASCADE,
|
||||
key VARCHAR(255) NOT NULL,
|
||||
value TEXT,
|
||||
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
|
||||
UNIQUE(outlet_id, key)
|
||||
);
|
||||
|
||||
-- Indexes
|
||||
CREATE INDEX idx_outlet_settings_outlet_id ON outlet_settings(outlet_id);
|
||||
CREATE INDEX idx_outlet_settings_key ON outlet_settings(key);
|
||||
CREATE INDEX idx_outlet_settings_created_at ON outlet_settings(created_at);
|
||||
Reference in New Issue
Block a user