Database governance built for humans and agents — controlling changes and access across every major database.
Move SchemaChangeType to Release Level
Date: 2026-01-04 Status: Approved
Overview
Move SchemaChangeType/Type from the per-file level to the release level in both store protos and v1 API protos. All files in a release should share the same migration strategy.
Current Structure
Store Protos (proto/store/store/)
SchemaChangeTypeenum defined incommon.protoReleasePayload.FilehasSchemaChangeType type = 5;(per-file)RevisionPayloadhasSchemaChangeType type = 6;(per-revision)
V1 API Protos (proto/v1/v1/)
Release.Filehas nestedenum TypeandType type = 5;(per-file)Revisionhas nestedenum TypeandType type = 14;(per-revision)
Proposed Structure
Store Protos
ReleasePayloadgetsSchemaChangeType type = 4;(release-level)- Remove
SchemaChangeType type = 5;fromReleasePayload.File - Keep
RevisionPayload.typeunchanged (revisions track their own type)
V1 API Protos
ReleasegetsType type = 9;(release-level)- Add
enum Typeat Release level or as top-level enum - Remove
Type type = 5;and nestedenum TypefromRelease.File - Keep
Revision.Typeunchanged (revisions track their own type)
Rationale
A release represents a cohesive deployment unit. All files within a release should use the same migration strategy (either all VERSIONED or all DECLARATIVE). Having per-file types doesn't make semantic sense and allows inconsistent configurations.
Revisions remain unchanged because they represent individual schema changes that have been applied and need to track their own type for history.
Migration Strategy
Database Migration
Create a new migration file that updates existing releases:
- For each release, extract
typefrom the first file in the payload - Move it to the release-level payload
- Remove
typefrom all file payloads within that release
This ensures clean data and simpler application code.
Validation
During release creation, validate that the release has a valid type specified at the release level.
Implementation Steps
1. Proto Changes
- Modify
proto/store/store/release.proto:- Remove
SchemaChangeType type = 5;fromFilemessage - Add
SchemaChangeType type = 4;toReleasePayloadmessage
- Remove
- Modify
proto/v1/v1/release_service.proto:- Remove
Type type = 5;fromRelease.Filemessage - Remove nested
enum TypefromRelease.File - Add
Type type = 9;toReleasemessage - Add
enum Typewith VERSIONED/DECLARATIVE values
- Remove
- Run proto generation:
cd proto && buf generate
2. Database Migration
- Create new migration file in
backend/migrator/<<version>>/ - Write SQL to migrate JSONB payloads
- Update
backend/migrator/migration/LATEST.sqlif needed - Update
TestLatestVersioninbackend/migrator/migrator_test.go
3. Backend Code Updates
Files requiring updates:
backend/store/revision.go- revision creation/storagebackend/api/v1/revision_service.go- API handlersbackend/api/v1/release_service.go- release API handlersbackend/api/v1/release_service_check.go- release validationbackend/runner/taskrun/database_migrate_executor.go- execution logicbackend/runner/taskrun/executor.go- task execution
Key changes:
- Update release creation to require
typeat release level - Update revision creation to copy
typefrom release (not file) - Update any code iterating over files and checking file-level type
- Update validation/checks to use release-level type
4. Testing
- Test migration on sample data
- Test release creation with new schema
- Test revision creation from migrated releases
- Run relevant backend tests
Breaking Change
This is a breaking change that requires:
- Proto file changes (API contract change)
- Database migration
- Backwards incompatible API changes
The PR should be labeled with breaking.