From aff3c7ed514d08ab993bd2826fdd06e6333264e9 Mon Sep 17 00:00:00 2001 From: louiseschmidtgen Date: Fri, 20 Sep 2024 19:14:36 +0200 Subject: [PATCH 1/4] Restoring the migration statement order to its former glory --- src/k8s/pkg/k8sd/database/schema.go | 2 ++ .../k8sd/database/sql/migrations/worker-nodes/000-create.sql | 2 +- .../k8sd/database/sql/migrations/worker-nodes/007-delete.sql | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/007-delete.sql diff --git a/src/k8s/pkg/k8sd/database/schema.go b/src/k8s/pkg/k8sd/database/schema.go index b2cae9125..8dc154ac8 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", "002-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..704f3bf19 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) -); +) \ No newline at end of file diff --git a/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/007-delete.sql b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/007-delete.sql new file mode 100644 index 000000000..2c47ee2fc --- /dev/null +++ b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/007-delete.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS worker_nodes From d9f2c70152f8bef9a4bcaae34a78441f52a9b59b Mon Sep 17 00:00:00 2001 From: louiseschmidtgen Date: Fri, 20 Sep 2024 19:51:33 +0200 Subject: [PATCH 2/4] rename file --- .../migrations/worker-nodes/{007-delete.sql => 002-delete.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/{007-delete.sql => 002-delete.sql} (100%) diff --git a/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/007-delete.sql b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/002-delete.sql similarity index 100% rename from src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/007-delete.sql rename to src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/002-delete.sql From a0922d7f45a1c31680071d41531d0de8ffd62931 Mon Sep 17 00:00:00 2001 From: louiseschmidtgen Date: Mon, 23 Sep 2024 09:38:01 +0200 Subject: [PATCH 3/4] rename schema file --- src/k8s/pkg/k8sd/database/schema.go | 2 +- .../migrations/worker-nodes/{002-delete.sql => 001-delete.sql} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/{002-delete.sql => 001-delete.sql} (100%) diff --git a/src/k8s/pkg/k8sd/database/schema.go b/src/k8s/pkg/k8sd/database/schema.go index 8dc154ac8..44d665629 100644 --- a/src/k8s/pkg/k8sd/database/schema.go +++ b/src/k8s/pkg/k8sd/database/schema.go @@ -22,7 +22,7 @@ var ( schemaApplyMigration("worker-tokens", "000-create.sql"), schemaApplyMigration("feature-status", "000-feature-status.sql"), schemaApplyMigration("worker-tokens", "001-add-expiry.sql"), - schemaApplyMigration("worker-nodes", "002-delete.sql"), + schemaApplyMigration("worker-nodes", "001-delete.sql"), } //go:embed sql/migrations diff --git a/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/002-delete.sql b/src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/001-delete.sql similarity index 100% rename from src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/002-delete.sql rename to src/k8s/pkg/k8sd/database/sql/migrations/worker-nodes/001-delete.sql From de12ded998b430365b9e6f325683087beae86c64 Mon Sep 17 00:00:00 2001 From: louiseschmidtgen Date: Mon, 23 Sep 2024 12:43:44 +0200 Subject: [PATCH 4/4] newline --- .../k8sd/database/sql/migrations/worker-nodes/000-create.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 704f3bf19..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) -) \ No newline at end of file +)