CREATE TABLE IF NOT EXISTS tillsyner (
  id            VARCHAR(36)   PRIMARY KEY,
  handlaggare_id VARCHAR(36)  NOT NULL,
  title         VARCHAR(255)  NOT NULL,
  date          DATE          NOT NULL,
  time          VARCHAR(10)   NOT NULL,
  tags          JSON          DEFAULT (JSON_ARRAY()),
  arendenummer  VARCHAR(100)  DEFAULT '',
  adress        VARCHAR(255)  DEFAULT '',
  anteckning    TEXT          DEFAULT '',
  status        VARCHAR(50)   DEFAULT 'Planerad',
  reminder      VARCHAR(10)   DEFAULT '',
  created_at    DATETIME      DEFAULT NOW(),
  updated_at    DATETIME      DEFAULT NOW() ON UPDATE NOW(),
  FOREIGN KEY (handlaggare_id) REFERENCES handlaggare(id) ON DELETE CASCADE
);
