From ec65e0eb4a4681c693184b0564726da26bb616dc Mon Sep 17 00:00:00 2001 From: Up Date: Tue, 7 May 2024 22:57:30 +0200 Subject: [PATCH] better table creation --- db/db.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/db/db.go b/db/db.go index 35a5b0b..74b8a95 100644 --- a/db/db.go +++ b/db/db.go @@ -43,8 +43,7 @@ func Init(username, password, protocol, address, database string) error { panic(err) } tx.Exec("CREATE TABLE IF NOT EXISTS systemSaveData (uuid BINARY(16) PRIMARY KEY, data BLOB, timestamp TIMESTAMP)") - tx.Exec("CREATE TABLE IF NOT EXISTS sessionSaveData (uuid BINARY(16), slot TINYINT, data BLOB, timestamp TIMESTAMP)") - tx.Exec("CREATE CREATE UNIQUE INDEX IF NOT EXISTS sessionSaveDataByIdAndSlot ON sessionSaveData (uuid, slot)") + tx.Exec("CREATE TABLE IF NOT EXISTS sessionSaveData (uuid BINARY(16), slot TINYINT, data BLOB, timestamp TIMESTAMP PRIMARY KEY (uuid, slot))") err = tx.Commit() if err != nil { panic(err)