-- CreateTable
CREATE TABLE "GoogleBusinessProfile" (
    "id" SERIAL NOT NULL,
    "userId" INTEGER NOT NULL,
    "googleAccountId" TEXT NOT NULL,
    "locationId" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "address" TEXT,
    "city" TEXT,
    "state" TEXT,
    "country" TEXT,
    "postalCode" TEXT,
    "phone" TEXT,
    "website" TEXT,
    "category" TEXT,
    "verified" BOOLEAN NOT NULL DEFAULT false,
    "verificationStatus" TEXT,
    "storeCode" TEXT,
    "placeId" TEXT,
    "mapsUri" TEXT,
    "lastSynced" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,

    CONSTRAINT "GoogleBusinessProfile_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "GoogleBusinessProfile_locationId_key" ON "GoogleBusinessProfile"("locationId");

-- CreateIndex
CREATE INDEX "GoogleBusinessProfile_userId_idx" ON "GoogleBusinessProfile"("userId");

-- CreateIndex
CREATE INDEX "GoogleBusinessProfile_googleAccountId_idx" ON "GoogleBusinessProfile"("googleAccountId");

-- CreateIndex
CREATE INDEX "Session_userId_idx" ON "Session"("userId");
