docs/plans/2026-01-04-schema-change-type-release-level-design.md
Date: 2026-01-04 Status: Approved
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.
proto/store/store/)SchemaChangeType enum defined in common.protoReleasePayload.File has SchemaChangeType type = 5; (per-file)RevisionPayload has SchemaChangeType type = 6; (per-revision)proto/v1/v1/)Release.File has nested enum Type and Type type = 5; (per-file)Revision has nested enum Type and Type type = 14; (per-revision)ReleasePayload gets SchemaChangeType type = 4; (release-level)SchemaChangeType type = 5; from ReleasePayload.FileRevisionPayload.type unchanged (revisions track their own type)Release gets Type type = 9; (release-level)enum Type at Release level or as top-level enumType type = 5; and nested enum Type from Release.FileRevision.Type unchanged (revisions track their own type)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.
Create a new migration file that updates existing releases:
type from the first file in the payloadtype from all file payloads within that releaseThis ensures clean data and simpler application code.
During release creation, validate that the release has a valid type specified at the release level.
proto/store/store/release.proto:
SchemaChangeType type = 5; from File messageSchemaChangeType type = 4; to ReleasePayload messageproto/v1/v1/release_service.proto:
Type type = 5; from Release.File messageenum Type from Release.FileType type = 9; to Release messageenum Type with VERSIONED/DECLARATIVE valuescd proto && buf generatebackend/migrator/<<version>>/backend/migrator/migration/LATEST.sql if neededTestLatestVersion in backend/migrator/migrator_test.goFiles 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 executionKey changes:
type at release leveltype from release (not file)This is a breaking change that requires:
The PR should be labeled with breaking.