Add the rest
This commit is contained in:
17
src/sql/current-table.sql
Normal file
17
src/sql/current-table.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Table: public.callouts
|
||||
|
||||
-- DROP TABLE IF EXISTS public.callouts;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.callouts
|
||||
(
|
||||
user_id bigint NOT NULL,
|
||||
date date NOT NULL,
|
||||
reason text COLLATE pg_catalog."default",
|
||||
nickname text COLLATE pg_catalog."default",
|
||||
CONSTRAINT callouts_pkey PRIMARY KEY (user_id, date)
|
||||
)
|
||||
|
||||
TABLESPACE pg_default;
|
||||
|
||||
ALTER TABLE IF EXISTS public.callouts
|
||||
OWNER to opossumbot;
|
||||
7
src/sql/initial-table.sql
Normal file
7
src/sql/initial-table.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
create table absent_players (
|
||||
user_id int NOT NULL,
|
||||
user_name varchar(20) NOT NULL,
|
||||
date_ab date NOT NULL,
|
||||
reason_ab varchar(200),
|
||||
has_passed int DEFAULT 0);
|
||||
/
|
||||
13
src/sql/sqlscripts.sql
Normal file
13
src/sql/sqlscripts.sql
Normal file
@@ -0,0 +1,13 @@
|
||||
-- These are scripts that are formatted for accesing the table, more comments can be provided as needed
|
||||
|
||||
select count(user_id) from absent_players where user_id = 000000 and has_passed = 1;
|
||||
-- Select the number of times a user has been absent so far(replace user_ID)
|
||||
|
||||
select user_name, reason_ab from absent_players where date_ab = SYSDATE;
|
||||
-- select users name, reason they're absent today (reoplace date with today's date)
|
||||
|
||||
select user_name, date_ab, reason_ab from absent_players where has_passed = 0;
|
||||
-- selects all future players who are absent, the reason they are, and when they are.
|
||||
|
||||
delete from absent_players where user_ID = 00000 and date_ab = date and has_passed = 0;
|
||||
-- deletes a future absence from the table, cannot remove older absences.
|
||||
Reference in New Issue
Block a user