From 01d6efc094a7e132c2758ed1a2281e6e575e1930 Mon Sep 17 00:00:00 2001 From: Jakub Kowalik Date: Sat, 13 Apr 2019 13:55:56 +0200 Subject: [PATCH] Added Players table sql --- SQL/create_players_table.sql | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SQL/create_players_table.sql diff --git a/SQL/create_players_table.sql b/SQL/create_players_table.sql new file mode 100644 index 0000000..1003705 --- /dev/null +++ b/SQL/create_players_table.sql @@ -0,0 +1,26 @@ +CREATE TYPE account AS ENUM( + 'Free', + 'Developer', + 'Premium' +); + +CREATE TABLE "Players" ( + "PlayerID" int NOT NULL, + "UserName" VARCHAR(50) NOT NULL, + "Email" VARCHAR(100) NOT NULL, + "PasswordHash" VARCHAR(1024) NOT NULL, + "FirstName" VARCHAR(100) NOT NULL, + "LastName" VARCHAR(100) NOT NULL, + "CreatedOn" TIMESTAMP NOT NULL, + "PlayerAccountType" account NOT NULL, + CONSTRAINT "pk_Players" PRIMARY KEY ( + "PlayerID" + ), + CONSTRAINT "uc_Players_UserName" UNIQUE ( + "UserName" + ), + CONSTRAINT "uc_Players_Email" UNIQUE ( + "Email" + ) +); +