Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

add name column to share table

Francis Cao63d2bfe118c2
diff --git a/prisma/migrations/15_add_share/migration.sql b/prisma/migrations/15_add_share/migration.sql
index d9f1e7cf7..3971b54c5 100644
--- a/prisma/migrations/15_add_share/migration.sql
+++ b/prisma/migrations/15_add_share/migration.sql
@@ -3,6 +3,7 @@ CREATE TABLE "share" (
"share_id" UUID NOT NULL,
"entity_id" UUID NOT NULL,
"share_type" INTEGER NOT NULL,
+ "name" VARCHAR(200) NOT NULL,
"slug" VARCHAR(100) NOT NULL,
"parameters" JSONB NOT NULL,
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
@@ -21,9 +22,10 @@ CREATE UNIQUE INDEX "share_slug_key" ON "share"("slug");
CREATE INDEX "share_entity_id_idx" ON "share"("entity_id");
-- MigrateData
-INSERT INTO "share" (share_id, entity_id, share_type, slug, parameters, created_at)
+INSERT INTO "share" (share_id, entity_id, name, share_type, slug, parameters, created_at)
SELECT gen_random_uuid(),
website_id,
+ name,
1,
share_id,
'{}'::jsonb,
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
index 4da354068..e58ebd0b0 100644
--- a/prisma/schema.prisma
+++ b/prisma/schema.prisma
@@ -342,6 +342,7 @@ model Board {
model Share {
id String @id() @map("share_id") @db.Uuid
entityId String @map("entity_id") @db.Uuid
+ name String @db.VarChar(200)
shareType Int @map("share_type") @db.Integer
slug String @unique() @db.VarChar(100)
parameters Json