diff --git a/DatabaseSchema.png b/DatabaseSchema.png new file mode 100644 index 0000000..a6e0306 Binary files /dev/null and b/DatabaseSchema.png differ diff --git a/DatabaseSetup.sql b/DatabaseSetup.sql new file mode 100644 index 0000000..bfbe701 --- /dev/null +++ b/DatabaseSetup.sql @@ -0,0 +1,24 @@ +DROP TABLE students, events; + +CREATE TABLE IF NOT EXISTS students +( + id int GENERATED ALWAYS AS IDENTITY, + snowflake text NOT NULL, + ade_resource int NOT NULL, + PRIMARY KEY (id), + UNIQUE (snowflake) +); + +CREATE TABLE IF NOT EXISTS events +( + id int GENERATED ALWAYS AS IDENTITY, + students_id int NOT NULL, + summary text NOT NULL, + start_event timestamptz NOT NULL, + end_event timestamptz NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (students_id) + REFERENCES students (id) + ON DELETE CASCADE +); + diff --git a/settings.gradle b/settings.gradle index 2f670cf..6083d58 100644 --- a/settings.gradle +++ b/settings.gradle @@ -7,5 +7,5 @@ * in the user manual at https://docs.gradle.org/6.7/userguide/multi_project_builds.html */ -rootProject.name = 'reminderbot' +rootProject.name = 'presenceirb' include('app')