-- This script only contains the table creation statements and does not fully represent the table in database. It's still missing: indices, triggers. Do not use it as backup.

-- Squences
CREATE SEQUENCE IF NOT EXISTS players_id_seq;

-- Table Definition
CREATE TABLE "public"."players" (
    "id" int4 NOT NULL DEFAULT nextval('players_id_seq'::regclass),
    "username" text NOT NULL,
    "display_name" text NOT NULL,
    "credits" float8
);

-- This script only contains the table creation statements and does not fully represent the table in database. It's still missing: indices, triggers. Do not use it as backup.

-- Squences
CREATE SEQUENCE IF NOT EXISTS stats_id_seq;

-- Table Definition
CREATE TABLE "public"."stats" (
    "id" int4 NOT NULL DEFAULT nextval('stats_id_seq'::regclass),
    "username" text NOT NULL,
    "blackjack_games" int8,
    "roulette_games" int8,
    "poker_games" int8,
    "blackjack_won_games" int8,
    "roulette_won_games" int8,
    "poker_won_games" int8, 
    "money_bet" int8,
    "money_earned" int8
);
-- This script only contains the table creation statements and does not fully represent the table in database. It's still missing: indices, triggers. Do not use it as backup.

-- Squences
CREATE SEQUENCE IF NOT EXISTS users_id_seq;

INSERT INTO "public"."players" ("id", "username", "display_name", "credits") VALUES
(9, 'david', 'Dvd', 1000);
INSERT INTO "public"."players" ("id", "username", "display_name", "credits") VALUES
(6, 'simon', 'Simon', 3553);
INSERT INTO "public"."players" ("id", "username", "display_name", "credits") VALUES
(8, 'gis', 'Gis', 1003);
INSERT INTO "public"."players" ("id", "username", "display_name", "credits") VALUES
(12, 'gigi', 'GG', 435),
(10, 'test', 'Tester', 1000),
(11, 'guest', 'guester', 1000);

INSERT INTO "public"."stats" ("id", "username", "blackjack_games", "roulette_games", "poker_games", "blackjack_won_games", "roulette_won_games", "poker_won_games", "money_bet", "money_earned") VALUES
(6, 'gis', 0, 0, 0, 0, 0, 0, 0, 0);
INSERT INTO "public"."stats" ("id", "username", "blackjack_games", "roulette_games", "poker_games", "blackjack_won_games", "roulette_won_games", "poker_won_games", "money_bet", "money_earned") VALUES
(7, 'david', 0, 0, 0, 0, 0, 0, 0, 0);
INSERT INTO "public"."stats" ("id", "username", "blackjack_games", "roulette_games", "poker_games", "blackjack_won_games", "roulette_won_games", "poker_won_games", "money_bet", "money_earned") VALUES
(10, 'gigi', 7, 0, 0, 3, 0, 0, 4187, 3122);
INSERT INTO "public"."stats" ("id", "username", "blackjack_games", "roulette_games", "poker_games", "blackjack_won_games", "roulette_won_games", "poker_won_games", "money_bet", "money_earned") VALUES
(8, 'test', 0, 0, 0, 0, 0, 0, 0, 0),
(9, 'guest', 0, 0, 0, 0, 0, 0, 0, 0),
(4, 'simon', 10, 0, 0, 5, 0, 0, 5180, 3899);
