-
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.
- Loading branch information
Showing
3 changed files
with
85 additions
and
1 deletion.
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,17 @@ | ||
-- CreateTable | ||
CREATE TABLE "purchases" ( | ||
"id" UUID NOT NULL DEFAULT gen_random_uuid(), | ||
"points" INTEGER DEFAULT 0, | ||
"receipt" TEXT NOT NULL, | ||
"product_id" TEXT NOT NULL, | ||
"device" TEXT, | ||
"refunded" BOOLEAN DEFAULT false, | ||
"created_at" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, | ||
"updated_at" TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP, | ||
"user_id" UUID NOT NULL, | ||
|
||
CONSTRAINT "purchases_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "purchases" ADD CONSTRAINT "purchases_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
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
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