oops
This commit is contained in:
parent
419781988a
commit
028ed60293
3 changed files with 2 additions and 7 deletions
|
@ -5,7 +5,7 @@ import "math/rand"
|
||||||
func GenerateAlnumString(length int) []byte {
|
func GenerateAlnumString(length int) []byte {
|
||||||
const CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
const CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||||
res := []byte{}
|
res := []byte{}
|
||||||
for i := 0; i < length; i++ {
|
for range length {
|
||||||
res = append(res, CHARS[rand.Intn(len(CHARS))])
|
res = append(res, CHARS[rand.Intn(len(CHARS))])
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
)
|
)
|
||||||
|
|
||||||
const DB_VERSION int = 5
|
const DB_VERSION int = 4
|
||||||
|
|
||||||
func CheckDBVersionAndMigrate(db *sqlx.DB) {
|
func CheckDBVersionAndMigrate(db *sqlx.DB) {
|
||||||
db.MustExec("CREATE SCHEMA IF NOT EXISTS arimelody")
|
db.MustExec("CREATE SCHEMA IF NOT EXISTS arimelody")
|
||||||
|
@ -50,10 +50,6 @@ func CheckDBVersionAndMigrate(db *sqlx.DB) {
|
||||||
ApplyMigration(db, "003-fail-lock")
|
ApplyMigration(db, "003-fail-lock")
|
||||||
oldDBVersion = 4
|
oldDBVersion = 4
|
||||||
|
|
||||||
case 4:
|
|
||||||
ApplyMigration(db, "004-test")
|
|
||||||
oldDBVersion = 5
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
INSERT INTO arimelody.auditlog (level, type, content) VALUES (0, "test", "this is a db schema migration test!");
|
|
Loading…
Add table
Add a link
Reference in a new issue