Skip to content

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

chore: instance change history schema (#15143)

Danny Xu8ade4a890d47
diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sql
index 0322432284..e568d719e9 100644
--- a/backend/migrator/migration/LATEST.sql
+++ b/backend/migrator/migration/LATEST.sql
@@ -448,8 +448,6 @@ CREATE INDEX idx_issue_subscriber_subscriber_id ON issue_subscriber(subscriber_i
-- instance change history records the changes an instance and its databases.
CREATE TABLE instance_change_history (
id BIGSERIAL PRIMARY KEY,
- created_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
- updated_ts BIGINT NOT NULL DEFAULT extract(epoch from now()),
status TEXT NOT NULL CONSTRAINT instance_change_history_status_check CHECK (status IN ('PENDING', 'DONE', 'FAILED')),
version TEXT NOT NULL,
execution_duration_ns BIGINT NOT NULL
diff --git a/backend/migrator/migrator.go b/backend/migrator/migrator.go
index b9201d102b..90629f5dde 100644
--- a/backend/migrator/migrator.go
+++ b/backend/migrator/migrator.go
@@ -63,6 +63,8 @@ func MigrateSchema(ctx context.Context, storeDB *store.DB, storeInstance *store.
DROP COLUMN IF EXISTS row_status,
DROP COLUMN IF EXISTS creator_id,
DROP COLUMN IF EXISTS updater_id,
+ DROP COLUMN IF EXISTS created_ts,
+ DROP COLUMN IF EXISTS updated_ts,
DROP COLUMN IF EXISTS instance_id,
DROP COLUMN IF EXISTS database_id,
DROP COLUMN IF EXISTS project_id,
diff --git a/backend/store/instance_change_history.go b/backend/store/instance_change_history.go
index b908cb9728..b16efdc00f 100644
--- a/backend/store/instance_change_history.go
+++ b/backend/store/instance_change_history.go
@@ -13,8 +13,6 @@ import (
// InstanceChangeHistoryMessage records the change history of an instance.
// it deprecates the old MigrationHistory.
type InstanceChangeHistoryMessage struct {
- CreatedTs int64
- UpdatedTs int64
Status db.MigrationStatus
Version model.Version
ExecutionDurationNs int64
@@ -149,8 +147,6 @@ func (s *Store) ListInstanceChangeHistoryForMigrator(ctx context.Context, find *
query := `
SELECT
id,
- created_ts,
- updated_ts,
status,
version,
execution_duration_ns
@@ -175,8 +171,6 @@ func (s *Store) ListInstanceChangeHistoryForMigrator(ctx context.Context, find *
var storedVersion string
if err := rows.Scan(
&changeHistory.UID,
- &changeHistory.CreatedTs,
- &changeHistory.UpdatedTs,
&changeHistory.Status,
&storedVersion,
&changeHistory.ExecutionDurationNs,