CREATE TABLE IF NOT EXISTS plugin_schichtuebergabe_notes ( id INTEGER PRIMARY KEY AUTOINCREMENT, staff_id INTEGER NOT NULL, department_id INTEGER NULL, message TEXT NOT NULL, is_important INTEGER NOT NULL DEFAULT 0, created_at TEXT NOT NULL ); CREATE INDEX IF NOT EXISTS idx_plugin_schichtuebergabe_created ON plugin_schichtuebergabe_notes (created_at); CREATE TABLE IF NOT EXISTS plugin_schichtuebergabe_reads ( note_id INTEGER NOT NULL, staff_id INTEGER NOT NULL, read_at TEXT NOT NULL, PRIMARY KEY (note_id, staff_id) )