Skip to content

Commit 0db17c2

Browse files
authored
Merge pull request #247 from ScottyLabs/staging
Staging -> Main
2 parents c061689 + 35a9f85 commit 0db17c2

13 files changed

Lines changed: 1318 additions & 13 deletions

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ Now install the API's dependencies by 'cd'-ing into the root of the repository a
2727
pnpm install
2828
```
2929

30-
Start your local database with `pnpm db:start`, `pnpm db:push` (if this is your first time) and then start the server with `pnpm dev` and it should work, assuming you have the correct env variables. (To see the contents of the database, I recommend using DBeaver. You can also run `pnpm db:studio` to start up drizzle studio)
30+
Then start your local database with (assuming you have the correct env variables)
31+
32+
```bash
33+
pnpm db:start
34+
pnpm db:push # if this is your first time running the db
35+
pnpm dev
36+
```
37+
38+
To see the contents of the database, I recommend using DBeaver. You can also run `pnpm db:studio` to start up drizzle studio
3139

3240
## Database schema changes (important!)
3341

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
CREATE TABLE "reports" (
2+
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "reports_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
3+
"user_id" integer,
4+
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
5+
"location_id" text NOT NULL,
6+
"message" text NOT NULL
7+
);
8+
--> statement-breakpoint
9+
ALTER TABLE "reports" ADD CONSTRAINT "reports_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
10+
ALTER TABLE "reports" ADD CONSTRAINT "reports_location_id_location_data_id_fk" FOREIGN KEY ("location_id") REFERENCES "public"."location_data"("id") ON DELETE cascade ON UPDATE no action;

0 commit comments

Comments
 (0)