From 22441f59ebe0d51079f12b359e6920242c1c6b75 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 14 May 2020 22:04:27 -0400 Subject: [PATCH] Fix psql foreign key typing --- sql_service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql_service.go b/sql_service.go index 8cf4836..6fecd4e 100644 --- a/sql_service.go +++ b/sql_service.go @@ -84,8 +84,8 @@ func sqlInit() error { "INSERT INTO Keys(id, token, player, time, metadata) VALUES ($1, $2, $3, $4, $5) ON CONFLICT(id) DO UPDATE SET token=$2, player=$3, time=$4, metadata=$5;", "CREATE TABLE IF NOT EXISTS Players (id BIGSERIAL PRIMARY KEY, name TEXT NOT NULL);", "CREATE TABLE IF NOT EXISTS Boards (id BIGSERIAL PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL);", - "CREATE TABLE IF NOT EXISTS Entries (id BIGSERIAL PRIMARY KEY, rank INTEGER NOT NULL DEFAULT -1, score INTEGER NOT NULL, player INTEGER NOT NULL, board INTEGER NOT NULL, time INTEGER NOT NULL, metadata BYTEA NOT NULL DEFAULT E'\\\\xFF', FOREIGN KEY(player) REFERENCES Players(id), FOREIGN KEY(board) REFERENCES Boards(id));", - "CREATE TABLE IF NOT EXISTS Keys (id BIGSERIAL PRIMARY KEY, token TEXT NOT NULL, player INTEGER NOT NULL, time INTEGER NOT NULL, metadata BYTEA NOT NULL DEFAULT E'\\\\xFF', FOREIGN KEY(player) REFERENCES Players(id));", + "CREATE TABLE IF NOT EXISTS Entries (id BIGSERIAL PRIMARY KEY, rank INTEGER NOT NULL DEFAULT -1, score BIGINT NOT NULL, player BIGSERIAL NOT NULL, board BIGSERIAL NOT NULL, time INTEGER NOT NULL, metadata BYTEA NOT NULL DEFAULT E'\\\\xFF', FOREIGN KEY(player) REFERENCES Players(id), FOREIGN KEY(board) REFERENCES Boards(id));", + "CREATE TABLE IF NOT EXISTS Keys (id BIGSERIAL PRIMARY KEY, token TEXT NOT NULL, player BIGSERIAL NOT NULL, time BIGSERIAL NOT NULL, metadata BYTEA NOT NULL DEFAULT E'\\\\xFF', FOREIGN KEY(player) REFERENCES Players(id));", }, } fmt.Printf("SQL Server %s is query type %d\n", sqlServer, queryType)