From 8589ce2817498007a9b809d45173a283795502f8 Mon Sep 17 00:00:00 2001 From: linlyboi Date: Mon, 13 Nov 2023 14:11:33 +0200 Subject: [PATCH] (I hate untangling the mess others create) --- .gitignore | 1 + MyApp_1/.gitignore | 15 --------- MyApp_1/.idea/.gitignore | 3 -- MyApp_1/.idea/compiler.xml | 6 ---- MyApp_1/.idea/gradle.xml | 19 ----------- MyApp_1/.idea/misc.xml | 10 ------ MyApp_1/.idea/vcs.xml | 6 ---- db_related/serber_sql.sql | 65 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 66 insertions(+), 59 deletions(-) delete mode 100644 MyApp_1/.gitignore delete mode 100644 MyApp_1/.idea/.gitignore delete mode 100644 MyApp_1/.idea/compiler.xml delete mode 100644 MyApp_1/.idea/gradle.xml delete mode 100644 MyApp_1/.idea/misc.xml delete mode 100644 MyApp_1/.idea/vcs.xml create mode 100644 db_related/serber_sql.sql diff --git a/.gitignore b/.gitignore index 5cf72de..b86b2c7 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ google-services.json # Android Profiling *.hprof +/Figma_UI/ diff --git a/MyApp_1/.gitignore b/MyApp_1/.gitignore deleted file mode 100644 index aa724b7..0000000 --- a/MyApp_1/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store -/build -/captures -.externalNativeBuild -.cxx -local.properties diff --git a/MyApp_1/.idea/.gitignore b/MyApp_1/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/MyApp_1/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/MyApp_1/.idea/compiler.xml b/MyApp_1/.idea/compiler.xml deleted file mode 100644 index b589d56..0000000 --- a/MyApp_1/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/MyApp_1/.idea/gradle.xml b/MyApp_1/.idea/gradle.xml deleted file mode 100644 index 6d89050..0000000 --- a/MyApp_1/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/MyApp_1/.idea/misc.xml b/MyApp_1/.idea/misc.xml deleted file mode 100644 index 0ad17cb..0000000 --- a/MyApp_1/.idea/misc.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/MyApp_1/.idea/vcs.xml b/MyApp_1/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/MyApp_1/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/db_related/serber_sql.sql b/db_related/serber_sql.sql new file mode 100644 index 0000000..47fd09c --- /dev/null +++ b/db_related/serber_sql.sql @@ -0,0 +1,65 @@ +-- Table for Users +-- U_ID => User ID, Primary Key +-- first_name => User's First Name +-- last_name => User's Last Name +-- U_email => User's Registered Email +-- U_password => User's Password +CREATE TABLE users(U_ID SERIAL PRIMARY KEY, + first_name varchar(255) NOT NULL, + last_name varchar(255) NOT NULL, + U_email varchar(255) NOT NULL UNIQUE, + U_password varchar(255) NOT NULL + ); + +-- Table for Stations +-- S_ID => Station ID in fashion of: 3xx denotes taking both lines 1 and 2, +-- 2xx denotes taking Line 2 Only, +-- 1xx denotes taking Line 1 Only. +-- name_ar => Station's name in Arabic +-- name_en => Station's name in English +-- tram_lines (DEPRICATE FROM ERD) => Would've denoted which lines are allowed +-- geo_loc => Geographical Location (Latitude, Longitude) + +-- Comment regarding the "GEOGRAPHY" data type +-- https://stackoverflow.com/questions/30322924/how-to-store-longitude-latitude-as-a-geography-in-sql-server-2014 +-- Double check for later purposes +CREATE TABLE stations(S_ID SERIAL PRIMARY KEY, + name_ar varchar(255) NOT NULL, + name_en varchar(255) NOT NULL, + -- Debating whether or not to denote + -- Tram lines as 1, 2, or 3 + -- instead of multiple values + location GEOGRAPHY + ); + +-- Forgot Relation between User and Station +-- "Preferred Stations", need to rework ERD +-- Anyhow, Insert a new table as relation +-- M:N (i.e. Separate Table) +-- Where U_ID + S_ID (User ID, Station ID) +-- are compound keys + +CREATE TABLE prefers(pref_UID SERIAL, + pref_SID SERIAL, + CONSTRAINT fk1 FOREIGN KEY (pref_UID) REFERENCES users(U_ID), + CONSTRAINT fk2 FOREIGN KEY (pref_SID) REFERENCES stations(S_ID), + CONSTRAINT pk1 PRIMARY KEY (pref_UID, pref_SID) + ); + +-- Ought to create table for "Arrival" +-- Except I dond see how it'd be implemented properly +-- but do take a look at whatever the mcfuck i write below + +-- Documenting the Table +-- time_of_day => Time object, nanosecond accuracy, y'all handle it idk +-- week_day => varchar as {Mon, Tue, Wed}, Could probs just encode with 0 -> 6 +-- tram_line => int ranging 1 -> 4 +-- fill_status => Boolean, 1 full, 0 not as full +CREATE TABLE arrival(time_of_day TIME, + week_day INTEGER, + tram_line INTEGER, + fill_status BOOLEAN + CONSTRAINT ck PRIMARY KEY (week_day,tram_line) + CONSTRAINT in_week CHECK (week_day >= 0 AND week_day <= 6) + CONSTRAINT valid_line CHECK (tram_line >= 1 AND tram_line <= 4) + ); \ No newline at end of file