This commit is contained in:
ari melody 2025-09-30 22:34:46 +01:00
parent 419781988a
commit 028ed60293
Signed by: ari
GPG key ID: CF99829C92678188
3 changed files with 2 additions and 7 deletions

View file

@ -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

View file

@ -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
}
}

View file

@ -1 +0,0 @@
INSERT INTO arimelody.auditlog (level, type, content) VALUES (0, "test", "this is a db schema migration test!");