text: -- CreateTable
  CREATE TABLE "ProductType" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "name" TEXT NOT NULL,
      "isActive" BOOLEAN NOT NULL DEFAULT true
  );
  
  -- CreateTable
  CREATE TABLE "ProductCategory" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "name" TEXT NOT NULL,
      "isActive" BOOLEAN NOT NULL DEFAULT true
  );
  
  -- CreateTable
  CREATE TABLE "Product" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "name" TEXT NOT NULL,
      "slug" TEXT NOT NULL,
      "description" TEXT,
      "price" REAL NOT NULL,
      "brand" TEXT,
      "imageUrl" TEXT,
      "rating" REAL,
      "numReviews" INTEGER,
      "countInStock" INTEGER NOT NULL,
      "productTypeId" INTEGER DEFAULT 1,
      "productCategoryId" INTEGER DEFAULT 1,
      CONSTRAINT "Product_productTypeId_fkey" FOREIGN KEY ("productTypeId") REFERENCES "ProductType" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
      CONSTRAINT "Product_productCategoryId_fkey" FOREIGN KEY ("productCategoryId") REFERENCES "ProductCategory" ("id") ON DELETE SET NULL ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "ProductImage" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "url" TEXT NOT NULL,
      "isActive" BOOLEAN NOT NULL,
      "productId" INTEGER,
      CONSTRAINT "ProductImage_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product" ("id") ON DELETE SET NULL ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "Profile" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "name" TEXT NOT NULL,
      "userId" INTEGER NOT NULL,
      "avatar" TEXT,
      CONSTRAINT "Profile_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "User" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "name" TEXT,
      "email" TEXT NOT NULL,
      "password" TEXT NOT NULL,
      "isAdmin" BOOLEAN DEFAULT false
  );
  
  -- CreateTable
  CREATE TABLE "Review" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "name" TEXT NOT NULL,
      "content" TEXT NOT NULL,
      "rating" INTEGER NOT NULL,
      "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "productId" INTEGER NOT NULL,
      "reviewerId" INTEGER NOT NULL,
      CONSTRAINT "Review_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
      CONSTRAINT "Review_reviewerId_fkey" FOREIGN KEY ("reviewerId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "ReviewComment" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "content" TEXT NOT NULL,
      "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
      "reviewId" INTEGER NOT NULL,
      "authorId" INTEGER NOT NULL,
      "parentCommentId" INTEGER,
      CONSTRAINT "ReviewComment_reviewId_fkey" FOREIGN KEY ("reviewId") REFERENCES "Review" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
      CONSTRAINT "ReviewComment_authorId_fkey" FOREIGN KEY ("authorId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
      CONSTRAINT "ReviewComment_parentCommentId_fkey" FOREIGN KEY ("parentCommentId") REFERENCES "ReviewComment" ("id") ON DELETE SET NULL ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "Order" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "paymentMethod" TEXT,
      "paymentResult" TEXT DEFAULT 'unpaid',
      "itemsPrice" INTEGER NOT NULL,
      "shippingPrice" INTEGER NOT NULL,
      "taxPrice" DECIMAL NOT NULL,
      "totalPrice" DECIMAL NOT NULL,
      "isPaid" BOOLEAN DEFAULT false,
      "isDelivered" BOOLEAN DEFAULT false,
      "createdAt" DATETIME,
      "paidAt" DATETIME,
      "deliveredAt" DATETIME,
      "userId" INTEGER NOT NULL,
      "shippingAddressId" INTEGER NOT NULL,
      CONSTRAINT "Order_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
      CONSTRAINT "Order_shippingAddressId_fkey" FOREIGN KEY ("shippingAddressId") REFERENCES "ShippingAddress" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "OrderItem" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "quantity" INTEGER NOT NULL,
      "price" REAL NOT NULL,
      "orderId" INTEGER NOT NULL,
      "productId" INTEGER NOT NULL,
      CONSTRAINT "OrderItem_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order" ("id") ON DELETE RESTRICT ON UPDATE CASCADE,
      CONSTRAINT "OrderItem_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "ShippingAddress" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "fullName" TEXT,
      "address" TEXT,
      "city" TEXT,
      "postalCode" TEXT,
      "country" TEXT,
      "locationId" INTEGER,
      "userId" INTEGER,
      CONSTRAINT "ShippingAddress_locationId_fkey" FOREIGN KEY ("locationId") REFERENCES "Location" ("id") ON DELETE SET NULL ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "Location" (
      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
      "lat" TEXT,
      "lng" TEXT,
      "address" TEXT,
      "name" TEXT,
      "vicinity" TEXT,
      "googleAddressId" TEXT
  );
  
  -- CreateTable
  CREATE TABLE "_UserShippingAddress" (
      "A" INTEGER NOT NULL,
      "B" INTEGER NOT NULL,
      FOREIGN KEY ("A") REFERENCES "ShippingAddress" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
      FOREIGN KEY ("B") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "_UserFriendsUse" (
      "A" INTEGER NOT NULL,
      "B" INTEGER NOT NULL,
      FOREIGN KEY ("A") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
      FOREIGN KEY ("B") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "_UserLikesReview" (
      "A" INTEGER NOT NULL,
      "B" INTEGER NOT NULL,
      FOREIGN KEY ("A") REFERENCES "Review" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
      FOREIGN KEY ("B") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  );
  
  -- CreateTable
  CREATE TABLE "_UserLikesReviewComment" (
      "A" INTEGER NOT NULL,
      "B" INTEGER NOT NULL,
      FOREIGN KEY ("A") REFERENCES "ReviewComment" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
      FOREIGN KEY ("B") REFERENCES "User" ("id") ON DELETE CASCADE ON UPDATE CASCADE
  );
  
  -- CreateIndex
  CREATE UNIQUE INDEX "Product_slug_key" ON "Product"("slug");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "Profile_userId_key" ON "Profile"("userId");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "_UserShippingAddress_AB_unique" ON "_UserShippingAddress"("A", "B");
  
  -- CreateIndex
  CREATE INDEX "_UserShippingAddress_B_index" ON "_UserShippingAddress"("B");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "_UserFriendsUse_AB_unique" ON "_UserFriendsUse"("A", "B");
  
  -- CreateIndex
  CREATE INDEX "_UserFriendsUse_B_index" ON "_UserFriendsUse"("B");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "_UserLikesReview_AB_unique" ON "_UserLikesReview"("A", "B");
  
  -- CreateIndex
  CREATE INDEX "_UserLikesReview_B_index" ON "_UserLikesReview"("B");
  
  -- CreateIndex
  CREATE UNIQUE INDEX "_UserLikesReviewComment_AB_unique" ON "_UserLikesReviewComment"("A", "B");
  
  -- CreateIndex
  CREATE INDEX "_UserLikesReviewComment_B_index" ON "_UserLikesReviewComment"("B");
  