-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
21 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,14 @@ CREATE TABLE IF NOT EXISTS myapp_waitingplayer ( | |
user_id INTEGER UNIQUE REFERENCES auth_user(id) | ||
); | ||
CREATE TABLE IF NOT EXISTS GameStats ( | ||
id SERIAL PRIMARY KEY, | ||
user_id INTEGER REFERENCES auth_user(id) ON DELETE CASCADE, | ||
opponent VARCHAR(100) NOT NULL, | ||
win BOOLEAN NOT NULL, | ||
date_time_played TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP | ||
); | ||
-- Alter tables | ||
ALTER TABLE auth_user ADD COLUMN IF NOT EXISTS two_factor_enabled BOOLEAN DEFAULT FALSE; | ||
ALTER TABLE auth_user ADD COLUMN IF NOT EXISTS score INTEGER DEFAULT 0; | ||
|
@@ -82,21 +90,6 @@ ALTER TABLE auth_user_friends ADD COLUMN IF NOT EXISTS to_user_id INTEGER REFERE | |
ALTER TABLE auth_user_blocked_users ADD COLUMN IF NOT EXISTS from_user_id INTEGER REFERENCES auth_user(id); | ||
ALTER TABLE auth_user_blocked_users ADD COLUMN IF NOT EXISTS to_user_id INTEGER REFERENCES auth_user(id); | ||
INSERT INTO auth_user (username, email, password, first_name, last_name, is_superuser, is_staff, is_active, date_joined, score, nickname, image_link) | ||
VALUES | ||
('user1', '[email protected]', 'password1', 'John', 'Doe', FALSE, FALSE, TRUE, NOW(), 0, 'Johny', 'https://pong42.vercel.app/src/logo.png'), | ||
('user2', '[email protected]', 'password2', 'Jane', 'Smith', FALSE, FALSE, TRUE, NOW(), 0, 'Janey', 'https://pong42.vercel.app/src/logo.png'), | ||
('user3', '[email protected]', 'password3', 'Bob', 'Johnson', FALSE, FALSE, TRUE, NOW(), 0, 'Bobby', 'https://pong42.vercel.app/src/logo.png'), | ||
('user4', '[email protected]', 'password4', 'Alice', 'Johnson', FALSE, FALSE, TRUE, NOW(), 0, 'Alicia', 'https://pong42.vercel.app/src/logo.png'), | ||
('user5', '[email protected]', 'password5', 'Eva', 'Brown', FALSE, FALSE, TRUE, NOW(), 0, 'Evie', 'https://pong42.vercel.app/src/logo.png'), | ||
('user6', '[email protected]', 'password6', 'Michael', 'Lee', FALSE, FALSE, TRUE, NOW(), 0, 'Mike', 'https://pong42.vercel.app/src/logo.png'), | ||
('user7', '[email protected]', 'password7', 'Emily', 'Garcia', FALSE, FALSE, TRUE, NOW(), 0, 'Emi', 'https://pong42.vercel.app/src/logo.png'), | ||
('user8', '[email protected]', 'password8', 'Daniel', 'Martinez', FALSE, FALSE, TRUE, NOW(), 0, 'Danny', 'https://pong42.vercel.app/src/logo.png'), | ||
('user9', '[email protected]', 'password9', 'Sophia', 'Hernandez', FALSE, FALSE, TRUE, NOW(), 0, 'Sophie', 'https://pong42.vercel.app/src/logo.png'), | ||
('user10', '[email protected]', 'password10', 'Alexander', 'Lopez', FALSE, FALSE, TRUE, NOW(), 0, 'Alex', 'https://pong42.vercel.app/src/logo.png'), | ||
('user11', '[email protected]', 'password11', 'Emma', 'Adams', FALSE, FALSE, TRUE, NOW(), 0, 'Emmie', 'https://pong42.vercel.app/src/logo.png'), | ||
('user12', '[email protected]', 'password12', 'Oliver', 'Wright', FALSE, FALSE, TRUE, NOW(), 0, 'Ollie', 'https://pong42.vercel.app/src/logo.png'), | ||
('user15', '[email protected]', 'password15', 'Ava', 'Young', FALSE, FALSE, TRUE, NOW(), 0, 'Avie', 'https://pong42.vercel.app/src/logo.png'); | ||
" | psql -h $POSTGRES_HOST -U $POSTGRES_USER -d $POSTGRES_DB -p $POSTGRES_PORT > /dev/null 2>&1 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters