From c74b9f580f92b2fc6b77bf4ad692eb348b62a17f Mon Sep 17 00:00:00 2001 From: "Louise K. Schmidtgen" Date: Thu, 26 Sep 2024 08:14:17 +0200 Subject: [PATCH] Restoring the Microcluster Schema Migration History (#689) --- src/k8s/pkg/k8sd/database/schema.go | 2 ++ .../k8sd/database/sql/migrations/worker-nodes/000-create.sql | 2 +- .../k8sd/database/sql/migrations/worker-nodes/001-delete.sql | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/001-delete.sql diff --git a/src/k8s/pkg/k8sd/database/schema.go b/src/k8s/pkg/k8sd/database/schema.go index b2cae9125..44d665629 100644 --- a/src/k8s/pkg/k8sd/database/schema.go +++ b/src/k8s/pkg/k8sd/database/schema.go @@ -18,9 +18,11 @@ var ( SchemaExtensions = []schema.Update{ schemaApplyMigration("kubernetes-auth-tokens", "000-create.sql"), schemaApplyMigration("cluster-configs", "000-create.sql"), + schemaApplyMigration("worker-nodes", "000-create.sql"), schemaApplyMigration("worker-tokens", "000-create.sql"), schemaApplyMigration("feature-status", "000-feature-status.sql"), schemaApplyMigration("worker-tokens", "001-add-expiry.sql"), + schemaApplyMigration("worker-nodes", "001-delete.sql"), } //go:embed sql/migrations diff --git a/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/000-create.sql b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/000-create.sql index be3330716..893edba7b 100644 --- a/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/000-create.sql +++ b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/000-create.sql @@ -2,4 +2,4 @@ CREATE TABLE worker_nodes ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, name TEXT NOT NULL, UNIQUE(name) -); +) diff --git a/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/001-delete.sql b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/001-delete.sql new file mode 100644 index 000000000..2c47ee2fc --- /dev/null +++ b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/001-delete.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS worker_nodes