Skip to content

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

refactor: add EarliestAllowedTs to UpdateSchemaDetail (#294)

spinningbotf16a8187ef03
diff --git a/api/issue.go b/api/issue.go
index d55c540fd9..8754e7903c 100644
--- a/api/issue.go
+++ b/api/issue.go
@@ -144,8 +144,10 @@ type UpdateSchemaDetail struct {
DatabaseName string `json:"databaseName"`
// Statement is the statement to update database schema.
Statement string `json:"statement"`
- // Statement is the rollback statement of the statement.
+ // RollbackStatement is the rollback statement of the statement.
RollbackStatement string `json:"rollbackStatement"`
+ // EarliestAllowedTs the earliest execution time of the change at system local Unix timestamp in nanoseconds.
+ EarliestAllowedTs int64 `jsonapi:"attr,earliestAllowedTs"`
}
// UpdateSchemaContext is the issue create context for updating database schema.
diff --git a/server/issue.go b/server/issue.go
index 5d9858f3be..432db4d511 100644
--- a/server/issue.go
+++ b/server/issue.go
@@ -855,6 +855,7 @@ func getSchemaUpdateTask(database *api.Database, migrationType db.MigrationType,
Type: api.TaskDatabaseSchemaUpdate,
Statement: d.Statement,
RollbackStatement: d.RollbackStatement,
+ EarliestAllowedTs: d.EarliestAllowedTs,
MigrationType: migrationType,
Payload: string(bytes),
}, nil