You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- You are about to drop the column `cart_id` on the `cart_items` table. All the data in the column will be lost.
5
+
- You are about to drop the column `product_id` on the `cart_items` table. All the data in the column will be lost.
6
+
- You are about to drop the `ProductVariants` table. If the table is not empty, all the data it contains will be lost.
7
+
- A unique constraint covering the columns `[cartId,productId]` on the table `cart_items` will be added. If there are existing duplicate values, this will fail.
8
+
- Added the required column `cartId` to the `cart_items` table without a default value. This is not possible if the table is not empty.
9
+
- Added the required column `productId` to the `cart_items` table without a default value. This is not possible if the table is not empty.
10
+
11
+
*/
12
+
-- DropForeignKey
13
+
ALTERTABLE"ProductVariants" DROP CONSTRAINT"ProductVariant_productId_fkey";
14
+
15
+
-- DropForeignKey
16
+
ALTERTABLE"cart_items" DROP CONSTRAINT"cart_items_cart_id_fkey";
17
+
18
+
-- DropForeignKey
19
+
ALTERTABLE"cart_items" DROP CONSTRAINT"cart_items_product_id_fkey";
20
+
21
+
-- DropIndex
22
+
DROPINDEX"cart_items_cart_id_product_id_key";
23
+
24
+
-- AlterTable
25
+
ALTERTABLE"cart_items" DROP COLUMN "cart_id",
26
+
DROP COLUMN "product_id",
27
+
ADD COLUMN "cartId"INTEGERNOT NULL,
28
+
ADD COLUMN "productId"INTEGERNOT NULL,
29
+
ADD COLUMN "productVariantId"INTEGER;
30
+
31
+
-- DropTable
32
+
DROPTABLE"ProductVariants";
33
+
34
+
-- CreateTable
35
+
CREATETABLE "ProductVariant" (
36
+
"id"SERIALNOT NULL,
37
+
"productId"INTEGERNOT NULL,
38
+
"size"TEXTNOT NULL,
39
+
40
+
CONSTRAINT"ProductVariant_pkey"PRIMARY KEY ("id")
41
+
);
42
+
43
+
-- CreateIndex
44
+
CREATEUNIQUE INDEX "cart_items_cartId_productId_key" ON"cart_items"("cartId", "productId");
0 commit comments