From 028ed6029354a394e68b602aac8635dd3f24702c Mon Sep 17 00:00:00 2001 From: ari melody Date: Tue, 30 Sep 2025 22:34:46 +0100 Subject: [PATCH] oops --- controller/controller.go | 2 +- controller/migrator.go | 6 +----- controller/schema-migration/004-test.sql | 1 - 3 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 controller/schema-migration/004-test.sql diff --git a/controller/controller.go b/controller/controller.go index 44194e4..95615fb 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -5,7 +5,7 @@ import "math/rand" func GenerateAlnumString(length int) []byte { const CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" res := []byte{} - for i := 0; i < length; i++ { + for range length { res = append(res, CHARS[rand.Intn(len(CHARS))]) } return res diff --git a/controller/migrator.go b/controller/migrator.go index 1a70e62..3be8c21 100644 --- a/controller/migrator.go +++ b/controller/migrator.go @@ -9,7 +9,7 @@ import ( "github.com/jmoiron/sqlx" ) -const DB_VERSION int = 5 +const DB_VERSION int = 4 func CheckDBVersionAndMigrate(db *sqlx.DB) { db.MustExec("CREATE SCHEMA IF NOT EXISTS arimelody") @@ -50,10 +50,6 @@ func CheckDBVersionAndMigrate(db *sqlx.DB) { ApplyMigration(db, "003-fail-lock") oldDBVersion = 4 - case 4: - ApplyMigration(db, "004-test") - oldDBVersion = 5 - } } diff --git a/controller/schema-migration/004-test.sql b/controller/schema-migration/004-test.sql deleted file mode 100644 index 3733de2..0000000 --- a/controller/schema-migration/004-test.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT INTO arimelody.auditlog (level, type, content) VALUES (0, "test", "this is a db schema migration test!");