31 lines
996 B
SQL
31 lines
996 B
SQL
-- Users table (minimal)
|
|
CREATE TABLE IF NOT EXISTS users (
|
|
id UUID PRIMARY KEY,
|
|
username VARCHAR(255) UNIQUE NOT NULL,
|
|
password_hashed BYTEA NOT NULL,
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Notifications table
|
|
CREATE TABLE IF NOT EXISTS notifications (
|
|
id UUID PRIMARY KEY,
|
|
user_uuid UUID REFERENCES users(id) ON DELETE CASCADE UNIQUE,
|
|
discord_webhook VARCHAR(500),
|
|
discord_enabled BOOLEAN DEFAULT FALSE,
|
|
ntfy_topic VARCHAR(255),
|
|
ntfy_enabled BOOLEAN DEFAULT FALSE,
|
|
last_message_sent TIMESTAMP,
|
|
current_notification_status VARCHAR(50) DEFAULT 'inactive',
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
);
|
|
|
|
-- Add your domain tables below
|
|
-- Example:
|
|
-- CREATE TABLE IF NOT EXISTS examples (
|
|
-- id UUID PRIMARY KEY,
|
|
-- user_uuid UUID REFERENCES users(id) ON DELETE CASCADE,
|
|
-- name VARCHAR(255) NOT NULL,
|
|
-- created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
|
-- );
|