share api, queries, permissions, migration, entity lib
This commit is contained in:
1 parent
a270b0afea
commit
29f2c7b7d4
11 files changed
+256
-23
No files matched your search
@@ -3,7 +3,7 @@ CREATE TABLE "share" (
|
||||
"share_id" UUID NOT NULL,
|
||||
"entity_id" UUID NOT NULL,
|
||||
"share_type" INTEGER NOT NULL,
|
||||
"share_code" VARCHAR(50),
|
||||
"slug" VARCHAR(100) NOT NULL,
|
||||
"parameters" JSONB NOT NULL,
|
||||
"created_at" TIMESTAMPTZ(6) DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMPTZ(6),
|
||||
@@ -15,13 +15,13 @@ CREATE TABLE "share" (
|
||||
CREATE UNIQUE INDEX "share_share_id_key" ON "share"("share_id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "share_share_code_key" ON "share"("share_code");
|
||||
CREATE UNIQUE INDEX "share_slug_key" ON "share"("slug");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "share_entity_id_idx" ON "share"("entity_id");
|
||||
|
||||
-- MigrateData
|
||||
INSERT INTO "share" (share_id, entity_id, share_type, share_code, parameters, created_at)
|
||||
INSERT INTO "share" (share_id, entity_id, share_type, slug, parameters, created_at)
|
||||
SELECT gen_random_uuid(),
|
||||
website_id,
|
||||
1,
|
||||
|
||||
@@ -319,7 +319,7 @@ model Share {
|
||||
id String @id() @unique() @map("share_id") @db.Uuid
|
||||
entityId String @map("entity_id") @db.Uuid
|
||||
shareType Int @map("share_type") @db.Integer
|
||||
shareCode String? @unique @map("share_code") @db.VarChar(50)
|
||||
slug String @unique() @db.VarChar(100)
|
||||
parameters Json
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
|
||||
updatedAt DateTime? @updatedAt @map("updated_at") @db.Timestamptz(6)
|
||||
|
||||
Reference in new issue
Block a user