MCPcopy Create free account
hub / github.com/bytebase/bytebase / convertToRevisionType

Function convertToRevisionType

backend/api/v1/revision_service.go:332–344  ·  view source on GitHub ↗
(t storepb.SchemaChangeType)

Source from the content-addressed store, hash-verified

330}
331
332func convertToRevisionType(t storepb.SchemaChangeType) v1pb.Revision_Type {
333 //exhaustive:enforce
334 switch t {
335 case storepb.SchemaChangeType_SCHEMA_CHANGE_TYPE_UNSPECIFIED:
336 return v1pb.Revision_TYPE_UNSPECIFIED
337 case storepb.SchemaChangeType_VERSIONED:
338 return v1pb.Revision_VERSIONED
339 case storepb.SchemaChangeType_DECLARATIVE:
340 return v1pb.Revision_DECLARATIVE
341 default:
342 return v1pb.Revision_TYPE_UNSPECIFIED
343 }
344}
345
346func convertRevision(revision *v1pb.Revision, database *store.DatabaseMessage, sheetSha256 string) *store.RevisionMessage {
347 file := revision.File

Callers 1

convertToRevisionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected