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,
|
||||
"tag": "0004_eminent_living_mummy",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 5,
|
||||
"version": "7",
|
||||
"when": 1737130330536,
|
||||
"tag": "0005_modern_gideon",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { relations } from "drizzle-orm";
|
||||
import {
|
||||
bigint,
|
||||
bigserial,
|
||||
index,
|
||||
integer,
|
||||
pgEnum,
|
||||
pgTable,
|
||||
@@ -46,6 +47,10 @@ export const workspacePlanEnum = pgEnum("workspace_plan", [
|
||||
"pro",
|
||||
"enterprise",
|
||||
]);
|
||||
export const boardVisibilityEnum = pgEnum("board_visibility", [
|
||||
"private",
|
||||
"public",
|
||||
]);
|
||||
|
||||
export const boards = pgTable(
|
||||
"board",
|
||||
@@ -68,8 +73,10 @@ export const boards = pgTable(
|
||||
workspaceId: bigint("workspaceId", { mode: "number" })
|
||||
.notNull()
|
||||
.references(() => workspaces.id, { onDelete: "cascade" }),
|
||||
visibility: boardVisibilityEnum("visibility").notNull().default("private"),
|
||||
},
|
||||
(table) => ({
|
||||
visibilityIndex: index("board_visibility_idx").on(table.visibility),
|
||||
uniqueSlugPerWorkspace: uniqueIndex("unique_slug_per_workspace").on(
|
||||
table.workspaceId,
|
||||
table.slug,
|
||||
|
||||
@@ -82,6 +82,7 @@ export type Database = {
|
||||
publicId: string
|
||||
slug: string
|
||||
updatedAt: string | null
|
||||
visibility: Database["public"]["Enums"]["board_visibility"]
|
||||
workspaceId: number
|
||||
}
|
||||
Insert: {
|
||||
@@ -96,6 +97,7 @@ export type Database = {
|
||||
publicId: string
|
||||
slug: string
|
||||
updatedAt?: string | null
|
||||
visibility?: Database["public"]["Enums"]["board_visibility"]
|
||||
workspaceId: number
|
||||
}
|
||||
Update: {
|
||||
@@ -110,6 +112,7 @@ export type Database = {
|
||||
publicId?: string
|
||||
slug?: string
|
||||
updatedAt?: string | null
|
||||
visibility?: Database["public"]["Enums"]["board_visibility"]
|
||||
workspaceId?: number
|
||||
}
|
||||
Relationships: [
|
||||
@@ -772,6 +775,7 @@ export type Database = {
|
||||
}
|
||||
}
|
||||
Enums: {
|
||||
board_visibility: "private" | "public"
|
||||
card_activity_type:
|
||||
| "card.created"
|
||||
| "card.updated.title"
|
||||
|
||||
Reference in New Issue
Block a user