mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-07 19:30:07 -05:00
feat: add Url Shortener (#895)
* WIP * added prisma actions * remove console.logs * some more fixes * tweaks * addressed all PR review comments * remove hits from the prisma schema and all its corresponding service logic * add nanoid * corrected placeholders * change database model, bring shortUrl service up to Formbricks code conventions * update UI and shortUrl endpoint to work with new service --------- Co-authored-by: Dhruwang <dhruwangjariwala18@gmail.com> Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "ShortUrl" (
|
||||
"id" TEXT NOT NULL,
|
||||
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMP(3) NOT NULL,
|
||||
"url" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "ShortUrl_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "ShortUrl_url_key" ON "ShortUrl"("url");
|
||||
@@ -513,3 +513,10 @@ model User {
|
||||
/// [UserNotificationSettings]
|
||||
notificationSettings Json @default("{}")
|
||||
}
|
||||
|
||||
model ShortUrl {
|
||||
id String @id // generate nanoId in service
|
||||
createdAt DateTime @default(now()) @map(name: "created_at")
|
||||
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
||||
url String @unique
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user