{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://dpone.dev/schemas/schema-migration/post-apply-run.schema.json",
  "title": "dpone schema migration post-apply run",
  "type": "object",
  "required": [
    "schema_version",
    "post_apply_run_id",
    "post_apply_plan_id",
    "pack_id",
    "environment",
    "target",
    "status",
    "executed",
    "checks",
    "blockers",
    "warnings",
    "metrics"
  ],
  "additionalProperties": true,
  "properties": {
    "schema_version": {"const": "dpone.schema_migration_post_apply_run.v1"},
    "post_apply_run_id": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "post_apply_plan_id": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "pack_id": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
    "bundle_id": {"type": ["string", "null"]},
    "environment": {"type": "string", "minLength": 1},
    "target": {
      "type": "object",
      "required": ["sink_type", "table"],
      "additionalProperties": true,
      "properties": {
        "sink_type": {"type": "string"},
        "table": {"type": "string"}
      }
    },
    "status": {"enum": ["passed", "dry_run", "blocked"]},
    "executed": {"type": "boolean"},
    "checks": {"type": "array", "items": {"type": "object"}},
    "rollback_window": {"type": "object"},
    "blockers": {"type": "array", "items": {"type": "string"}},
    "warnings": {"type": "array", "items": {"type": "string"}},
    "metrics": {"type": "object"}
  }
}
