-
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
15 changed files
with
516 additions
and
183 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
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
17 changes: 17 additions & 0 deletions
17
prisma/migrations/20240811111955_optional_json_fields/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,17 @@ | ||
-- AlterTable | ||
ALTER TABLE "collections" ALTER COLUMN "metadata" DROP NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "ipassets" ALTER COLUMN "metadata" DROP NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "licenses" ALTER COLUMN "metadata" DROP NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "nfts" ALTER COLUMN "metadata" DROP NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "products" ALTER COLUMN "metadata" DROP NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "users" ALTER COLUMN "additional_info" DROP NOT NULL; |
41 changes: 41 additions & 0 deletions
41
prisma/migrations/20240813100647_product_collection_relation/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,41 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `product_id` on the `collections` table. All the data in the column will be lost. | ||
- Made the column `metadata` on table `collections` required. This step will fail if there are existing NULL values in that column. | ||
- Made the column `metadata` on table `products` required. This step will fail if there are existing NULL values in that column. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "collections" DROP CONSTRAINT "collections_product_id_fkey"; | ||
|
||
-- DropIndex | ||
DROP INDEX "collections_product_id_idx"; | ||
|
||
-- AlterTable | ||
ALTER TABLE "collections" DROP COLUMN "product_id", | ||
ALTER COLUMN "metadata" SET NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "products" ALTER COLUMN "metadata" SET NOT NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE "product_collections" ( | ||
"id" SERIAL NOT NULL, | ||
"product_id" INTEGER NOT NULL, | ||
"collection_id" INTEGER NOT NULL, | ||
|
||
CONSTRAINT "product_collections_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "product_collections_product_id_idx" ON "product_collections"("product_id"); | ||
|
||
-- CreateIndex | ||
CREATE INDEX "product_collections_collection_id_idx" ON "product_collections"("collection_id"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "product_collections" ADD CONSTRAINT "product_collections_product_id_fkey" FOREIGN KEY ("product_id") REFERENCES "products"("id") ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "product_collections" ADD CONSTRAINT "product_collections_collection_id_fkey" FOREIGN KEY ("collection_id") REFERENCES "collections"("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
Oops, something went wrong.