feat(phase5): scheduling/availability - DB, API, UI in server settings
This commit is contained in:
@@ -435,6 +435,18 @@ CREATE TABLE IF NOT EXISTS list_items (
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_list_items_channel ON list_items(channel_id, position);
|
||||
|
||||
-- Weekly availability
|
||||
CREATE TABLE IF NOT EXISTS availability (
|
||||
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
server_id UUID NOT NULL REFERENCES servers(id) ON DELETE CASCADE,
|
||||
day_of_week VARCHAR(9) NOT NULL CHECK (day_of_week IN ('monday','tuesday','wednesday','thursday','friday','saturday','sunday')),
|
||||
start_time TIME NOT NULL,
|
||||
end_time TIME NOT NULL,
|
||||
PRIMARY KEY (user_id, server_id, day_of_week, start_time)
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_availability_server ON availability(server_id, day_of_week);
|
||||
|
||||
-- Message full-text search
|
||||
ALTER TABLE messages ADD COLUMN IF NOT EXISTS search_vector tsvector;
|
||||
CREATE INDEX IF NOT EXISTS idx_messages_search ON messages USING GIN(search_vector);
|
||||
|
||||
Reference in New Issue
Block a user