Skip to content

Commit 22bf65d

Browse files
authored
Merge pull request #65 from hackclub/staging
Add market to prod
2 parents 8f1654c + a0a95a2 commit 22bf65d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+5864
-119
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
CREATE TYPE "public"."market_order_status" AS ENUM('awaiting_approval', 'approved', 'fulfilled');--> statement-breakpoint
2+
CREATE TABLE "market_item" (
3+
"id" serial PRIMARY KEY NOT NULL,
4+
"createdBy" integer,
5+
"name" text NOT NULL,
6+
"description" text NOT NULL,
7+
"image" text NOT NULL,
8+
"minRequiredShopScore" integer DEFAULT 0 NOT NULL,
9+
"minShopScore" integer NOT NULL,
10+
"maxShopScore" integer NOT NULL,
11+
"maxPrice" integer NOT NULL,
12+
"minPrice" integer NOT NULL,
13+
"isPublic" boolean DEFAULT false NOT NULL,
14+
"deleted" boolean DEFAULT false NOT NULL,
15+
"createdAt" timestamp DEFAULT now() NOT NULL,
16+
"updatedAt" timestamp DEFAULT now() NOT NULL
17+
);
18+
--> statement-breakpoint
19+
CREATE TABLE "market_item_order" (
20+
"id" serial PRIMARY KEY NOT NULL,
21+
"userId" integer,
22+
"addressId" text NOT NULL,
23+
"bricksPaid" integer NOT NULL,
24+
"status" "market_order_status" DEFAULT 'awaiting_approval' NOT NULL,
25+
"userNotes" text NOT NULL,
26+
"notes" text NOT NULL,
27+
"deleted" boolean DEFAULT false NOT NULL,
28+
"createdAt" timestamp DEFAULT now() NOT NULL
29+
);
30+
--> statement-breakpoint
31+
ALTER TABLE "market_item" ADD CONSTRAINT "market_item_createdBy_user_id_fk" FOREIGN KEY ("createdBy") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
32+
ALTER TABLE "market_item_order" ADD CONSTRAINT "market_item_order_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;

drizzle/0017_long_greymalkin.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ALTER TYPE "public"."market_order_status" ADD VALUE 'denied';--> statement-breakpoint
2+
ALTER TYPE "public"."market_order_status" ADD VALUE 'refunded';

drizzle/0018_sour_roughhouse.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "market_item_order" ALTER COLUMN "notes" DROP NOT NULL;

drizzle/0019_wide_gamora.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "market_item_order" ALTER COLUMN "userId" SET NOT NULL;

0 commit comments

Comments
 (0)