home to your local SPACEGIRL 💫 arimelody.space
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

oops

+2 -7
+1 -1
controller/controller.go
··· 5 5 func GenerateAlnumString(length int) []byte { 6 6 const CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" 7 7 res := []byte{} 8 - for i := 0; i < length; i++ { 8 + for range length { 9 9 res = append(res, CHARS[rand.Intn(len(CHARS))]) 10 10 } 11 11 return res
+1 -5
controller/migrator.go
··· 9 9 "github.com/jmoiron/sqlx" 10 10 ) 11 11 12 - const DB_VERSION int = 5 12 + const DB_VERSION int = 4 13 13 14 14 func CheckDBVersionAndMigrate(db *sqlx.DB) { 15 15 db.MustExec("CREATE SCHEMA IF NOT EXISTS arimelody") ··· 49 49 case 3: 50 50 ApplyMigration(db, "003-fail-lock") 51 51 oldDBVersion = 4 52 - 53 - case 4: 54 - ApplyMigration(db, "004-test") 55 - oldDBVersion = 5 56 52 57 53 } 58 54 }
-1
controller/schema-migration/004-test.sql
··· 1 - INSERT INTO arimelody.auditlog (level, type, content) VALUES (0, "test", "this is a db schema migration test!");