-- Migration: Tillsynsfoton
-- Kör i cPanel MySQL eller mot databasen direkt

CREATE TABLE IF NOT EXISTS tillsyn_photos (
  id             INT          NOT NULL AUTO_INCREMENT PRIMARY KEY,
  tillsyn_id     INT          NOT NULL,
  handlaggare_id INT          NOT NULL,
  filename       VARCHAR(255) NOT NULL,
  original_name  VARCHAR(255) NOT NULL,
  file_size      INT          NOT NULL,
  created_at     DATETIME     NOT NULL DEFAULT NOW(),
  expires_at     DATETIME     NOT NULL,
  postponed      TINYINT(1)   NOT NULL DEFAULT 0,
  INDEX idx_tillsyn     (tillsyn_id),
  INDEX idx_handlaggare (handlaggare_id),
  INDEX idx_expires     (expires_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
