generated from Kan-A-Pesh/express-boilerplate
-
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.
Merge pull request #1 from La-404-Devinci/feat/database
added db schema
- Loading branch information
Showing
20 changed files
with
544 additions
and
167 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Check lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Check lint | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Check lint | ||
run: npm run lint |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
CREATE TABLE IF NOT EXISTS "acquired" ( | ||
"user_uuid" uuid, | ||
"challenge_id" serial NOT NULL, | ||
"created_by" serial NOT NULL, | ||
"updated_at" timestamp DEFAULT now() NOT NULL, | ||
"created_at" timestamp DEFAULT now() NOT NULL, | ||
CONSTRAINT "acquired_user_uuid_challenge_id_pk" PRIMARY KEY("user_uuid","challenge_id") | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "challenges" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"club_id" serial NOT NULL, | ||
"score" integer NOT NULL, | ||
"name" text NOT NULL, | ||
"updated_at" timestamp DEFAULT now() NOT NULL, | ||
"created_at" timestamp DEFAULT now() NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "clubs" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"avatar_url" text NOT NULL, | ||
"name" text NOT NULL, | ||
"description" text NOT NULL, | ||
"daily_date" date NOT NULL, | ||
"updated_at" timestamp DEFAULT now() NOT NULL, | ||
"created_at" timestamp DEFAULT now() NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "granters" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"club_id" serial NOT NULL, | ||
"email" text NOT NULL, | ||
"password" text NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE TABLE IF NOT EXISTS "users" ( | ||
"uuid" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
"club_id" serial NOT NULL, | ||
"email" text NOT NULL, | ||
"hashpass" text NOT NULL, | ||
"username" text NOT NULL, | ||
"quote" text, | ||
"updated_at" timestamp DEFAULT now() NOT NULL, | ||
"created_at" timestamp DEFAULT now() NOT NULL | ||
); | ||
--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "user_uuid_idx" ON "acquired" USING btree ("user_uuid");--> statement-breakpoint | ||
CREATE INDEX IF NOT EXISTS "challenge_id_idx" ON "acquired" USING btree ("challenge_id");--> statement-breakpoint | ||
CREATE UNIQUE INDEX IF NOT EXISTS "name_unique_idx" ON "clubs" USING btree ("name");--> statement-breakpoint | ||
CREATE UNIQUE INDEX IF NOT EXISTS "email_unique_idx" ON "users" USING btree ("email");--> statement-breakpoint | ||
CREATE UNIQUE INDEX IF NOT EXISTS "username_unique_idx" ON "users" USING btree ("username"); |
Oops, something went wrong.