games inits itself
This commit is contained in:
@@ -32,27 +32,6 @@ func NewDB(ctx context.Context, scheme, conn string) (DB, error) {
|
||||
}
|
||||
defer sql.Close()
|
||||
|
||||
if _, err := sql.ExecContext(ctx, `
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
uuid TEXT,
|
||||
name TEXT
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS games (
|
||||
uuid TEXT
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS players (
|
||||
user_uuid TEXT,
|
||||
game_uuid TEXT
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS events (
|
||||
game_uuid TEXT,
|
||||
timestamp DATETIME,
|
||||
payload TEXT
|
||||
);
|
||||
`); err != nil {
|
||||
return DB{}, err
|
||||
}
|
||||
|
||||
return db, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user