- Add AI Kurzy module with courses, participants, and registrations management - Add project documents and service documents features - Add service folders for document organization - Add SQL import queries for services from firmy.slovensko.ai - Update todo notifications and group messaging - Various API improvements and bug fixes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
27 lines
959 B
SQL
27 lines
959 B
SQL
-- Create service_folders table
|
|
CREATE TABLE IF NOT EXISTS service_folders (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
name TEXT NOT NULL,
|
|
created_by UUID REFERENCES users(id) ON DELETE SET NULL,
|
|
created_at TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
updated_at TIMESTAMP DEFAULT NOW() NOT NULL
|
|
);
|
|
|
|
-- Create service_documents table
|
|
CREATE TABLE IF NOT EXISTS service_documents (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
folder_id UUID NOT NULL REFERENCES service_folders(id) ON DELETE CASCADE,
|
|
file_name TEXT NOT NULL,
|
|
original_name TEXT NOT NULL,
|
|
file_path TEXT NOT NULL,
|
|
file_type TEXT NOT NULL,
|
|
file_size INTEGER NOT NULL,
|
|
description TEXT,
|
|
uploaded_by UUID REFERENCES users(id) ON DELETE SET NULL,
|
|
uploaded_at TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
created_at TIMESTAMP DEFAULT NOW() NOT NULL
|
|
);
|
|
|
|
-- Create indexes for faster lookups
|
|
CREATE INDEX IF NOT EXISTS idx_service_documents_folder_id ON service_documents(folder_id);
|