Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: spec id in get task create from config (#7123)

p0nyc73e8d176b9e
diff --git a/backend/api/v1/rollout_service.go b/backend/api/v1/rollout_service.go
index ababbbc3c4..dca2710968 100644
--- a/backend/api/v1/rollout_service.go
+++ b/backend/api/v1/rollout_service.go
@@ -1414,6 +1414,7 @@ func getTaskCreatesFromChangeDatabaseConfig(ctx context.Context, s *store.Store,
return nil, nil, errors.Wrapf(err, "failed to convert sheet id %q to int", sheetIDStr)
}
payload := api.TaskDatabaseSchemaUpdateSDLPayload{
+ SpecID: spec.Id,
SheetID: sheetID,
SchemaVersion: c.SchemaVersion,
VCSPushEvent: nil,
@@ -1500,6 +1501,7 @@ func getTaskCreatesFromChangeDatabaseConfig(ctx context.Context, s *store.Store,
return nil, nil, errors.Wrapf(err, "failed to convert sheet id %q to int", sheetIDStr)
}
payload := api.TaskDatabaseDataUpdatePayload{
+ SpecID: spec.Id,
SheetID: sheetID,
SchemaVersion: c.SchemaVersion,
VCSPushEvent: nil,
@@ -1575,6 +1577,7 @@ func getTaskCreatesFromRestoreDatabaseConfig(ctx context.Context, s *store.Store
if c.CreateDatabaseConfig != nil {
restorePayload := api.TaskDatabasePITRRestorePayload{
+ SpecID: spec.Id,
ProjectID: project.UID,
}
// restore to a new database
@@ -1651,6 +1654,7 @@ func getTaskCreatesFromRestoreDatabaseConfig(ctx context.Context, s *store.Store
// task 1: restore
restorePayload := api.TaskDatabasePITRRestorePayload{
+ SpecID: spec.Id,
ProjectID: project.UID,
}
switch source := c.Source.(type) {
@@ -1701,7 +1705,9 @@ func getTaskCreatesFromRestoreDatabaseConfig(ctx context.Context, s *store.Store
taskCreates = append(taskCreates, restoreTaskCreate)
// task 2: cutover
- cutoverPayload := api.TaskDatabasePITRCutoverPayload{}
+ cutoverPayload := api.TaskDatabasePITRCutoverPayload{
+ SpecID: spec.Id,
+ }
cutoverPayloadBytes, err := json.Marshal(cutoverPayload)
if err != nil {
return nil, nil, errors.Wrap(err, "failed to create PITR cutover task, unable to marshal payload")