feat: board visibility
This commit is contained in:
3
packages/db/migrations/0005_modern_gideon.sql
Normal file
3
packages/db/migrations/0005_modern_gideon.sql
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
CREATE TYPE "public"."board_visibility" AS ENUM('private', 'public');--> statement-breakpoint
|
||||||
|
ALTER TABLE "board" ADD COLUMN "visibility" "board_visibility" DEFAULT 'private' NOT NULL;--> statement-breakpoint
|
||||||
|
CREATE INDEX IF NOT EXISTS "board_visibility_idx" ON "board" USING btree ("visibility");
|
||||||
1579
packages/db/migrations/meta/0005_snapshot.json
Normal file
1579
packages/db/migrations/meta/0005_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,13 @@
|
|||||||
"when": 1736087559461,
|
"when": 1736087559461,
|
||||||
"tag": "0004_eminent_living_mummy",
|
"tag": "0004_eminent_living_mummy",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 5,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1737130330536,
|
||||||
|
"tag": "0005_modern_gideon",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ import { relations } from "drizzle-orm";
|
|||||||
import {
|
import {
|
||||||
bigint,
|
bigint,
|
||||||
bigserial,
|
bigserial,
|
||||||
|
index,
|
||||||
integer,
|
integer,
|
||||||
pgEnum,
|
pgEnum,
|
||||||
pgTable,
|
pgTable,
|
||||||
@@ -46,6 +47,10 @@ export const workspacePlanEnum = pgEnum("workspace_plan", [
|
|||||||
"pro",
|
"pro",
|
||||||
"enterprise",
|
"enterprise",
|
||||||
]);
|
]);
|
||||||
|
export const boardVisibilityEnum = pgEnum("board_visibility", [
|
||||||
|
"private",
|
||||||
|
"public",
|
||||||
|
]);
|
||||||
|
|
||||||
export const boards = pgTable(
|
export const boards = pgTable(
|
||||||
"board",
|
"board",
|
||||||
@@ -68,8 +73,10 @@ export const boards = pgTable(
|
|||||||
workspaceId: bigint("workspaceId", { mode: "number" })
|
workspaceId: bigint("workspaceId", { mode: "number" })
|
||||||
.notNull()
|
.notNull()
|
||||||
.references(() => workspaces.id, { onDelete: "cascade" }),
|
.references(() => workspaces.id, { onDelete: "cascade" }),
|
||||||
|
visibility: boardVisibilityEnum("visibility").notNull().default("private"),
|
||||||
},
|
},
|
||||||
(table) => ({
|
(table) => ({
|
||||||
|
visibilityIndex: index("board_visibility_idx").on(table.visibility),
|
||||||
uniqueSlugPerWorkspace: uniqueIndex("unique_slug_per_workspace").on(
|
uniqueSlugPerWorkspace: uniqueIndex("unique_slug_per_workspace").on(
|
||||||
table.workspaceId,
|
table.workspaceId,
|
||||||
table.slug,
|
table.slug,
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ export type Database = {
|
|||||||
publicId: string
|
publicId: string
|
||||||
slug: string
|
slug: string
|
||||||
updatedAt: string | null
|
updatedAt: string | null
|
||||||
|
visibility: Database["public"]["Enums"]["board_visibility"]
|
||||||
workspaceId: number
|
workspaceId: number
|
||||||
}
|
}
|
||||||
Insert: {
|
Insert: {
|
||||||
@@ -96,6 +97,7 @@ export type Database = {
|
|||||||
publicId: string
|
publicId: string
|
||||||
slug: string
|
slug: string
|
||||||
updatedAt?: string | null
|
updatedAt?: string | null
|
||||||
|
visibility?: Database["public"]["Enums"]["board_visibility"]
|
||||||
workspaceId: number
|
workspaceId: number
|
||||||
}
|
}
|
||||||
Update: {
|
Update: {
|
||||||
@@ -110,6 +112,7 @@ export type Database = {
|
|||||||
publicId?: string
|
publicId?: string
|
||||||
slug?: string
|
slug?: string
|
||||||
updatedAt?: string | null
|
updatedAt?: string | null
|
||||||
|
visibility?: Database["public"]["Enums"]["board_visibility"]
|
||||||
workspaceId?: number
|
workspaceId?: number
|
||||||
}
|
}
|
||||||
Relationships: [
|
Relationships: [
|
||||||
@@ -772,6 +775,7 @@ export type Database = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Enums: {
|
Enums: {
|
||||||
|
board_visibility: "private" | "public"
|
||||||
card_activity_type:
|
card_activity_type:
|
||||||
| "card.created"
|
| "card.created"
|
||||||
| "card.updated.title"
|
| "card.updated.title"
|
||||||
|
|||||||
Reference in New Issue
Block a user