From a38d602c5396726efe7a3f103a8f1cb4a4c606e3 Mon Sep 17 00:00:00 2001 From: ansengarvin <45224464+ansengarvin@users.noreply.github.com> Date: Wed, 17 Jan 2024 17:44:29 -0800 Subject: [PATCH] Added basic user table with test user. (#134) --- backend/init.sql | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/backend/init.sql b/backend/init.sql index 7c57ba46..ae26fadf 100644 --- a/backend/init.sql +++ b/backend/init.sql @@ -46,6 +46,17 @@ CREATE TABLE species ( PRIMARY KEY (species_id, protein_id) ); +/* +* Users Table +*/ +CREATE TABLE users ( + id serial PRIMARY KEY, + username text NOT NULL UNIQUE, + email text NOT NULL UNIQUE, + pword text NOT NULL, + admin boolean NOT NULL +); + /* * Inserts example species into species table */ @@ -54,4 +65,7 @@ INSERT INTO species(name) VALUES ('leptopilina boulardi'); INSERT INTO species(name) VALUES ('leptopilina heterotoma'); INSERT INTO species(name) VALUES ('unknown'); - +/* + * Inserts test user into user table + */ +INSERT INTO users(username, email, pword, admin) VALUES ('test', 'garvina@oregonstate.edu', 'password', '1'); \ No newline at end of file