-
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
3 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
web/prisma/migrations/20231117105636_drop_new_pageviews/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,18 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the `Location` table. If the table is not empty, all the data it contains will be lost. | ||
- You are about to drop the `PageViewNext` table. If the table is not empty, all the data it contains will be lost. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE "PageViewNext" DROP CONSTRAINT "PageViewNext_locationId_fkey"; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE "PageViewNext" DROP CONSTRAINT "PageViewNext_projectId_fkey"; | ||
|
||
-- DropTable | ||
DROP TABLE "Location"; | ||
|
||
-- DropTable | ||
DROP TABLE "PageViewNext"; |
36 changes: 36 additions & 0 deletions
36
web/prisma/migrations/20231117105705_recreate_new_pageviews/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,36 @@ | ||
-- CreateTable | ||
CREATE TABLE "PageViewNext" ( | ||
"id" UUID NOT NULL, | ||
"date" TIMESTAMP(3) NOT NULL, | ||
"pathname" TEXT NOT NULL, | ||
"user_hash" TEXT NOT NULL, | ||
"referrer" TEXT, | ||
"browser" TEXT, | ||
"device" TEXT, | ||
"os" TEXT, | ||
"locationId" INTEGER NOT NULL, | ||
"projectId" TEXT NOT NULL, | ||
|
||
CONSTRAINT "PageViewNext_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Location" ( | ||
"id" SERIAL NOT NULL, | ||
"flag" TEXT NOT NULL, | ||
"country" TEXT NOT NULL, | ||
"city" TEXT NOT NULL, | ||
"latitude" DOUBLE PRECISION NOT NULL, | ||
"longitude" DOUBLE PRECISION NOT NULL, | ||
|
||
CONSTRAINT "Location_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Location_flag_country_city_key" ON "Location"("flag", "country", "city"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "PageViewNext" ADD CONSTRAINT "PageViewNext_locationId_fkey" FOREIGN KEY ("locationId") REFERENCES "Location"("id") ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "PageViewNext" ADD CONSTRAINT "PageViewNext_projectId_fkey" FOREIGN KEY ("projectId") REFERENCES "Project"("id") ON DELETE CASCADE 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
595afc3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
stats – ./
stats-nu-nine.vercel.app
stats-olros.vercel.app
stats-git-main-olros.vercel.app
stats.olafros.com