feat: board visibility
This commit is contained in:
@@ -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