Files
tinker_tickets/migrations/004_add_ticket_watchers.sql
T

11 lines
385 B
SQL
Raw Normal View History

-- Migration: Add ticket watchers table
-- Allows users to subscribe to ticket updates and receive Matrix notifications.
CREATE TABLE IF NOT EXISTS ticket_watchers (
ticket_id INT NOT NULL,
user_id INT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (ticket_id, user_id),
INDEX idx_watcher_user (user_id)
);