summaryrefslogtreecommitdiff
path: root/makima/migrations/20260204000000_checkpoint_validation.sql
blob: debcfac6068e09a854708472233b8cb9d3952a33 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Add validation configuration for checkpoint contracts
-- Checkpoint contracts validate outputs of upstream dependencies before allowing downstream to proceed

-- Add validation column to store checkpoint validation config as JSON
ALTER TABLE chain_contract_definitions ADD COLUMN IF NOT EXISTS validation JSONB DEFAULT NULL;

-- Add comment explaining the validation schema
COMMENT ON COLUMN chain_contract_definitions.validation IS 'Validation config for checkpoint contracts: {checkDeliverables: bool, runTests: bool, checkContent: string, onFailure: "block"|"retry"|"warn", maxRetries: int}';

-- Add validation_status to chain_contracts to track checkpoint pass/fail
ALTER TABLE chain_contracts ADD COLUMN IF NOT EXISTS validation_status VARCHAR(32) DEFAULT NULL;
COMMENT ON COLUMN chain_contracts.validation_status IS 'For checkpoint contracts: "pending", "passed", "failed"';

-- Add validation_result to store detailed validation output
ALTER TABLE chain_contracts ADD COLUMN IF NOT EXISTS validation_result JSONB DEFAULT NULL;
COMMENT ON COLUMN chain_contracts.validation_result IS 'Detailed validation results from checkpoint contract';