-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema.prisma: Map DonationMetadata model
- Loading branch information
1 parent
d79c1dd
commit 00b31d1
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
migrations/20231027074921_map_donation_metadata/migration.sql
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,27 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the `DonationMetadata` table. If the table is not empty, all the data it contains will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "DonationMetadata" DROP CONSTRAINT "DonationMetadata_donation_id_fkey"; | ||
|
||
-- DropTable | ||
DROP TABLE "DonationMetadata"; | ||
|
||
-- CreateTable | ||
CREATE TABLE "donation_metadata" ( | ||
"donation_id" UUID NOT NULL, | ||
"name" VARCHAR, | ||
"created_at" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"extra_data" JSONB, | ||
|
||
CONSTRAINT "donation_metadata_pkey" PRIMARY KEY ("donation_id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "donation_metadata_donation_id_key" ON "donation_metadata"("donation_id"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "donation_metadata" ADD CONSTRAINT "donation_metadata_donation_id_fkey" FOREIGN KEY ("donation_id") REFERENCES "donations"("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