-- Issue change history
CREATE TABLE IF NOT EXISTS issue_historie (
  id SERIAL PRIMARY KEY,
  issue_id INT NOT NULL REFERENCES issues(id) ON DELETE CASCADE,
  aktion VARCHAR(100) NOT NULL,
  details JSONB,
  erstellt_von UUID REFERENCES users(id),
  erstellt_am TIMESTAMPTZ DEFAULT NOW()
);

CREATE INDEX IF NOT EXISTS idx_issue_historie_issue_id ON issue_historie(issue_id);
