29 lines
1.2 KiB
SQL
29 lines
1.2 KiB
SQL
-- ============================================================================
|
|
-- Stundenzettel Notizen (abhakbare Merkzettel)
|
|
-- Mehrere Notizen pro Stundenzettel möglich
|
|
-- ============================================================================
|
|
|
|
CREATE TABLE llx_stundenzettel_note (
|
|
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
|
|
fk_stundenzettel INTEGER NOT NULL, -- Verknüpfung zum Stundenzettel
|
|
fk_user INTEGER DEFAULT NULL, -- Wer hat erstellt
|
|
|
|
-- Inhalt
|
|
note TEXT NOT NULL, -- Die Notiz selbst
|
|
checked TINYINT(1) DEFAULT 0, -- 0=offen, 1=abgehakt
|
|
|
|
-- Rang für Sortierung
|
|
rang INTEGER DEFAULT 0,
|
|
|
|
-- Technisch
|
|
datec DATETIME DEFAULT NULL, -- Erstellt am
|
|
tms TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
|
|
-- Indizes
|
|
INDEX idx_note_stundenzettel (fk_stundenzettel),
|
|
INDEX idx_note_checked (checked),
|
|
|
|
-- Foreign Key
|
|
CONSTRAINT fk_note_stundenzettel FOREIGN KEY (fk_stundenzettel)
|
|
REFERENCES llx_stundenzettel(rowid) ON DELETE CASCADE
|
|
) ENGINE=InnoDB;
|