037_ops_alert_silences.sql 684 B

12345678910111213141516171819202122232425262728
  1. -- +goose Up
  2. -- +goose StatementBegin
  3. -- Ops alert silences: scoped (rule_id + platform + group_id + region)
  4. CREATE TABLE IF NOT EXISTS ops_alert_silences (
  5. id BIGSERIAL PRIMARY KEY,
  6. rule_id BIGINT NOT NULL,
  7. platform VARCHAR(64) NOT NULL,
  8. group_id BIGINT,
  9. region VARCHAR(64),
  10. until TIMESTAMPTZ NOT NULL,
  11. reason TEXT,
  12. created_by BIGINT,
  13. created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
  14. );
  15. CREATE INDEX IF NOT EXISTS idx_ops_alert_silences_lookup
  16. ON ops_alert_silences (rule_id, platform, group_id, region, until);
  17. -- +goose StatementEnd
  18. -- +goose Down
  19. -- +goose StatementBegin
  20. DROP TABLE IF EXISTS ops_alert_silences;
  21. -- +goose StatementEnd