diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx index 003eb37a6..4a66618db 100644 --- a/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx +++ b/apps/nextjs/src/app/[locale]/boards/(content)/_creator.tsx @@ -21,7 +21,7 @@ import { env } from "~/env"; import { createBoardLayout } from "../_layout-creator"; import type { Board, Item } from "../_types"; import { ClientBoard } from "./_client"; -import { BoardContentHeaderActions } from "./_header-actions"; +import { BoardContentEditAction, BoardContentSettingsAction } from "./_header-actions"; const logger = createLogger({ module: "createBoardContentPage" }); const getQueryClient = cache(makeQueryClient); @@ -37,7 +37,8 @@ export const createBoardContentPage = >( }: Props) => { return { layout: createBoardLayout({ - headerActions: , + headerBoardEditAction: , + headerBoardSettingsAction: , getInitialBoardAsync: getInitialBoard, withTour: true, }), diff --git a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx index 476706ded..41552ff34 100644 --- a/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx +++ b/apps/nextjs/src/app/[locale]/boards/(content)/_header-actions.tsx @@ -39,10 +39,9 @@ const loadBoardEditorAsync = async () => ]); const BoardEditActions = dynamic(loadEditActionsAsync, { ssr: false }); -export const BoardContentHeaderActions = ({ demoReadOnly }: { demoReadOnly: boolean }) => { +export const BoardContentEditAction = ({ demoReadOnly }: { demoReadOnly: boolean }) => { const [isEditMode] = useEditMode(); const board = useRequiredBoard(); - const t = useI18n("board"); const { hasChangeAccess } = useBoardPermissions(board); if (!hasChangeAccess) return null; @@ -50,20 +49,27 @@ export const BoardContentHeaderActions = ({ demoReadOnly }: { demoReadOnly: bool return ( <> {isEditMode && } - - - {!demoReadOnly && ( - - - - - - )} ); }; +export const BoardContentSettingsAction = ({ demoReadOnly }: { demoReadOnly: boolean }) => { + const board = useRequiredBoard(); + const t = useI18n("board"); + const { hasChangeAccess } = useBoardPermissions(board); + + if (!hasChangeAccess || demoReadOnly) return null; + + return ( + + + + + + ); +}; + const EditModeMenu = ({ demoReadOnly }: { demoReadOnly: boolean }) => { const [isEditMode, { open, close }] = useEditMode(); const [editorLoadState, setEditorLoadState] = useState<"scheduled" | "loading" | "ready" | "error">("scheduled"); diff --git a/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsx b/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsx index bbbc93ea1..195f01f13 100644 --- a/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsx +++ b/apps/nextjs/src/app/[locale]/boards/_layout-creator.tsx @@ -28,13 +28,17 @@ import { BoardMantineProvider } from "./(content)/_theme"; const logger = createLogger({ module: "createBoardLayout" }); interface CreateBoardLayoutProps { - headerActions: JSX.Element; + headerActions?: JSX.Element; + headerBoardEditAction?: JSX.Element; + headerBoardSettingsAction?: JSX.Element; getInitialBoardAsync: (params: TParams) => Promise; withTour?: boolean; } export const createBoardLayout = ({ headerActions, + headerBoardEditAction, + headerBoardSettingsAction, getInitialBoardAsync: getInitialBoard, withTour = false, }: CreateBoardLayoutProps) => { @@ -108,6 +112,8 @@ export const createBoardLayout = ({ } actions={headerActions} + boardEditAction={headerBoardEditAction} + boardSettingsAction={headerBoardSettingsAction} hasNavigation={false} /> {children} diff --git a/apps/nextjs/src/app/[locale]/init/page.tsx b/apps/nextjs/src/app/[locale]/init/page.tsx index 49798a177..b754a2919 100644 --- a/apps/nextjs/src/app/[locale]/init/page.tsx +++ b/apps/nextjs/src/app/[locale]/init/page.tsx @@ -2,7 +2,6 @@ import { headers } from "next/headers"; import { getOnboardingClaimTokenFromCookieHeader, isOnboardingClaimValidAsync } from "@homarr/api/onboarding-claim"; import { normalizeOnboardingStep } from "@homarr/api/onboarding-step"; -import { getRscServerSettingsAsync } from "@homarr/api/server-settings-server"; import { auth } from "@homarr/auth/next"; import { isProviderEnabled } from "@homarr/auth/server"; import { extractBaseUrlFromHeaders } from "@homarr/common"; @@ -20,12 +19,11 @@ import { getPackageVersion } from "~/versions/package-reader"; import { AssistantConfiguration } from "../manage/assistant/_components/assistant-configuration"; export default async function InitPage() { - const [state, session, requestHeaders, firstUser, serverSettings] = await Promise.all([ + const [state, session, requestHeaders, firstUser] = await Promise.all([ db.query.onboarding.findFirst(), auth(), headers(), db.query.users.findFirst({ columns: { id: true } }), - getRscServerSettingsAsync(), ]); const canConfigurePrivileged = session?.user.permissions.includes("admin") ?? false; const onboardingClaim = getOnboardingClaimTokenFromCookieHeader(requestHeaders.get("cookie")); @@ -74,11 +72,7 @@ export default async function InitPage() { availableBoards: availableBoards.map(({ id, name }) => ({ id, name })), }} sqliteRestore={databaseDriver === "sqlite" ? : undefined} - assistantConfiguration={ - canConfigurePrivileged && serverSettings.featureControls.assistantEnabled ? ( - - ) : undefined - } + assistantConfiguration={canConfigurePrivileged ? : undefined} /> ); } diff --git a/apps/nextjs/src/app/[locale]/layout.tsx b/apps/nextjs/src/app/[locale]/layout.tsx index d684d0731..b1fd81106 100644 --- a/apps/nextjs/src/app/[locale]/layout.tsx +++ b/apps/nextjs/src/app/[locale]/layout.tsx @@ -113,11 +113,7 @@ export default async function Layout(props: { }) : null, ); - const assistantAvailabilityPromise: Promise = Promise.all([ - sessionPromise, - serverSettingsPromise, - ]).then(([session, serverSettings]) => { - if (!serverSettings.featureControls.assistantEnabled) return "disabled"; + const assistantAvailabilityPromise: Promise = sessionPromise.then((session) => { if (!session) return "unauthenticated"; return api.assistant .getAvailability() @@ -163,7 +159,6 @@ export default async function Layout(props: { search: { defaultSearchEngineId: serverSettings.search.defaultSearchEngineId }, user: { enableGravatar: serverSettings.user.enableGravatar }, branding: serverSettings.branding, - featureControls: serverSettings.featureControls, }} {...innerProps} /> diff --git a/apps/nextjs/src/app/[locale]/manage/assistant/page.tsx b/apps/nextjs/src/app/[locale]/manage/assistant/page.tsx index 5e76e6ecb..7ff16144c 100644 --- a/apps/nextjs/src/app/[locale]/manage/assistant/page.tsx +++ b/apps/nextjs/src/app/[locale]/manage/assistant/page.tsx @@ -1,7 +1,6 @@ import { notFound } from "next/navigation"; import { Text } from "@mantine/core"; -import { getRscServerSettingsAsync } from "@homarr/api/server-settings-server"; import { auth } from "@homarr/auth/next"; import { getI18n } from "@homarr/translation/server"; @@ -17,9 +16,9 @@ export async function generateMetadata() { } export default async function AssistantPage() { - const [session, serverSettings] = await Promise.all([auth(), getRscServerSettingsAsync()]); + const session = await auth(); - if (!serverSettings.featureControls.assistantEnabled || !session?.user.permissions.includes("admin")) { + if (!session?.user.permissions.includes("admin")) { notFound(); } diff --git a/apps/nextjs/src/app/[locale]/manage/layout.tsx b/apps/nextjs/src/app/[locale]/manage/layout.tsx index ed2d60b84..49f2af415 100644 --- a/apps/nextjs/src/app/[locale]/manage/layout.tsx +++ b/apps/nextjs/src/app/[locale]/manage/layout.tsx @@ -29,7 +29,6 @@ import { } from "@tabler/icons-react"; import { getRscUserSettingsAsync } from "@homarr/api/user-server"; -import { getRscServerSettingsAsync } from "@homarr/api/server-settings-server"; import { auth } from "@homarr/auth/next"; import { isProviderEnabled } from "@homarr/auth/server"; import { createLogger } from "@homarr/core/infrastructure/logs"; @@ -62,12 +61,11 @@ export default async function ManageLayout({ children }: PropsWithChildren) { return false; } }); - const [t, tEntities, session, shouldRunManageTour, serverSettings] = await Promise.all([ + const [t, tEntities, session, shouldRunManageTour] = await Promise.all([ getI18n("management.navbar"), getI18n("common.entity"), sessionPromise, shouldRunManageTourPromise, - getRscServerSettingsAsync(), ]); const appsAccess = getAppsSectionAccess(session); const integrationsAccess = await getIntegrationsSectionAccessAsync(session); @@ -203,7 +201,7 @@ export default async function ManageLayout({ children }: PropsWithChildren) { label: t("items.assistant"), href: "/manage/assistant", icon: IconRobot, - hidden: !serverSettings.featureControls.assistantEnabled || !session?.user.permissions.includes("admin"), + hidden: !session?.user.permissions.includes("admin"), }, { label: t("items.settings"), diff --git a/apps/nextjs/src/app/[locale]/manage/settings/_components/branding-settings-form.tsx b/apps/nextjs/src/app/[locale]/manage/settings/_components/branding-settings-form.tsx index 6b80fadd7..694f7fafe 100644 --- a/apps/nextjs/src/app/[locale]/manage/settings/_components/branding-settings-form.tsx +++ b/apps/nextjs/src/app/[locale]/manage/settings/_components/branding-settings-form.tsx @@ -46,6 +46,7 @@ export const BrandingSettingsForm = ({ form }: BrandingSettingsFormProps) => { { /> { { {t("authVisibility.description")} - + ; -} - -export const FeatureControlsSettingsForm = ({ form }: FeatureControlsSettingsFormProps) => { - const t = useI18n("management.page.settings.section.featureControls"); - - return ( - - - - - - - - ); -}; diff --git a/apps/nextjs/src/app/[locale]/manage/settings/_components/settings-form.tsx b/apps/nextjs/src/app/[locale]/manage/settings/_components/settings-form.tsx index aa11eac14..ba8661966 100644 --- a/apps/nextjs/src/app/[locale]/manage/settings/_components/settings-form.tsx +++ b/apps/nextjs/src/app/[locale]/manage/settings/_components/settings-form.tsx @@ -12,7 +12,7 @@ import { colorSchemes } from "@homarr/definitions"; import { useZodForm } from "@homarr/form"; import { showErrorNotification, showSuccessNotification } from "@homarr/notifications"; import type { ServerSettings, defaultServerSettingsKeys } from "@homarr/server-settings"; -import { brandingServerSettingsSchema, featureControlsServerSettingsSchema } from "@homarr/server-settings"; +import { brandingServerSettingsSchema } from "@homarr/server-settings"; import { useI18n } from "@homarr/translation/client"; import { UnsavedChangesBar } from "~/components/manage/unsaved-changes-bar"; @@ -22,7 +22,6 @@ import { BoardSettingsForm } from "./board-settings-form"; import { BrandingSettingsForm } from "./branding-settings-form"; import { CrawlingAndIndexingSettings } from "./crawling-and-indexing.settings"; import { CultureSettingsForm } from "./culture-settings-form"; -import { FeatureControlsSettingsForm } from "./feature-controls-settings-form"; import { SearchSettingsForm } from "./search-settings-form"; import { UserSettingsForm } from "./user-settings-form"; @@ -41,7 +40,6 @@ const settingsFormSchema = z.object({ defaultColorScheme: z.enum(colorSchemes), defaultLocale: z.string(), branding: brandingServerSettingsSchema, - featureControls: featureControlsServerSettingsSchema, }); export type FormValues = z.infer; @@ -61,7 +59,6 @@ const buildInitialValues = (initialData: ServerSettings): FormValues => ({ defaultColorScheme: initialData.appearance.defaultColorScheme, defaultLocale: initialData.culture.defaultLocale, branding: initialData.branding, - featureControls: initialData.featureControls, }); interface SettingsFormProps { @@ -149,11 +146,6 @@ export const SettingsForm = ({ initialData, selectableBoards, selectableSearchEn when: changed("branding"), value: values.branding, }, - { - settingsKey: "featureControls", - when: changed("featureControls"), - value: values.featureControls, - }, ]; const promises = groups @@ -194,7 +186,6 @@ export const SettingsForm = ({ initialData, selectableBoards, selectableSearchEn - diff --git a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.module.css b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.module.css index e5553de51..269f15751 100644 --- a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.module.css +++ b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.module.css @@ -65,8 +65,7 @@ } .sortableStrip { - display: grid; - grid-template-columns: repeat(3, minmax(0, 1fr)); + display: flex; gap: var(--mantine-spacing-sm); width: 100%; min-width: 100%; @@ -79,7 +78,8 @@ display: grid; grid-template-rows: 1.25rem 2.5rem; gap: 0.3rem; - min-width: 0; + min-width: max-content; + flex: 1 0 0; align-content: center; } @@ -90,8 +90,8 @@ min-width: 0; min-height: 1.25rem; padding-inline: 0.15rem; - border-radius: var(--mantine-radius-sm); - transition: background-color 120ms ease; + pointer-events: none; + user-select: none; } .zoneDelimiter :global(.mantine-Divider-label) { @@ -103,14 +103,6 @@ text-transform: uppercase; } -.zoneDelimiter[data-over="true"] { - background: var(--mantine-primary-color-light); -} - -.zoneDelimiter[data-over="true"] :global(.mantine-Divider-label) { - color: var(--mantine-primary-color-filled); -} - .zoneControls { display: flex; align-items: center; @@ -118,13 +110,7 @@ min-width: 0; height: 2.5rem; padding: 0.125rem; - overflow-x: auto; - overflow-y: hidden; - scrollbar-width: none; -} - -.zoneControls::-webkit-scrollbar { - display: none; + overflow: visible; } .zoneSegment[data-zone="center"] .zoneControls { @@ -135,31 +121,31 @@ justify-content: safe flex-end; } -.zoneTail { +.emptyZoneTarget { display: grid; place-items: center; - width: 1.5rem; + min-width: 2.25rem; height: 2.25rem; - flex: 0 0 1.5rem; + flex: 1 0 2.25rem; border-radius: var(--mantine-radius-sm); transition: background-color 120ms ease; } -.zoneTailMarker { +.emptyZoneTarget span { width: 2px; height: 1rem; border-radius: var(--mantine-radius-xl); - background: var(--mantine-color-default-border); + background: transparent; transition: height 120ms ease, background-color 120ms ease; } -.zoneTail[data-over="true"] { +.emptyZoneTarget[data-over="true"] { background: var(--mantine-primary-color-light); } -.zoneTail[data-over="true"] .zoneTailMarker { +.emptyZoneTarget[data-over="true"] span { height: 1.5rem; background: var(--mantine-primary-color-filled); } @@ -257,23 +243,6 @@ display: grid; } -.contextActions { - display: flex; - gap: 5px; - align-items: center; - height: 2.25rem; - flex: 0 0 auto; - padding-inline: 0.35rem; -} - -.contextActions span { - width: 0.45rem; - height: 0.45rem; - border-radius: 50%; - background: var(--mantine-color-dimmed); - opacity: 0.45; -} - .hiddenPreview { position: absolute; inset: 0 0 auto; @@ -333,9 +302,8 @@ @media (prefers-reduced-motion: reduce) { .device, - .zoneDelimiter, - .zoneTail, - .zoneTailMarker, + .emptyZoneTarget, + .emptyZoneTarget span, .itemButton { transition: none; } diff --git a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.tsx b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.tsx index 584fbf2ac..ffb955795 100644 --- a/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.tsx +++ b/apps/nextjs/src/app/[locale]/manage/users/[userId]/general/_components/header-composer.tsx @@ -15,7 +15,6 @@ import { useSensors, } from "@dnd-kit/core"; import { - arrayMove, horizontalListSortingStrategy, SortableContext, sortableKeyboardCoordinates, @@ -44,6 +43,7 @@ import { IconEyeOff, IconHome, IconLayoutDashboard, + IconPencil, IconPlus, IconReplace, IconRobot, @@ -55,7 +55,6 @@ import { } from "@tabler/icons-react"; import type { BoardPreviewData } from "@homarr/boards/layout-preview"; -import { useSettings } from "@homarr/settings"; import { useI18n } from "@homarr/translation/client"; import type { HeaderBuiltinItemId, @@ -73,6 +72,7 @@ import { getHeaderItemZone, headerBuiltinItemIds, headerZoneIds, + isRequiredHeaderItem, } from "@homarr/validation/user"; import { BoardLayoutThumbnail } from "~/components/board/board-layout-thumbnail"; @@ -94,7 +94,6 @@ export const HeaderComposer = ({ value, onChange, boards, homeBoardId, mobileHom const [previewSize, setPreviewSize] = useState("desktop"); const [draggedItemKey, setDraggedItemKey] = useState(null); const [selectedItemKey, setSelectedItemKey] = useState(null); - const { featureControls } = useSettings(); const t = useI18n("management.page.user.setting.general.header"); const sensors = useSensors( useSensor(MouseSensor, { activationConstraint: { distance: 6 } }), @@ -106,12 +105,11 @@ export const HeaderComposer = ({ value, onChange, boards, homeBoardId, mobileHom ); const boardsById = useMemo(() => new Map(boards.map((board) => [board.id, board])), [boards]); const activeItems = getHeaderItems(value.zones); - const visibleItems = activeItems.filter((item) => isHeaderItemAvailable(item, featureControls)); - const visibleItemKeys = visibleItems.map(getHeaderItemKey); + const visibleItemKeys = activeItems.map(getHeaderItemKey); const activeItemKeySet = new Set(activeItems.map(getHeaderItemKey)); const inactiveBuiltinIds = headerBuiltinItemIds.filter((itemId) => { const item = createBuiltinHeaderItem(itemId); - return isHeaderItemAvailable(item, featureControls) && !activeItemKeySet.has(getHeaderItemKey(item)); + return !isRequiredHeaderItem(item) && !activeItemKeySet.has(getHeaderItemKey(item)); }); const availableBoards = boards.filter( (board) => !activeItemKeySet.has(getHeaderItemKey(createBoardHeaderItem(board.id))), @@ -130,7 +128,7 @@ export const HeaderComposer = ({ value, onChange, boards, homeBoardId, mobileHom const updateZones = (zones: HeaderZones) => onChange({ ...value, zones }); const removeItem = (item: HeaderItem) => { - if (item.type === "builtin" && item.id === "user") return; + if (isRequiredHeaderItem(item)) return; const zone = getHeaderItemZone(value.zones, item); if (!zone) return; const itemKey = getHeaderItemKey(item); @@ -159,10 +157,14 @@ export const HeaderComposer = ({ value, onChange, boards, homeBoardId, mobileHom if (!sourceZone || !targetZone) return; const targetItem = findHeaderItem(activeItems, over.id); - let targetIndex = 0; - if (getDropZoneTailId(targetZone) === over.id) targetIndex = value.zones[targetZone].length; - else if (targetItem) + let targetIndex = value.zones[targetZone].length; + if (targetItem) { targetIndex = value.zones[targetZone].findIndex((candidate) => isSameItem(candidate, targetItem)); + const translatedRect = active.rect.current.translated; + const activeCenter = translatedRect ? translatedRect.left + translatedRect.width / 2 : null; + const targetCenter = over.rect.left + over.rect.width / 2; + if (activeCenter !== null && activeCenter > targetCenter) targetIndex += 1; + } if (targetIndex < 0) return; updateZones(moveHeaderItem(value.zones, item, targetZone, targetIndex)); }; @@ -227,10 +229,9 @@ export const HeaderComposer = ({ value, onChange, boards, homeBoardId, mobileHom key={zone} zone={zone} label={t(`zones.${zone}` as never)} - endLabel={t("action.dropAtEnd", { zone: t(`zones.${zone}` as never) })} + emptyLabel={t("action.dropIntoZone", { zone: t(`zones.${zone}` as never) })} leading={zone === "left" ? : null} - trailing={zone === "right" ? : null} - items={value.zones[zone].filter((item) => isHeaderItemAvailable(item, featureControls))} + items={value.zones[zone]} previewSize={previewSize} searchDisplay={value.searchDisplay} selectedItemKey={selectedItemKey} @@ -302,7 +303,7 @@ export const HeaderComposer = ({ value, onChange, boards, homeBoardId, mobileHom ]} /> ) : null} - {selectedItem.type !== "builtin" || selectedItem.id !== "user" ? ( + {!isRequiredHeaderItem(selectedItem) ? ( - + ); }; @@ -628,27 +614,25 @@ const moveHeaderItem = ( const sourceIndex = sourceItems.findIndex((candidate) => isSameItem(candidate, item)); if (sourceIndex < 0) return zones; - if (sourceZone === targetZone) { - const normalizedTargetIndex = Math.min(targetIndex, sourceItems.length - 1); - if (sourceIndex === normalizedTargetIndex) return zones; - return { ...zones, [sourceZone]: arrayMove(sourceItems, sourceIndex, normalizedTargetIndex) }; - } + const sourceItemsWithoutMovedItem = sourceItems.filter((candidate) => !isSameItem(candidate, item)); + const targetItems = sourceZone === targetZone ? sourceItemsWithoutMovedItem : zones[targetZone]; + let normalizedTargetIndex = Math.min(Math.max(targetIndex, 0), targetItems.length); + if (sourceZone === targetZone && sourceIndex < targetIndex) normalizedTargetIndex -= 1; + if (sourceZone === targetZone && sourceIndex === normalizedTargetIndex) return zones; - const targetItems = zones[targetZone]; return { ...zones, - [sourceZone]: sourceItems.filter((candidate) => !isSameItem(candidate, item)), - [targetZone]: [...targetItems.slice(0, targetIndex), item, ...targetItems.slice(targetIndex)], + [sourceZone]: sourceItemsWithoutMovedItem, + [targetZone]: [...targetItems.slice(0, normalizedTargetIndex), item, ...targetItems.slice(normalizedTargetIndex)], }; }; const getDropZoneId = (zone: HeaderZoneId) => `header-zone-${zone}`; -const getDropZoneTailId = (zone: HeaderZoneId) => `header-zone-${zone}-end`; const getDropZone = (zones: HeaderZones, id: UniqueIdentifier): HeaderZoneId | undefined => { const item = findHeaderItem(getHeaderItems(zones), id); if (item) return getHeaderItemZone(zones, item); - return headerZoneIds.find((zone) => getDropZoneId(zone) === id || getDropZoneTailId(zone) === id); + return headerZoneIds.find((zone) => getDropZoneId(zone) === id); }; const findHeaderItem = (items: HeaderItem[], id: UniqueIdentifier | null): HeaderItem | undefined => { @@ -659,22 +643,14 @@ const findHeaderItem = (items: HeaderItem[], id: UniqueIdentifier | null): Heade const isSameItem = (first: HeaderItem, second: HeaderItem) => getHeaderItemKey(first) === getHeaderItemKey(second); -const isHeaderItemAvailable = ( - item: HeaderItem, - featureControls: { assistantEnabled: boolean; boardSwitcherEnabled: boolean }, -) => { - if (item.type === "board") return true; - if (item.id === "assistant") return featureControls.assistantEnabled; - if (item.id === "boardSwitcher") return featureControls.boardSwitcherEnabled; - return true; -}; - const getBuiltinItemIcon = (itemId: HeaderBuiltinItemId) => { if (itemId === "search") return IconSearch; if (itemId === "home") return IconHome; if (itemId === "boardSwitcher") return IconReplace; if (itemId === "assistant") return IconRobot; if (itemId === "docker") return IconBrandDocker; + if (itemId === "boardEdit") return IconPencil; + if (itemId === "boardSettings") return IconSettings; if (itemId === "settings") return IconSettings; if (itemId === "themeToggle") return IconSunMoon; if (itemId === "user") return IconUserCircle; diff --git a/apps/nextjs/src/app/api/assistant/chat/route.ts b/apps/nextjs/src/app/api/assistant/chat/route.ts index c96b8d3e3..a57d41618 100644 --- a/apps/nextjs/src/app/api/assistant/chat/route.ts +++ b/apps/nextjs/src/app/api/assistant/chat/route.ts @@ -18,7 +18,6 @@ import { decryptSecret } from "@homarr/common/server"; import { createLogger } from "@homarr/core/infrastructure/logs"; import { and, eq } from "@homarr/db"; import { db } from "@homarr/db"; -import { getServerSettingByKeyAsync } from "@homarr/db/queries"; import { assistantConfigurations, assistantThreads } from "@homarr/db/schema"; import { assistantProviderCanUseOpenRouterServerTools, @@ -374,11 +373,6 @@ export async function POST(request: Request) { return Response.json({ error: "Sign in to use Assistant." }, { status: 401 }); } - const featureControls = await getServerSettingByKeyAsync(db, "featureControls"); - if (!featureControls.assistantEnabled) { - return Response.json({ error: "Assistant is disabled." }, { status: 404 }); - } - const requestBody = await request.text(); if (requestBody.length > assistantRequestMaxBytes) { return Response.json({ error: "The assistant request is too large." }, { status: 413 }); diff --git a/apps/nextjs/src/components/assistant/assistant-gate.tsx b/apps/nextjs/src/components/assistant/assistant-gate.tsx index 177fec8dd..2713f4958 100644 --- a/apps/nextjs/src/components/assistant/assistant-gate.tsx +++ b/apps/nextjs/src/components/assistant/assistant-gate.tsx @@ -23,16 +23,8 @@ const EnabledAssistantRoot = dynamic(() => import("./assistant-provider").then((module) => ({ default: module.EnabledAssistantRoot })), ); -const AssistantSpotlightPlaceholder = ({ description }: { description: string }) => { +const DisabledAssistant = ({ children, description }: PropsWithChildren<{ description: string }>) => { useRegisterAssistantSpotlightPlaceholder(description); - return null; -}; - -const DisabledAssistant = ({ - children, - description, - discoverable = true, -}: PropsWithChildren<{ description: string; discoverable?: boolean }>) => { const value = useMemo( () => ({ enabled: false, @@ -56,7 +48,6 @@ const DisabledAssistant = ({ return ( - {discoverable ? : null} {children} ); @@ -68,7 +59,7 @@ const DisabledAssistant = ({ * `unauthenticated` is kept apart from `unconfigured` because the server cannot check availability * for a signed-out visitor, and telling them the instance is unconfigured would be a guess. */ -export type AssistantAvailability = "enabled" | "unconfigured" | "unauthenticated" | "disabled" | "error"; +export type AssistantAvailability = "enabled" | "unconfigured" | "unauthenticated" | "error"; interface AssistantGateProps extends PropsWithChildren { availability: AssistantAvailability; @@ -87,13 +78,5 @@ export const AssistantGate = ({ availability, children }: AssistantGateProps) => return {children}; } - if (availability === "disabled") { - return ( - - {children} - - ); - } - return {children}; }; diff --git a/apps/nextjs/src/components/board/board-switcher.tsx b/apps/nextjs/src/components/board/board-switcher.tsx index 5a387ed7e..117f8102f 100644 --- a/apps/nextjs/src/components/board/board-switcher.tsx +++ b/apps/nextjs/src/components/board/board-switcher.tsx @@ -36,18 +36,16 @@ import classes from "./board-switcher.module.css"; export const boardSwitcherHotkey = "shift+c"; export interface BoardSwitcherControls { - enabled: boolean; open: () => void; preload: () => void; hotkey: string; } interface BoardSwitcherProps { - enabled?: boolean; children: (controls: BoardSwitcherControls) => ReactNode; } -export const BoardSwitcher = ({ enabled = true, children }: BoardSwitcherProps) => { +export const BoardSwitcher = ({ children }: BoardSwitcherProps) => { const t = useI18n("board.action.switcher"); const manageBoardsT = useI18n("management.page.board"); const currentBoard = useOptionalBoard(); @@ -64,7 +62,7 @@ export const BoardSwitcher = ({ enabled = true, children }: BoardSwitcherProps) } = clientApi.board.getManageOverview.useQuery( { fullPreview: true }, { - enabled: enabled && isOpen, + enabled: isOpen, }, ); @@ -84,24 +82,16 @@ export const BoardSwitcher = ({ enabled = true, children }: BoardSwitcherProps) const modalColumnCount = Math.max(1, Math.min(switcherBoards.length, responsiveColumnCount)); const openSwitcher = useCallback(() => { - if (!enabled) return; setIsOpen(true); - }, [enabled]); + }, []); const closeSwitcher = useCallback(() => { setIsOpen(false); setSearch(""); setActiveIndex(0); }, []); - const preloadBoards = () => { - if (!enabled) return; - void utils.board.getManageOverview.prefetch({ fullPreview: true }); - }; + const preloadBoards = () => void utils.board.getManageOverview.prefetch({ fullPreview: true }); - useHotkeys(enabled ? [[boardSwitcherHotkey, openSwitcher, { preventDefault: true }]] : []); - - useEffect(() => { - if (!enabled && isOpen) closeSwitcher(); - }, [closeSwitcher, enabled, isOpen]); + useHotkeys([[boardSwitcherHotkey, openSwitcher, { preventDefault: true }]]); useEffect(() => { if (!isOpen || filteredBoards.length === 0) return; @@ -186,10 +176,10 @@ export const BoardSwitcher = ({ enabled = true, children }: BoardSwitcherProps) return ( <> - {children({ enabled, open: openSwitcher, preload: preloadBoards, hotkey: boardSwitcherHotkey })} + {children({ open: openSwitcher, preload: preloadBoards, hotkey: boardSwitcherHotkey })} {children}; } diff --git a/apps/nextjs/src/components/layout/header.tsx b/apps/nextjs/src/components/layout/header.tsx index 702827049..d97615bbb 100644 --- a/apps/nextjs/src/components/layout/header.tsx +++ b/apps/nextjs/src/components/layout/header.tsx @@ -10,10 +10,18 @@ import { HomarrLogo } from "./logo/homarr-logo"; interface Props { logo?: ReactNode; actions?: ReactNode; + boardEditAction?: ReactNode; + boardSettingsAction?: ReactNode; hasNavigation?: boolean; } -export const MainHeader = async ({ logo, actions, hasNavigation = true }: Props) => { +export const MainHeader = async ({ + logo, + actions, + boardEditAction, + boardSettingsAction, + hasNavigation = true, +}: Props) => { const session = await auth(); const isAdmin = Boolean(session?.user.permissions.includes("admin")); const isDockerEnabled = isAdmin && env.ENABLE_DOCKER; @@ -22,6 +30,8 @@ export const MainHeader = async ({ logo, actions, hasNavigation = true }: Props) } actions={actions} + boardEditAction={boardEditAction} + boardSettingsAction={boardSettingsAction} hasNavigation={hasNavigation} avatar={} userId={session?.user.id ?? null} diff --git a/apps/nextjs/src/components/layout/header/configurable-header.module.css b/apps/nextjs/src/components/layout/header/configurable-header.module.css index a7668019b..9fd00d423 100644 --- a/apps/nextjs/src/components/layout/header/configurable-header.module.css +++ b/apps/nextjs/src/components/layout/header/configurable-header.module.css @@ -41,10 +41,13 @@ .logo { display: grid; place-items: center; + min-width: 0; + min-height: 0; width: auto; - height: calc(100% - 0.5rem); + height: calc(var(--app-shell-header-height) - 0.5rem); + max-height: calc(var(--app-shell-header-height) - 0.5rem); max-width: min(12rem, 28vw); - flex: 0 0 auto; + flex: 0 1 auto; overflow: hidden; border-radius: var(--mantine-radius-md); } @@ -52,8 +55,9 @@ .logo :global(img.logo) { display: block; width: auto; - height: 100%; + height: auto; max-width: 100%; + max-height: calc(var(--app-shell-header-height) - 0.5rem); object-fit: contain; } diff --git a/apps/nextjs/src/components/layout/header/configurable-header.tsx b/apps/nextjs/src/components/layout/header/configurable-header.tsx index 5a360fc00..807444e7c 100644 --- a/apps/nextjs/src/components/layout/header/configurable-header.tsx +++ b/apps/nextjs/src/components/layout/header/configurable-header.tsx @@ -47,6 +47,8 @@ import classes from "./configurable-header.module.css"; interface ConfigurableHeaderProps { logo: ReactNode; actions?: ReactNode; + boardEditAction?: ReactNode; + boardSettingsAction?: ReactNode; hasNavigation: boolean; avatar: ReactNode; userId: string | null; @@ -58,15 +60,15 @@ type HeaderBoard = RouterOutputs["board"]["getAllBoards"][number]; export const ConfigurableHeader = ({ logo, actions, + boardEditAction, + boardSettingsAction, hasNavigation, avatar, userId, isAdmin, isDockerEnabled, }: ConfigurableHeaderProps) => { - const { featureControls, headerPreferences } = useSettings(); - const assistantEnabled = featureControls.assistantEnabled; - const boardSwitcherEnabled = featureControls.boardSwitcherEnabled; + const { headerPreferences } = useSettings(); const assistant = useOptionalHomarrAssistant(); const { toggleColorScheme } = useMantineColorScheme(); const { openModal: openDockerModal } = useModalAction(DockerQuickAccessModal); @@ -80,7 +82,7 @@ export const ConfigurableHeader = ({ const boardsById = useMemo(() => new Map(boards.map((board) => [board.id, board])), [boards]); return ( - + {(boardSwitcher) => { const renderItems = (items: HeaderItem[]) => items.map((item) => ( @@ -88,12 +90,12 @@ export const ConfigurableHeader = ({ key={getHeaderItemKey(item)} item={item} logo={logo} + boardEditAction={boardEditAction} + boardSettingsAction={boardSettingsAction} avatar={avatar} userId={userId} isAdmin={isAdmin} isDockerEnabled={isDockerEnabled} - assistantEnabled={assistantEnabled} - boardSwitcherEnabled={boardSwitcherEnabled} board={item.type === "board" ? boardsById.get(item.boardId) : undefined} searchDisplay={headerPreferences.searchDisplay} boardSwitcher={boardSwitcher} @@ -151,12 +153,12 @@ export const ConfigurableHeader = ({ interface HeaderItemProps { item: HeaderItem; logo: ReactNode; + boardEditAction: ReactNode; + boardSettingsAction: ReactNode; avatar: ReactNode; userId: string | null; isAdmin: boolean; isDockerEnabled: boolean; - assistantEnabled: boolean; - boardSwitcherEnabled: boolean; board: HeaderBoard | undefined; searchDisplay: "input" | "icon"; boardSwitcher: BoardSwitcherControls; @@ -170,12 +172,12 @@ interface HeaderItemProps { const HeaderItem = ({ item, logo, + boardEditAction, + boardSettingsAction, avatar, userId, isAdmin, isDockerEnabled, - assistantEnabled, - boardSwitcherEnabled, board, searchDisplay, boardSwitcher, @@ -214,6 +216,9 @@ const HeaderItem = ({ ); } + if (item.id === "boardEdit") return boardEditAction; + if (item.id === "boardSettings") return boardSettingsAction; + if (item.id === "search") { return ( @@ -242,7 +247,6 @@ const HeaderItem = ({ } if (item.id === "boardSwitcher") { - if (!boardSwitcherEnabled) return null; return ( }> {t("homeBoard")} - {boardSwitcher.enabled ? ( - } - rightSection={{formatHotkeyLabel(boardSwitcher.hotkey, t("modifier"))}} - onClick={boardSwitcher.open} - onFocus={boardSwitcher.preload} - onPointerEnter={boardSwitcher.preload} - > - {tBoard("action.switch")} - - ) : null} + } + rightSection={{formatHotkeyLabel(boardSwitcher.hotkey, t("modifier"))}} + onClick={boardSwitcher.open} + onFocus={boardSwitcher.preload} + onPointerEnter={boardSwitcher.preload} + > + {tBoard("action.switch")} + diff --git a/packages/api/src/router/assistant.ts b/packages/api/src/router/assistant.ts index 211f43858..34f570abb 100644 --- a/packages/api/src/router/assistant.ts +++ b/packages/api/src/router/assistant.ts @@ -19,7 +19,6 @@ import { items, users, } from "@homarr/db/schema"; -import { getServerSettingByKeyAsync } from "@homarr/db/queries"; import { assistantProviderCanUseOpenRouterServerTools, assistantProviderIds, @@ -38,13 +37,6 @@ import { createTRPCRouter, isDemoMode, permissionRequiredProcedure, protectedPro import { boardRouter, getHomeIdBoardAsync } from "./board"; const adminProcedure = permissionRequiredProcedure.requiresPermission("admin"); -const assistantEnabledProcedure = protectedProcedure.use(async ({ ctx, next }) => { - const featureControls = await getServerSettingByKeyAsync(ctx.db, "featureControls"); - if (!featureControls.assistantEnabled) { - throw new TRPCError({ code: "NOT_FOUND", message: "Assistant is disabled." }); - } - return next({ ctx }); -}); const configurationId = "default"; const providerSchema = z.enum(assistantProviderIds); @@ -461,8 +453,6 @@ const addFeedbackToMessageContent = (serializedContent: string, type: "positive" export const assistantRouter = createTRPCRouter({ getAvailability: protectedProcedure.query(async ({ ctx }) => { - const featureControls = await getServerSettingByKeyAsync(ctx.db, "featureControls"); - if (!featureControls.assistantEnabled) return { enabled: false }; if (isDemoMode) { return { enabled: true }; } @@ -475,11 +465,11 @@ export const assistantRouter = createTRPCRouter({ }; }), - getContextEntities: assistantEnabledProcedure.query(async ({ ctx }) => { + getContextEntities: protectedProcedure.query(async ({ ctx }) => { return await getAssistantContextEntitiesAsync(ctx); }), - getModelCapabilities: assistantEnabledProcedure + getModelCapabilities: protectedProcedure .input(z.object({ modelId: z.string().trim().min(1).max(256).optional() }).optional()) .query(async ({ ctx, input }) => { const configuration = await getConfigurationAsync(ctx.db); @@ -496,7 +486,7 @@ export const assistantRouter = createTRPCRouter({ }; }), - getRuntimeOptions: assistantEnabledProcedure.query(async ({ ctx }) => { + getRuntimeOptions: protectedProcedure.query(async ({ ctx }) => { const configuration = await getConfigurationAsync(ctx.db); if (isDemoMode) { return { @@ -694,7 +684,7 @@ export const assistantRouter = createTRPCRouter({ }); }), - createThread: assistantEnabledProcedure + createThread: protectedProcedure .input(z.object({ localId: z.string().max(128).optional() }).optional()) .mutation(async ({ ctx }) => { const configuration = await getConfigurationAsync(ctx.db); @@ -710,7 +700,7 @@ export const assistantRouter = createTRPCRouter({ return { id }; }), - updateThreadModel: assistantEnabledProcedure + updateThreadModel: protectedProcedure .input(z.object({ threadId: z.string().max(64), modelId: z.string().trim().min(1).max(256) })) .mutation(async ({ ctx, input }) => { const [thread, configuration] = await Promise.all([ @@ -755,7 +745,7 @@ export const assistantRouter = createTRPCRouter({ }; }), - getGenerationTelemetry: assistantEnabledProcedure + getGenerationTelemetry: protectedProcedure .input( z.object({ threadId: z.string().max(64), @@ -801,7 +791,7 @@ export const assistantRouter = createTRPCRouter({ }; }), - renameThread: assistantEnabledProcedure + renameThread: protectedProcedure .input(z.object({ threadId: z.string().max(64), title: z.string().trim().min(1).max(120) })) .mutation(async ({ ctx, input }) => { await ownedThreadAsync(ctx.db, input.threadId, ctx.session.user.id); @@ -818,7 +808,7 @@ export const assistantRouter = createTRPCRouter({ await ctx.db.delete(assistantThreads).where(eq(assistantThreads.id, input.threadId)); }), - appendMessage: assistantEnabledProcedure + appendMessage: protectedProcedure .input( z.object({ threadId: z.string().max(64), @@ -879,7 +869,7 @@ export const assistantRouter = createTRPCRouter({ .where(eq(assistantThreads.id, thread.id)); }), - submitFeedback: assistantEnabledProcedure + submitFeedback: protectedProcedure .input( z.object({ threadId: z.string().max(64), diff --git a/packages/api/src/router/serverSettings.ts b/packages/api/src/router/serverSettings.ts index e9d7e8887..7e89bca61 100644 --- a/packages/api/src/router/serverSettings.ts +++ b/packages/api/src/router/serverSettings.ts @@ -14,9 +14,7 @@ import { authBrandingSchema, brandingServerSettingsSchema, defaultServerSettingsKeys, - featureControlsServerSettingsSchema, parseBrandingSettings, - parseFeatureControls, } from "@homarr/server-settings"; import { createTRPCRouter, permissionRequiredProcedure, publicProcedure } from "../trpc"; @@ -37,8 +35,6 @@ const legacyAuthBrandingUpdateSchema = z.object({ showCustomLogoOnLogin: z.boolean().optional(), showCustomGreetingOnLogin: z.boolean().optional(), }); -const featureControlsServerSettingsUpdateSchema = featureControlsServerSettingsSchema.partial(); - export const serverSettingsRouter = createTRPCRouter({ getCulture: publicProcedure.query(async ({ ctx }) => { return await getServerSettingByKeyAsync(ctx.db, "culture"); @@ -137,14 +133,6 @@ export const serverSettingsRouter = createTRPCRouter({ await updateServerSettingByKeyAsync(ctx.db, "branding", value); return; } - if (input.settingsKey === "featureControls") { - const current = await getServerSettingByKeyAsync(ctx.db, "featureControls"); - const parsedInput = featureControlsServerSettingsUpdateSchema.parse(input.value); - const value = parseFeatureControls({ ...current, ...parsedInput }); - await updateServerSettingByKeyAsync(ctx.db, "featureControls", value); - return; - } - const current = await getServerSettingByKeyAsync(ctx.db, input.settingsKey); await updateServerSettingByKeyAsync(ctx.db, input.settingsKey, { ...current, diff --git a/packages/db/migrations/mysql/0048_add_user_header_preferences.sql b/packages/db/migrations/mysql/0048_add_user_header_preferences.sql index 2f75893fa..b96a49e79 100644 --- a/packages/db/migrations/mysql/0048_add_user_header_preferences.sql +++ b/packages/db/migrations/mysql/0048_add_user_header_preferences.sql @@ -1 +1 @@ -ALTER TABLE `user` ADD `header_preferences` text DEFAULT ('{"version":3,"visible":true,"searchDisplay":"input","zones":{"left":[{"type":"builtin","id":"logo"}],"center":[{"type":"builtin","id":"search"}],"right":[{"type":"builtin","id":"user"}]}}') NOT NULL; +ALTER TABLE `user` ADD `header_preferences` text DEFAULT ('{"version":3,"visible":true,"searchDisplay":"input","zones":{"left":[{"type":"builtin","id":"logo"}],"center":[{"type":"builtin","id":"search"}],"right":[{"type":"builtin","id":"user"},{"type":"builtin","id":"boardEdit"},{"type":"builtin","id":"boardSettings"}]}}') NOT NULL; diff --git a/packages/db/migrations/mysql/0050_add_feature_controls_server_setting.sql b/packages/db/migrations/mysql/0050_add_feature_controls_server_setting.sql deleted file mode 100644 index 7c6b06cc6..000000000 --- a/packages/db/migrations/mysql/0050_add_feature_controls_server_setting.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT IGNORE INTO `serverSetting` (`setting_key`, `value`) -VALUES ('featureControls', '{"json":{"assistantEnabled":true,"boardSwitcherEnabled":true,"widgetContextMenuEnabled":true}}'); diff --git a/packages/db/migrations/mysql/meta/0048_snapshot.json b/packages/db/migrations/mysql/meta/0048_snapshot.json index 68fff4a67..2c00234cb 100644 --- a/packages/db/migrations/mysql/meta/0048_snapshot.json +++ b/packages/db/migrations/mysql/meta/0048_snapshot.json @@ -2656,7 +2656,7 @@ "primaryKey": false, "notNull": true, "autoincrement": false, - "default": "('{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}')" + "default": "('{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"},{\"type\":\"builtin\",\"id\":\"boardEdit\"},{\"type\":\"builtin\",\"id\":\"boardSettings\"}]}}')" }, "completed_manage_tour": { "name": "completed_manage_tour", diff --git a/packages/db/migrations/mysql/meta/0049_snapshot.json b/packages/db/migrations/mysql/meta/0049_snapshot.json index f31ebb2da..62566588b 100644 --- a/packages/db/migrations/mysql/meta/0049_snapshot.json +++ b/packages/db/migrations/mysql/meta/0049_snapshot.json @@ -2656,7 +2656,7 @@ "primaryKey": false, "notNull": true, "autoincrement": false, - "default": "('{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}')" + "default": "('{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"},{\"type\":\"builtin\",\"id\":\"boardEdit\"},{\"type\":\"builtin\",\"id\":\"boardSettings\"}]}}')" }, "completed_manage_tour": { "name": "completed_manage_tour", diff --git a/packages/db/migrations/mysql/meta/0050_snapshot.json b/packages/db/migrations/mysql/meta/0050_snapshot.json deleted file mode 100644 index 5ac53799d..000000000 --- a/packages/db/migrations/mysql/meta/0050_snapshot.json +++ /dev/null @@ -1,2817 +0,0 @@ -{ - "id": "c8fd5418-6557-4b21-b128-13566b147b85", - "prevId": "59e204ea-d000-45d4-9c54-b18a0f53b1a4", - "version": "5", - "dialect": "mysql", - "tables": { - "account": { - "name": "account", - "columns": { - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "expires_at": { - "name": "expires_at", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "userId_idx": { - "name": "userId_idx", - "columns": ["user_id"], - "isUnique": false - } - }, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": ["provider", "provider_account_id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "apiKey": { - "name": "apiKey", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "api_key": { - "name": "api_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "apiKey_user_id_user_id_fk": { - "name": "apiKey_user_id_user_id_fk", - "tableFrom": "apiKey", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "apiKey_id": { - "name": "apiKey_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "app": { - "name": "app", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "href": { - "name": "href", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ping_url": { - "name": "ping_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "app_id": { - "name": "app_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "assistant_configuration": { - "name": "assistant_configuration", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'default'" - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "web_search_enabled": { - "name": "web_search_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "provider": { - "name": "provider", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'openrouter'" - }, - "base_url": { - "name": "base_url", - "type": "varchar(2048)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'https://openrouter.ai/api/v1'" - }, - "model_discovery_path": { - "name": "model_discovery_path", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'/models'" - }, - "encrypted_api_key": { - "name": "encrypted_api_key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "encrypted_headers": { - "name": "encrypted_headers", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model_id": { - "name": "model_id", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "assistant_configuration_id": { - "name": "assistant_configuration_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "assistant_message": { - "name": "assistant_message", - "columns": { - "id": { - "name": "id", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "thread_id": { - "name": "thread_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "varchar(128)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "format": { - "name": "format", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'ai-sdk/v6'" - }, - "content": { - "name": "content", - "type": "mediumtext", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": { - "assistant_message__thread_id_created_at_idx": { - "name": "assistant_message__thread_id_created_at_idx", - "columns": ["thread_id", "created_at"], - "isUnique": false - } - }, - "foreignKeys": { - "assistant_message_thread_id_assistant_thread_id_fk": { - "name": "assistant_message_thread_id_assistant_thread_id_fk", - "tableFrom": "assistant_message", - "columnsFrom": ["thread_id"], - "tableTo": "assistant_thread", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "assistant_message_id": { - "name": "assistant_message_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "assistant_thread": { - "name": "assistant_thread", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model_id": { - "name": "model_id", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - } - }, - "indexes": { - "assistant_thread__user_id_updated_at_idx": { - "name": "assistant_thread__user_id_updated_at_idx", - "columns": ["user_id", "updated_at"], - "isUnique": false - } - }, - "foreignKeys": { - "assistant_thread_user_id_user_id_fk": { - "name": "assistant_thread_user_id_user_id_fk", - "tableFrom": "assistant_thread", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "assistant_thread_id": { - "name": "assistant_thread_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "boardGroupPermission": { - "name": "boardGroupPermission", - "columns": { - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "boardGroupPermission_board_id_board_id_fk": { - "name": "boardGroupPermission_board_id_board_id_fk", - "tableFrom": "boardGroupPermission", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "boardGroupPermission_group_id_group_id_fk": { - "name": "boardGroupPermission_group_id_group_id_fk", - "tableFrom": "boardGroupPermission", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "boardGroupPermission_board_id_group_id_permission_pk": { - "name": "boardGroupPermission_board_id_group_id_permission_pk", - "columns": ["board_id", "group_id", "permission"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "boardUserPermission": { - "name": "boardUserPermission", - "columns": { - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "boardUserPermission_board_id_board_id_fk": { - "name": "boardUserPermission_board_id_board_id_fk", - "tableFrom": "boardUserPermission", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "boardUserPermission_user_id_user_id_fk": { - "name": "boardUserPermission_user_id_user_id_fk", - "tableFrom": "boardUserPermission", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "boardUserPermission_board_id_user_id_permission_pk": { - "name": "boardUserPermission_board_id_user_id_permission_pk", - "columns": ["board_id", "user_id", "permission"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "board": { - "name": "board", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "page_title": { - "name": "page_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_title": { - "name": "meta_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "logo_image_url": { - "name": "logo_image_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "favicon_image_url": { - "name": "favicon_image_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "background_image_url": { - "name": "background_image_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "background_image_attachment": { - "name": "background_image_attachment", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('fixed')" - }, - "background_image_repeat": { - "name": "background_image_repeat", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('no-repeat')" - }, - "background_image_size": { - "name": "background_image_size", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('cover')" - }, - "primary_color": { - "name": "primary_color", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('#fa5252')" - }, - "secondary_color": { - "name": "secondary_color", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('#fd7e14')" - }, - "opacity": { - "name": "opacity", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 100 - }, - "custom_css": { - "name": "custom_css", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_color": { - "name": "icon_color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_radius": { - "name": "item_radius", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('lg')" - }, - "disable_status": { - "name": "disable_status", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "board_creator_id_user_id_fk": { - "name": "board_creator_id_user_id_fk", - "tableFrom": "board", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": { - "board_id": { - "name": "board_id", - "columns": ["id"] - } - }, - "uniqueConstraints": { - "board_name_unique": { - "name": "board_name_unique", - "columns": ["name"] - } - }, - "checkConstraint": {} - }, - "cron_job_configuration": { - "name": "cron_job_configuration", - "columns": { - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "cron_expression": { - "name": "cron_expression", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_enabled": { - "name": "is_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "cron_job_configuration_name": { - "name": "cron_job_configuration_name", - "columns": ["name"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "custom_widget_v2_definition": { - "name": "custom_widget_v2_definition", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sources": { - "name": "sources", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "requests": { - "name": "requests", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "template": { - "name": "template", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_v2_definition_creator_id_user_id_fk": { - "name": "custom_widget_v2_definition_creator_id_user_id_fk", - "tableFrom": "custom_widget_v2_definition", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": { - "custom_widget_v2_definition_id": { - "name": "custom_widget_v2_definition_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "custom_widget_v2_secret": { - "name": "custom_widget_v2_secret", - "columns": { - "source_id": { - "name": "source_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "encrypted_value": { - "name": "encrypted_value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "definition_id": { - "name": "definition_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_v2_secret_definition_id_fk": { - "name": "custom_widget_v2_secret_definition_id_fk", - "tableFrom": "custom_widget_v2_secret", - "columnsFrom": ["definition_id"], - "tableTo": "custom_widget_v2_definition", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "custom_widget_v2_secret_definition_id_source_id_kind_pk": { - "name": "custom_widget_v2_secret_definition_id_source_id_kind_pk", - "columns": ["definition_id", "source_id", "kind"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "groupMember": { - "name": "groupMember", - "columns": { - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "groupMember_group_id_group_id_fk": { - "name": "groupMember_group_id_group_id_fk", - "tableFrom": "groupMember", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "groupMember_user_id_user_id_fk": { - "name": "groupMember_user_id_user_id_fk", - "tableFrom": "groupMember", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "groupMember_group_id_user_id_pk": { - "name": "groupMember_group_id_user_id_pk", - "columns": ["group_id", "user_id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "groupPermission": { - "name": "groupPermission", - "columns": { - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "groupPermission_group_id_group_id_fk": { - "name": "groupPermission_group_id_group_id_fk", - "tableFrom": "groupPermission", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "group": { - "name": "group", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "owner_id": { - "name": "owner_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "home_board_id": { - "name": "home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mobile_home_board_id": { - "name": "mobile_home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "position": { - "name": "position", - "type": "smallint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "group_owner_id_user_id_fk": { - "name": "group_owner_id_user_id_fk", - "tableFrom": "group", - "columnsFrom": ["owner_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "group_home_board_id_board_id_fk": { - "name": "group_home_board_id_board_id_fk", - "tableFrom": "group", - "columnsFrom": ["home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "group_mobile_home_board_id_board_id_fk": { - "name": "group_mobile_home_board_id_board_id_fk", - "tableFrom": "group", - "columnsFrom": ["mobile_home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": { - "group_id": { - "name": "group_id", - "columns": ["id"] - } - }, - "uniqueConstraints": { - "group_name_unique": { - "name": "group_name_unique", - "columns": ["name"] - } - }, - "checkConstraint": {} - }, - "iconRepository": { - "name": "iconRepository", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "varchar(150)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "iconRepository_id": { - "name": "iconRepository_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "icon": { - "name": "icon", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(250)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "checksum": { - "name": "checksum", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "icon_repository_id": { - "name": "icon_repository_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "icon_icon_repository_id_iconRepository_id_fk": { - "name": "icon_icon_repository_id_iconRepository_id_fk", - "tableFrom": "icon", - "columnsFrom": ["icon_repository_id"], - "tableTo": "iconRepository", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "icon_id": { - "name": "icon_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "integrationGroupPermissions": { - "name": "integrationGroupPermissions", - "columns": { - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "integrationGroupPermissions_integration_id_integration_id_fk": { - "name": "integrationGroupPermissions_integration_id_integration_id_fk", - "tableFrom": "integrationGroupPermissions", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integrationGroupPermissions_group_id_group_id_fk": { - "name": "integrationGroupPermissions_group_id_group_id_fk", - "tableFrom": "integrationGroupPermissions", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integration_group_permission__pk": { - "name": "integration_group_permission__pk", - "columns": ["integration_id", "group_id", "permission"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "integration_item": { - "name": "integration_item", - "columns": { - "item_id": { - "name": "item_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "integration_item_item_id_item_id_fk": { - "name": "integration_item_item_id_item_id_fk", - "tableFrom": "integration_item", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integration_item_integration_id_integration_id_fk": { - "name": "integration_item_integration_id_integration_id_fk", - "tableFrom": "integration_item", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integration_item_item_id_integration_id_pk": { - "name": "integration_item_item_id_integration_id_pk", - "columns": ["item_id", "integration_id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "integrationSecret": { - "name": "integrationSecret", - "columns": { - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "integration_secret__kind_idx": { - "name": "integration_secret__kind_idx", - "columns": ["kind"], - "isUnique": false - }, - "integration_secret__updated_at_idx": { - "name": "integration_secret__updated_at_idx", - "columns": ["updated_at"], - "isUnique": false - } - }, - "foreignKeys": { - "integrationSecret_integration_id_integration_id_fk": { - "name": "integrationSecret_integration_id_integration_id_fk", - "tableFrom": "integrationSecret", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integrationSecret_integration_id_kind_pk": { - "name": "integrationSecret_integration_id_kind_pk", - "columns": ["integration_id", "kind"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "integrationUserPermission": { - "name": "integrationUserPermission", - "columns": { - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "integrationUserPermission_integration_id_integration_id_fk": { - "name": "integrationUserPermission_integration_id_integration_id_fk", - "tableFrom": "integrationUserPermission", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integrationUserPermission_user_id_user_id_fk": { - "name": "integrationUserPermission_user_id_user_id_fk", - "tableFrom": "integrationUserPermission", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integrationUserPermission_integration_id_user_id_permission_pk": { - "name": "integrationUserPermission_integration_id_user_id_permission_pk", - "columns": ["integration_id", "user_id", "permission"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "integration": { - "name": "integration", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "app_id": { - "name": "app_id", - "type": "varchar(128)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "integration__kind_idx": { - "name": "integration__kind_idx", - "columns": ["kind"], - "isUnique": false - } - }, - "foreignKeys": { - "integration_app_id_app_id_fk": { - "name": "integration_app_id_app_id_fk", - "tableFrom": "integration", - "columnsFrom": ["app_id"], - "tableTo": "app", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": { - "integration_id": { - "name": "integration_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "invite": { - "name": "invite", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "token": { - "name": "token", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "expiration_date": { - "name": "expiration_date", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "invite_creator_id_user_id_fk": { - "name": "invite_creator_id_user_id_fk", - "tableFrom": "invite", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "invite_id": { - "name": "invite_id", - "columns": ["id"] - } - }, - "uniqueConstraints": { - "invite_token_unique": { - "name": "invite_token_unique", - "columns": ["token"] - } - }, - "checkConstraint": {} - }, - "item_layout": { - "name": "item_layout", - "columns": { - "item_id": { - "name": "item_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "section_id": { - "name": "section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "layout_id": { - "name": "layout_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "x_offset": { - "name": "x_offset", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "y_offset": { - "name": "y_offset", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "width": { - "name": "width", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "height": { - "name": "height", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "item_layout_item_id_item_id_fk": { - "name": "item_layout_item_id_item_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "item_layout_section_id_section_id_fk": { - "name": "item_layout_section_id_section_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "item_layout_layout_id_layout_id_fk": { - "name": "item_layout_layout_id_layout_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["layout_id"], - "tableTo": "layout", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "item_layout_item_id_section_id_layout_id_pk": { - "name": "item_layout_item_id_section_id_layout_id_pk", - "columns": ["item_id", "section_id", "layout_id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "item": { - "name": "item", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('{\"json\": {}}')" - }, - "advanced_options": { - "name": "advanced_options", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('{\"json\": {}}')" - } - }, - "indexes": {}, - "foreignKeys": { - "item_board_id_board_id_fk": { - "name": "item_board_id_board_id_fk", - "tableFrom": "item", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "item_id": { - "name": "item_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "layout": { - "name": "layout", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "column_count": { - "name": "column_count", - "type": "tinyint", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "left_gutter_column_count": { - "name": "left_gutter_column_count", - "type": "tinyint", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "right_gutter_column_count": { - "name": "right_gutter_column_count", - "type": "tinyint", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "breakpoint": { - "name": "breakpoint", - "type": "smallint", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "role": { - "name": "role", - "type": "varchar(16)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'custom'" - } - }, - "indexes": {}, - "foreignKeys": { - "layout_board_id_board_id_fk": { - "name": "layout_board_id_board_id_fk", - "tableFrom": "layout", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "layout_id": { - "name": "layout_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "custom_widget_definition": { - "name": "custom_widget_definition", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "auth_type": { - "name": "auth_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'none'" - }, - "header_name": { - "name": "header_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "method": { - "name": "method", - "type": "varchar(16)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'GET'" - }, - "request_body": { - "name": "request_body", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "display_type": { - "name": "display_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'singleValue'" - }, - "display_config": { - "name": "display_config", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('{\"json\": {}}')" - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_definition_creator_id_user_id_fk": { - "name": "custom_widget_definition_creator_id_user_id_fk", - "tableFrom": "custom_widget_definition", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": { - "custom_widget_definition_id": { - "name": "custom_widget_definition_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "custom_widget_secret": { - "name": "custom_widget_secret", - "columns": { - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "definition_id": { - "name": "definition_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "cw_secret_definition_id_cw_definition_id_fk": { - "name": "cw_secret_definition_id_cw_definition_id_fk", - "tableFrom": "custom_widget_secret", - "columnsFrom": ["definition_id"], - "tableTo": "custom_widget_definition", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "custom_widget_secret_definition_id_kind_pk": { - "name": "custom_widget_secret_definition_id_kind_pk", - "columns": ["definition_id", "kind"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "media": { - "name": "media", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "LONGBLOB", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "size": { - "name": "size", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(now())" - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "media_creator_id_user_id_fk": { - "name": "media_creator_id_user_id_fk", - "tableFrom": "media", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": { - "media_id": { - "name": "media_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "onboarding": { - "name": "onboarding", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "step": { - "name": "step", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "previous_step": { - "name": "previous_step", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "onboarding_id": { - "name": "onboarding_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "search_engine": { - "name": "search_engine", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "short": { - "name": "short", - "type": "varchar(8)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url_template": { - "name": "url_template", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'generic'" - }, - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "search_engine_integration_id_integration_id_fk": { - "name": "search_engine_integration_id_integration_id_fk", - "tableFrom": "search_engine", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "search_engine_id": { - "name": "search_engine_id", - "columns": ["id"] - } - }, - "uniqueConstraints": { - "search_engine_short_unique": { - "name": "search_engine_short_unique", - "columns": ["short"] - } - }, - "checkConstraint": {} - }, - "section_collapse_state": { - "name": "section_collapse_state", - "columns": { - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "section_id": { - "name": "section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "collapsed": { - "name": "collapsed", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "section_collapse_state_user_id_user_id_fk": { - "name": "section_collapse_state_user_id_user_id_fk", - "tableFrom": "section_collapse_state", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_collapse_state_section_id_section_id_fk": { - "name": "section_collapse_state_section_id_section_id_fk", - "tableFrom": "section_collapse_state", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "section_collapse_state_user_id_section_id_pk": { - "name": "section_collapse_state_user_id_section_id_pk", - "columns": ["user_id", "section_id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "section_layout": { - "name": "section_layout", - "columns": { - "section_id": { - "name": "section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "layout_id": { - "name": "layout_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "parent_section_id": { - "name": "parent_section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "x_offset": { - "name": "x_offset", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "y_offset": { - "name": "y_offset", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "width": { - "name": "width", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "height": { - "name": "height", - "type": "int", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "section_layout_section_id_section_id_fk": { - "name": "section_layout_section_id_section_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_layout_layout_id_layout_id_fk": { - "name": "section_layout_layout_id_layout_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["layout_id"], - "tableTo": "layout", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_layout_parent_section_id_section_id_fk": { - "name": "section_layout_parent_section_id_section_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["parent_section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "section_layout_section_id_layout_id_pk": { - "name": "section_layout_section_id_layout_id_pk", - "columns": ["section_id", "layout_id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "section": { - "name": "section", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "x_offset": { - "name": "x_offset", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "y_offset": { - "name": "y_offset", - "type": "int", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "('{\"json\": {}}')" - } - }, - "indexes": {}, - "foreignKeys": { - "section_board_id_board_id_fk": { - "name": "section_board_id_board_id_fk", - "tableFrom": "section", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "section_id": { - "name": "section_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "serverSetting": { - "name": "serverSetting", - "columns": { - "setting_key": { - "name": "setting_key", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('{\"json\": {}}')" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "serverSetting_setting_key": { - "name": "serverSetting_setting_key", - "columns": ["setting_key"] - } - }, - "uniqueConstraints": { - "serverSetting_settingKey_unique": { - "name": "serverSetting_settingKey_unique", - "columns": ["setting_key"] - } - }, - "checkConstraint": {} - }, - "session": { - "name": "session", - "columns": { - "session_token": { - "name": "session_token", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_id_idx": { - "name": "user_id_idx", - "columns": ["user_id"], - "isUnique": false - } - }, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "session_session_token": { - "name": "session_session_token", - "columns": ["session_token"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "trusted_certificate_hostname": { - "name": "trusted_certificate_hostname", - "columns": { - "hostname": { - "name": "hostname", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "thumbprint": { - "name": "thumbprint", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "certificate": { - "name": "certificate", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "trusted_certificate_hostname_hostname_thumbprint_pk": { - "name": "trusted_certificate_hostname_hostname_thumbprint_pk", - "columns": ["hostname", "thumbprint"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'credentials'" - }, - "home_board_id": { - "name": "home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mobile_home_board_id": { - "name": "mobile_home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "default_search_engine_id": { - "name": "default_search_engine_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "open_search_in_new_tab": { - "name": "open_search_in_new_tab", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "ddg_bangs": { - "name": "ddg_bangs", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "color_scheme": { - "name": "color_scheme", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'dark'" - }, - "first_day_of_week": { - "name": "first_day_of_week", - "type": "tinyint", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 1 - }, - "ping_icons_enabled": { - "name": "ping_icons_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "enable_right_click_on_widgets": { - "name": "enable_right_click_on_widgets", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "header_preferences": { - "name": "header_preferences", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "('{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}')" - }, - "completed_manage_tour": { - "name": "completed_manage_tour", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "completed_board_tour": { - "name": "completed_board_tour", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_home_board_id_board_id_fk": { - "name": "user_home_board_id_board_id_fk", - "tableFrom": "user", - "columnsFrom": ["home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "user_mobile_home_board_id_board_id_fk": { - "name": "user_mobile_home_board_id_board_id_fk", - "tableFrom": "user", - "columnsFrom": ["mobile_home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "user_default_search_engine_id_search_engine_id_fk": { - "name": "user_default_search_engine_id_search_engine_id_fk", - "tableFrom": "user", - "columnsFrom": ["default_search_engine_id"], - "tableTo": "search_engine", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": { - "user_id": { - "name": "user_id", - "columns": ["id"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "verificationToken": { - "name": "verificationToken", - "columns": { - "identifier": { - "name": "identifier", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "token": { - "name": "token", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": ["identifier", "token"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - }, - "widget_secret": { - "name": "widget_secret", - "columns": { - "item_id": { - "name": "item_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "widget_secret_item_id_item_id_fk": { - "name": "widget_secret_item_id_item_id_fk", - "tableFrom": "widget_secret", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "widget_secret_item_id_kind_pk": { - "name": "widget_secret_item_id_kind_pk", - "columns": ["item_id", "kind"] - } - }, - "uniqueConstraints": {}, - "checkConstraint": {} - } - }, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - }, - "internal": { - "tables": {}, - "indexes": {} - } -} diff --git a/packages/db/migrations/mysql/meta/_journal.json b/packages/db/migrations/mysql/meta/_journal.json index 7d948e5cd..d4b5c455d 100644 --- a/packages/db/migrations/mysql/meta/_journal.json +++ b/packages/db/migrations/mysql/meta/_journal.json @@ -351,13 +351,6 @@ "when": 1787496053718, "tag": "0049_add_server_branding_settings", "breakpoints": true - }, - { - "idx": 50, - "version": "5", - "when": 1787496060001, - "tag": "0050_add_feature_controls_server_setting", - "breakpoints": true } ] } diff --git a/packages/db/migrations/postgresql/0014_add_user_header_preferences.sql b/packages/db/migrations/postgresql/0014_add_user_header_preferences.sql index d279e40b4..6f755e082 100644 --- a/packages/db/migrations/postgresql/0014_add_user_header_preferences.sql +++ b/packages/db/migrations/postgresql/0014_add_user_header_preferences.sql @@ -1 +1 @@ -ALTER TABLE "user" ADD COLUMN "header_preferences" text DEFAULT '{"version":3,"visible":true,"searchDisplay":"input","zones":{"left":[{"type":"builtin","id":"logo"}],"center":[{"type":"builtin","id":"search"}],"right":[{"type":"builtin","id":"user"}]}}' NOT NULL; +ALTER TABLE "user" ADD COLUMN "header_preferences" text DEFAULT '{"version":3,"visible":true,"searchDisplay":"input","zones":{"left":[{"type":"builtin","id":"logo"}],"center":[{"type":"builtin","id":"search"}],"right":[{"type":"builtin","id":"user"},{"type":"builtin","id":"boardEdit"},{"type":"builtin","id":"boardSettings"}]}}' NOT NULL; diff --git a/packages/db/migrations/postgresql/0016_add_feature_controls_server_setting.sql b/packages/db/migrations/postgresql/0016_add_feature_controls_server_setting.sql deleted file mode 100644 index f10457b5f..000000000 --- a/packages/db/migrations/postgresql/0016_add_feature_controls_server_setting.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO "serverSetting" ("setting_key", "value") -VALUES ('featureControls', '{"json":{"assistantEnabled":true,"boardSwitcherEnabled":true,"widgetContextMenuEnabled":true}}') -ON CONFLICT ("setting_key") DO NOTHING; diff --git a/packages/db/migrations/postgresql/meta/0014_snapshot.json b/packages/db/migrations/postgresql/meta/0014_snapshot.json index 92322c63d..a8dec36fa 100644 --- a/packages/db/migrations/postgresql/meta/0014_snapshot.json +++ b/packages/db/migrations/postgresql/meta/0014_snapshot.json @@ -2521,7 +2521,7 @@ "type": "text", "primaryKey": false, "notNull": true, - "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}'" + "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"},{\"type\":\"builtin\",\"id\":\"boardEdit\"},{\"type\":\"builtin\",\"id\":\"boardSettings\"}]}}'" }, "completed_manage_tour": { "name": "completed_manage_tour", diff --git a/packages/db/migrations/postgresql/meta/0015_snapshot.json b/packages/db/migrations/postgresql/meta/0015_snapshot.json index 2c14ecbd2..613a5ab85 100644 --- a/packages/db/migrations/postgresql/meta/0015_snapshot.json +++ b/packages/db/migrations/postgresql/meta/0015_snapshot.json @@ -2521,7 +2521,7 @@ "type": "text", "primaryKey": false, "notNull": true, - "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}'" + "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"},{\"type\":\"builtin\",\"id\":\"boardEdit\"},{\"type\":\"builtin\",\"id\":\"boardSettings\"}]}}'" }, "completed_manage_tour": { "name": "completed_manage_tour", diff --git a/packages/db/migrations/postgresql/meta/0016_snapshot.json b/packages/db/migrations/postgresql/meta/0016_snapshot.json deleted file mode 100644 index 5da4bfdea..000000000 --- a/packages/db/migrations/postgresql/meta/0016_snapshot.json +++ /dev/null @@ -1,2677 +0,0 @@ -{ - "id": "96fcce34-9a74-4771-b99f-0693a1d7c3ea", - "prevId": "3e6b9b8e-d628-496d-bc0a-99ef6c82cf30", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.account": { - "name": "account", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "userId_idx": { - "name": "userId_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "name": "account_provider_provider_account_id_pk", - "columns": ["provider", "provider_account_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.apiKey": { - "name": "apiKey", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "api_key": { - "name": "api_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "apiKey_user_id_user_id_fk": { - "name": "apiKey_user_id_user_id_fk", - "tableFrom": "apiKey", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.app": { - "name": "app", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "href": { - "name": "href", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ping_url": { - "name": "ping_url", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.assistant_configuration": { - "name": "assistant_configuration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true, - "default": "'default'" - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "web_search_enabled": { - "name": "web_search_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "provider": { - "name": "provider", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "default": "'openrouter'" - }, - "base_url": { - "name": "base_url", - "type": "varchar(2048)", - "primaryKey": false, - "notNull": true, - "default": "'https://openrouter.ai/api/v1'" - }, - "model_discovery_path": { - "name": "model_discovery_path", - "type": "varchar(512)", - "primaryKey": false, - "notNull": false, - "default": "'/models'" - }, - "encrypted_api_key": { - "name": "encrypted_api_key", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "encrypted_headers": { - "name": "encrypted_headers", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "model_id": { - "name": "model_id", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.assistant_message": { - "name": "assistant_message", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(128)", - "primaryKey": true, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "parent_id": { - "name": "parent_id", - "type": "varchar(128)", - "primaryKey": false, - "notNull": false - }, - "format": { - "name": "format", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "default": "'ai-sdk/v6'" - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "assistant_message__thread_id_created_at_idx": { - "name": "assistant_message__thread_id_created_at_idx", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "assistant_message_thread_id_assistant_thread_id_fk": { - "name": "assistant_message_thread_id_assistant_thread_id_fk", - "tableFrom": "assistant_message", - "columnsFrom": ["thread_id"], - "tableTo": "assistant_thread", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.assistant_thread": { - "name": "assistant_thread", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "title": { - "name": "title", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false - }, - "model_id": { - "name": "model_id", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - } - }, - "indexes": { - "assistant_thread__user_id_updated_at_idx": { - "name": "assistant_thread__user_id_updated_at_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "assistant_thread_user_id_user_id_fk": { - "name": "assistant_thread_user_id_user_id_fk", - "tableFrom": "assistant_thread", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.boardGroupPermission": { - "name": "boardGroupPermission", - "schema": "", - "columns": { - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "boardGroupPermission_board_id_board_id_fk": { - "name": "boardGroupPermission_board_id_board_id_fk", - "tableFrom": "boardGroupPermission", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "boardGroupPermission_group_id_group_id_fk": { - "name": "boardGroupPermission_group_id_group_id_fk", - "tableFrom": "boardGroupPermission", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "boardGroupPermission_board_id_group_id_permission_pk": { - "name": "boardGroupPermission_board_id_group_id_permission_pk", - "columns": ["board_id", "group_id", "permission"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.boardUserPermission": { - "name": "boardUserPermission", - "schema": "", - "columns": { - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "boardUserPermission_board_id_board_id_fk": { - "name": "boardUserPermission_board_id_board_id_fk", - "tableFrom": "boardUserPermission", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "boardUserPermission_user_id_user_id_fk": { - "name": "boardUserPermission_user_id_user_id_fk", - "tableFrom": "boardUserPermission", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "boardUserPermission_board_id_user_id_permission_pk": { - "name": "boardUserPermission_board_id_user_id_permission_pk", - "columns": ["board_id", "user_id", "permission"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.board": { - "name": "board", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true - }, - "is_public": { - "name": "is_public", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "page_title": { - "name": "page_title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "meta_title": { - "name": "meta_title", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "logo_image_url": { - "name": "logo_image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "favicon_image_url": { - "name": "favicon_image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "background_image_url": { - "name": "background_image_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "background_image_attachment": { - "name": "background_image_attachment", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'fixed'" - }, - "background_image_repeat": { - "name": "background_image_repeat", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'no-repeat'" - }, - "background_image_size": { - "name": "background_image_size", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'cover'" - }, - "primary_color": { - "name": "primary_color", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'#fa5252'" - }, - "secondary_color": { - "name": "secondary_color", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'#fd7e14'" - }, - "opacity": { - "name": "opacity", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 100 - }, - "custom_css": { - "name": "custom_css", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon_color": { - "name": "icon_color", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "item_radius": { - "name": "item_radius", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'lg'" - }, - "disable_status": { - "name": "disable_status", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "board_creator_id_user_id_fk": { - "name": "board_creator_id_user_id_fk", - "tableFrom": "board", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "board_name_unique": { - "name": "board_name_unique", - "columns": ["name"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.cron_job_configuration": { - "name": "cron_job_configuration", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": true, - "notNull": true - }, - "cron_expression": { - "name": "cron_expression", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true - }, - "is_enabled": { - "name": "is_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.custom_widget_v2_definition": { - "name": "custom_widget_v2_definition", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "sources": { - "name": "sources", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "requests": { - "name": "requests", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "template": { - "name": "template", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_v2_definition_creator_id_user_id_fk": { - "name": "custom_widget_v2_definition_creator_id_user_id_fk", - "tableFrom": "custom_widget_v2_definition", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.custom_widget_v2_secret": { - "name": "custom_widget_v2_secret", - "schema": "", - "columns": { - "source_id": { - "name": "source_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "encrypted_value": { - "name": "encrypted_value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "definition_id": { - "name": "definition_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_v2_secret_definition_id_fk": { - "name": "custom_widget_v2_secret_definition_id_fk", - "tableFrom": "custom_widget_v2_secret", - "columnsFrom": ["definition_id"], - "tableTo": "custom_widget_v2_definition", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "custom_widget_v2_secret_definition_id_source_id_kind_pk": { - "name": "custom_widget_v2_secret_definition_id_source_id_kind_pk", - "columns": ["definition_id", "source_id", "kind"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.groupMember": { - "name": "groupMember", - "schema": "", - "columns": { - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "groupMember_group_id_group_id_fk": { - "name": "groupMember_group_id_group_id_fk", - "tableFrom": "groupMember", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "groupMember_user_id_user_id_fk": { - "name": "groupMember_user_id_user_id_fk", - "tableFrom": "groupMember", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "groupMember_group_id_user_id_pk": { - "name": "groupMember_group_id_user_id_pk", - "columns": ["group_id", "user_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.groupPermission": { - "name": "groupPermission", - "schema": "", - "columns": { - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "groupPermission_group_id_group_id_fk": { - "name": "groupPermission_group_id_group_id_fk", - "tableFrom": "groupPermission", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.group": { - "name": "group", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "owner_id": { - "name": "owner_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "home_board_id": { - "name": "home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "mobile_home_board_id": { - "name": "mobile_home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "position": { - "name": "position", - "type": "smallint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "group_owner_id_user_id_fk": { - "name": "group_owner_id_user_id_fk", - "tableFrom": "group", - "columnsFrom": ["owner_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "group_home_board_id_board_id_fk": { - "name": "group_home_board_id_board_id_fk", - "tableFrom": "group", - "columnsFrom": ["home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "group_mobile_home_board_id_board_id_fk": { - "name": "group_mobile_home_board_id_board_id_fk", - "tableFrom": "group", - "columnsFrom": ["mobile_home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "group_name_unique": { - "name": "group_name_unique", - "columns": ["name"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.iconRepository": { - "name": "iconRepository", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "slug": { - "name": "slug", - "type": "varchar(150)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.icon": { - "name": "icon", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(250)", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "checksum": { - "name": "checksum", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "icon_repository_id": { - "name": "icon_repository_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "icon_icon_repository_id_iconRepository_id_fk": { - "name": "icon_icon_repository_id_iconRepository_id_fk", - "tableFrom": "icon", - "columnsFrom": ["icon_repository_id"], - "tableTo": "iconRepository", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integrationGroupPermissions": { - "name": "integrationGroupPermissions", - "schema": "", - "columns": { - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "group_id": { - "name": "group_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "integrationGroupPermissions_integration_id_integration_id_fk": { - "name": "integrationGroupPermissions_integration_id_integration_id_fk", - "tableFrom": "integrationGroupPermissions", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integrationGroupPermissions_group_id_group_id_fk": { - "name": "integrationGroupPermissions_group_id_group_id_fk", - "tableFrom": "integrationGroupPermissions", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integration_group_permission__pk": { - "name": "integration_group_permission__pk", - "columns": ["integration_id", "group_id", "permission"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration_item": { - "name": "integration_item", - "schema": "", - "columns": { - "item_id": { - "name": "item_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "integration_item_item_id_item_id_fk": { - "name": "integration_item_item_id_item_id_fk", - "tableFrom": "integration_item", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integration_item_integration_id_integration_id_fk": { - "name": "integration_item_integration_id_integration_id_fk", - "tableFrom": "integration_item", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integration_item_item_id_integration_id_pk": { - "name": "integration_item_item_id_integration_id_pk", - "columns": ["item_id", "integration_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integrationSecret": { - "name": "integrationSecret", - "schema": "", - "columns": { - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "integration_secret__kind_idx": { - "name": "integration_secret__kind_idx", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - }, - "integration_secret__updated_at_idx": { - "name": "integration_secret__updated_at_idx", - "columns": [ - { - "expression": "updated_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "integrationSecret_integration_id_integration_id_fk": { - "name": "integrationSecret_integration_id_integration_id_fk", - "tableFrom": "integrationSecret", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integrationSecret_integration_id_kind_pk": { - "name": "integrationSecret_integration_id_kind_pk", - "columns": ["integration_id", "kind"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integrationUserPermission": { - "name": "integrationUserPermission", - "schema": "", - "columns": { - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "permission": { - "name": "permission", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "integrationUserPermission_integration_id_integration_id_fk": { - "name": "integrationUserPermission_integration_id_integration_id_fk", - "tableFrom": "integrationUserPermission", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integrationUserPermission_user_id_user_id_fk": { - "name": "integrationUserPermission_user_id_user_id_fk", - "tableFrom": "integrationUserPermission", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integrationUserPermission_integration_id_user_id_permission_pk": { - "name": "integrationUserPermission_integration_id_user_id_permission_pk", - "columns": ["integration_id", "user_id", "permission"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.integration": { - "name": "integration", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true - }, - "app_id": { - "name": "app_id", - "type": "varchar(128)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "integration__kind_idx": { - "name": "integration__kind_idx", - "columns": [ - { - "expression": "kind", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "integration_app_id_app_id_fk": { - "name": "integration_app_id_app_id_fk", - "tableFrom": "integration", - "columnsFrom": ["app_id"], - "tableTo": "app", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.invite": { - "name": "invite", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "token": { - "name": "token", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true - }, - "expiration_date": { - "name": "expiration_date", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "invite_creator_id_user_id_fk": { - "name": "invite_creator_id_user_id_fk", - "tableFrom": "invite", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "invite_token_unique": { - "name": "invite_token_unique", - "columns": ["token"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.item_layout": { - "name": "item_layout", - "schema": "", - "columns": { - "item_id": { - "name": "item_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "section_id": { - "name": "section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "layout_id": { - "name": "layout_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "x_offset": { - "name": "x_offset", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "y_offset": { - "name": "y_offset", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "width": { - "name": "width", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "height": { - "name": "height", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "item_layout_item_id_item_id_fk": { - "name": "item_layout_item_id_item_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "item_layout_section_id_section_id_fk": { - "name": "item_layout_section_id_section_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "item_layout_layout_id_layout_id_fk": { - "name": "item_layout_layout_id_layout_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["layout_id"], - "tableTo": "layout", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "item_layout_item_id_section_id_layout_id_pk": { - "name": "item_layout_item_id_section_id_layout_id_pk", - "columns": ["item_id", "section_id", "layout_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.item": { - "name": "item", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'{\"json\": {}}'" - }, - "advanced_options": { - "name": "advanced_options", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'{\"json\": {}}'" - } - }, - "indexes": {}, - "foreignKeys": { - "item_board_id_board_id_fk": { - "name": "item_board_id_board_id_fk", - "tableFrom": "item", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.layout": { - "name": "layout", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "column_count": { - "name": "column_count", - "type": "smallint", - "primaryKey": false, - "notNull": true - }, - "left_gutter_column_count": { - "name": "left_gutter_column_count", - "type": "smallint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "right_gutter_column_count": { - "name": "right_gutter_column_count", - "type": "smallint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "breakpoint": { - "name": "breakpoint", - "type": "smallint", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "role": { - "name": "role", - "type": "varchar(16)", - "primaryKey": false, - "notNull": true, - "default": "'custom'" - } - }, - "indexes": {}, - "foreignKeys": { - "layout_board_id_board_id_fk": { - "name": "layout_board_id_board_id_fk", - "tableFrom": "layout", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.custom_widget_definition": { - "name": "custom_widget_definition", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "auth_type": { - "name": "auth_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "default": "'none'" - }, - "header_name": { - "name": "header_name", - "type": "varchar(256)", - "primaryKey": false, - "notNull": false - }, - "method": { - "name": "method", - "type": "varchar(16)", - "primaryKey": false, - "notNull": true, - "default": "'GET'" - }, - "request_body": { - "name": "request_body", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "display_type": { - "name": "display_type", - "type": "varchar(32)", - "primaryKey": false, - "notNull": true, - "default": "'singleValue'" - }, - "display_config": { - "name": "display_config", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'{\"json\": {}}'" - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_definition_creator_id_user_id_fk": { - "name": "custom_widget_definition_creator_id_user_id_fk", - "tableFrom": "custom_widget_definition", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.custom_widget_secret": { - "name": "custom_widget_secret", - "schema": "", - "columns": { - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "definition_id": { - "name": "definition_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_secret_definition_id_custom_widget_definition_id_fk": { - "name": "custom_widget_secret_definition_id_custom_widget_definition_id_fk", - "tableFrom": "custom_widget_secret", - "columnsFrom": ["definition_id"], - "tableTo": "custom_widget_definition", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "custom_widget_secret_definition_id_kind_pk": { - "name": "custom_widget_secret_definition_id_kind_pk", - "columns": ["definition_id", "kind"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.media": { - "name": "media", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true - }, - "content": { - "name": "content", - "type": "bytea", - "primaryKey": false, - "notNull": true - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "creator_id": { - "name": "creator_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "media_creator_id_user_id_fk": { - "name": "media_creator_id_user_id_fk", - "tableFrom": "media", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.onboarding": { - "name": "onboarding", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "step": { - "name": "step", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "previous_step": { - "name": "previous_step", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.search_engine": { - "name": "search_engine", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "name": { - "name": "name", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "short": { - "name": "short", - "type": "varchar(8)", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "url_template": { - "name": "url_template", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "default": "'generic'" - }, - "integration_id": { - "name": "integration_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": { - "search_engine_integration_id_integration_id_fk": { - "name": "search_engine_integration_id_integration_id_fk", - "tableFrom": "search_engine", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "search_engine_short_unique": { - "name": "search_engine_short_unique", - "columns": ["short"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.section_collapse_state": { - "name": "section_collapse_state", - "schema": "", - "columns": { - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "section_id": { - "name": "section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "collapsed": { - "name": "collapsed", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "section_collapse_state_user_id_user_id_fk": { - "name": "section_collapse_state_user_id_user_id_fk", - "tableFrom": "section_collapse_state", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_collapse_state_section_id_section_id_fk": { - "name": "section_collapse_state_section_id_section_id_fk", - "tableFrom": "section_collapse_state", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "section_collapse_state_user_id_section_id_pk": { - "name": "section_collapse_state_user_id_section_id_pk", - "columns": ["user_id", "section_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.section_layout": { - "name": "section_layout", - "schema": "", - "columns": { - "section_id": { - "name": "section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "layout_id": { - "name": "layout_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "parent_section_id": { - "name": "parent_section_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "x_offset": { - "name": "x_offset", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "y_offset": { - "name": "y_offset", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "width": { - "name": "width", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "height": { - "name": "height", - "type": "integer", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "section_layout_section_id_section_id_fk": { - "name": "section_layout_section_id_section_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_layout_layout_id_layout_id_fk": { - "name": "section_layout_layout_id_layout_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["layout_id"], - "tableTo": "layout", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_layout_parent_section_id_section_id_fk": { - "name": "section_layout_parent_section_id_section_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["parent_section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "section_layout_section_id_layout_id_pk": { - "name": "section_layout_section_id_layout_id_pk", - "columns": ["section_id", "layout_id"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.section": { - "name": "section", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "board_id": { - "name": "board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "x_offset": { - "name": "x_offset", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "y_offset": { - "name": "y_offset", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": false, - "default": "'{\"json\": {}}'" - } - }, - "indexes": {}, - "foreignKeys": { - "section_board_id_board_id_fk": { - "name": "section_board_id_board_id_fk", - "tableFrom": "section", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.serverSetting": { - "name": "serverSetting", - "schema": "", - "columns": { - "setting_key": { - "name": "setting_key", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'{\"json\": {}}'" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "serverSetting_settingKey_unique": { - "name": "serverSetting_settingKey_unique", - "columns": ["setting_key"], - "nullsNotDistinct": false - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.session": { - "name": "session", - "schema": "", - "columns": { - "session_token": { - "name": "session_token", - "type": "varchar(512)", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "user_id_idx": { - "name": "user_id_idx", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "with": {}, - "method": "btree", - "concurrently": false - } - }, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.trusted_certificate_hostname": { - "name": "trusted_certificate_hostname", - "schema": "", - "columns": { - "hostname": { - "name": "hostname", - "type": "varchar(256)", - "primaryKey": false, - "notNull": true - }, - "thumbprint": { - "name": "thumbprint", - "type": "varchar(128)", - "primaryKey": false, - "notNull": true - }, - "certificate": { - "name": "certificate", - "type": "text", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "trusted_certificate_hostname_hostname_thumbprint_pk": { - "name": "trusted_certificate_hostname_hostname_thumbprint_pk", - "columns": ["hostname", "thumbprint"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.user": { - "name": "user", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "varchar(64)", - "primaryKey": true, - "notNull": true - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "email_verified": { - "name": "email_verified", - "type": "timestamp", - "primaryKey": false, - "notNull": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "provider": { - "name": "provider", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true, - "default": "'credentials'" - }, - "home_board_id": { - "name": "home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "mobile_home_board_id": { - "name": "mobile_home_board_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "default_search_engine_id": { - "name": "default_search_engine_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": false - }, - "open_search_in_new_tab": { - "name": "open_search_in_new_tab", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "ddg_bangs": { - "name": "ddg_bangs", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "color_scheme": { - "name": "color_scheme", - "type": "varchar(5)", - "primaryKey": false, - "notNull": true, - "default": "'dark'" - }, - "first_day_of_week": { - "name": "first_day_of_week", - "type": "smallint", - "primaryKey": false, - "notNull": true, - "default": 1 - }, - "ping_icons_enabled": { - "name": "ping_icons_enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "enable_right_click_on_widgets": { - "name": "enable_right_click_on_widgets", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "header_preferences": { - "name": "header_preferences", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}'" - }, - "completed_manage_tour": { - "name": "completed_manage_tour", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - }, - "completed_board_tour": { - "name": "completed_board_tour", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_home_board_id_board_id_fk": { - "name": "user_home_board_id_board_id_fk", - "tableFrom": "user", - "columnsFrom": ["home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "user_mobile_home_board_id_board_id_fk": { - "name": "user_mobile_home_board_id_board_id_fk", - "tableFrom": "user", - "columnsFrom": ["mobile_home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "user_default_search_engine_id_search_engine_id_fk": { - "name": "user_default_search_engine_id_search_engine_id_fk", - "tableFrom": "user", - "columnsFrom": ["default_search_engine_id"], - "tableTo": "search_engine", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.verificationToken": { - "name": "verificationToken", - "schema": "", - "columns": { - "identifier": { - "name": "identifier", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "token": { - "name": "token", - "type": "varchar(512)", - "primaryKey": false, - "notNull": true - }, - "expires": { - "name": "expires", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "name": "verificationToken_identifier_token_pk", - "columns": ["identifier", "token"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.widget_secret": { - "name": "widget_secret", - "schema": "", - "columns": { - "item_id": { - "name": "item_id", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "kind": { - "name": "kind", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": { - "widget_secret_item_id_item_id_fk": { - "name": "widget_secret_item_id_item_id_fk", - "tableFrom": "widget_secret", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "widget_secret_item_id_kind_pk": { - "name": "widget_secret_item_id_kind_pk", - "columns": ["item_id", "kind"] - } - }, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "views": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} diff --git a/packages/db/migrations/postgresql/meta/_journal.json b/packages/db/migrations/postgresql/meta/_journal.json index 8d4dd80c4..42474bb13 100644 --- a/packages/db/migrations/postgresql/meta/_journal.json +++ b/packages/db/migrations/postgresql/meta/_journal.json @@ -113,13 +113,6 @@ "when": 1787496053659, "tag": "0015_add_server_branding_settings", "breakpoints": true - }, - { - "idx": 16, - "version": "7", - "when": 1787496060002, - "tag": "0016_add_feature_controls_server_setting", - "breakpoints": true } ] } diff --git a/packages/db/migrations/sqlite/0046_add_user_header_preferences.sql b/packages/db/migrations/sqlite/0046_add_user_header_preferences.sql index 222e5d20c..243ceac11 100644 --- a/packages/db/migrations/sqlite/0046_add_user_header_preferences.sql +++ b/packages/db/migrations/sqlite/0046_add_user_header_preferences.sql @@ -1 +1 @@ -ALTER TABLE `user` ADD `header_preferences` text DEFAULT '{"version":3,"visible":true,"searchDisplay":"input","zones":{"left":[{"type":"builtin","id":"logo"}],"center":[{"type":"builtin","id":"search"}],"right":[{"type":"builtin","id":"user"}]}}' NOT NULL; +ALTER TABLE `user` ADD `header_preferences` text DEFAULT '{"version":3,"visible":true,"searchDisplay":"input","zones":{"left":[{"type":"builtin","id":"logo"}],"center":[{"type":"builtin","id":"search"}],"right":[{"type":"builtin","id":"user"},{"type":"builtin","id":"boardEdit"},{"type":"builtin","id":"boardSettings"}]}}' NOT NULL; diff --git a/packages/db/migrations/sqlite/0048_add_feature_controls_server_setting.sql b/packages/db/migrations/sqlite/0048_add_feature_controls_server_setting.sql deleted file mode 100644 index 68bf7af4f..000000000 --- a/packages/db/migrations/sqlite/0048_add_feature_controls_server_setting.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO `serverSetting` (`setting_key`, `value`) -VALUES ('featureControls', '{"json":{"assistantEnabled":true,"boardSwitcherEnabled":true,"widgetContextMenuEnabled":true}}') -ON CONFLICT (`setting_key`) DO NOTHING; diff --git a/packages/db/migrations/sqlite/meta/0046_snapshot.json b/packages/db/migrations/sqlite/meta/0046_snapshot.json index a2665ff54..3c60a7b18 100644 --- a/packages/db/migrations/sqlite/meta/0046_snapshot.json +++ b/packages/db/migrations/sqlite/meta/0046_snapshot.json @@ -2551,7 +2551,7 @@ "primaryKey": false, "notNull": true, "autoincrement": false, - "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}'" + "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"},{\"type\":\"builtin\",\"id\":\"boardEdit\"},{\"type\":\"builtin\",\"id\":\"boardSettings\"}]}}'" }, "completed_manage_tour": { "name": "completed_manage_tour", diff --git a/packages/db/migrations/sqlite/meta/0047_snapshot.json b/packages/db/migrations/sqlite/meta/0047_snapshot.json index 9a48117e5..ad39e66ca 100644 --- a/packages/db/migrations/sqlite/meta/0047_snapshot.json +++ b/packages/db/migrations/sqlite/meta/0047_snapshot.json @@ -2551,7 +2551,7 @@ "primaryKey": false, "notNull": true, "autoincrement": false, - "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}'" + "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"},{\"type\":\"builtin\",\"id\":\"boardEdit\"},{\"type\":\"builtin\",\"id\":\"boardSettings\"}]}}'" }, "completed_manage_tour": { "name": "completed_manage_tour", diff --git a/packages/db/migrations/sqlite/meta/0048_snapshot.json b/packages/db/migrations/sqlite/meta/0048_snapshot.json deleted file mode 100644 index 0d316c33a..000000000 --- a/packages/db/migrations/sqlite/meta/0048_snapshot.json +++ /dev/null @@ -1,2707 +0,0 @@ -{ - "id": "6459e855-6ae4-4c5c-8e65-a013d731de44", - "prevId": "7ed5db74-d195-4e56-be00-f93bb43f32ea", - "version": "6", - "dialect": "sqlite", - "tables": { - "account": { - "name": "account", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "provider_account_id": { - "name": "provider_account_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "refresh_token": { - "name": "refresh_token", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "access_token": { - "name": "access_token", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "expires_at": { - "name": "expires_at", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "token_type": { - "name": "token_type", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "scope": { - "name": "scope", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "id_token": { - "name": "id_token", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "session_state": { - "name": "session_state", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "userId_idx": { - "name": "userId_idx", - "columns": ["user_id"], - "isUnique": false - } - }, - "foreignKeys": { - "account_user_id_user_id_fk": { - "name": "account_user_id_user_id_fk", - "tableFrom": "account", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "account_provider_provider_account_id_pk": { - "columns": ["provider", "provider_account_id"], - "name": "account_provider_provider_account_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "apiKey": { - "name": "apiKey", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "api_key": { - "name": "api_key", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "apiKey_user_id_user_id_fk": { - "name": "apiKey_user_id_user_id_fk", - "tableFrom": "apiKey", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "app": { - "name": "app", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "href": { - "name": "href", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "ping_url": { - "name": "ping_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "assistant_configuration": { - "name": "assistant_configuration", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false, - "default": "'default'" - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "web_search_enabled": { - "name": "web_search_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'openrouter'" - }, - "base_url": { - "name": "base_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'https://openrouter.ai/api/v1'" - }, - "model_discovery_path": { - "name": "model_discovery_path", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'/models'" - }, - "encrypted_api_key": { - "name": "encrypted_api_key", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "encrypted_headers": { - "name": "encrypted_headers", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model_id": { - "name": "model_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "assistant_message": { - "name": "assistant_message", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "parent_id": { - "name": "parent_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "format": { - "name": "format", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'ai-sdk/v6'" - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - } - }, - "indexes": { - "assistant_message__thread_id_created_at_idx": { - "name": "assistant_message__thread_id_created_at_idx", - "columns": ["thread_id", "created_at"], - "isUnique": false - } - }, - "foreignKeys": { - "assistant_message_thread_id_assistant_thread_id_fk": { - "name": "assistant_message_thread_id_assistant_thread_id_fk", - "tableFrom": "assistant_message", - "columnsFrom": ["thread_id"], - "tableTo": "assistant_thread", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "assistant_thread": { - "name": "assistant_thread", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "title": { - "name": "title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "model_id": { - "name": "model_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - } - }, - "indexes": { - "assistant_thread__user_id_updated_at_idx": { - "name": "assistant_thread__user_id_updated_at_idx", - "columns": ["user_id", "updated_at"], - "isUnique": false - } - }, - "foreignKeys": { - "assistant_thread_user_id_user_id_fk": { - "name": "assistant_thread_user_id_user_id_fk", - "tableFrom": "assistant_thread", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "boardGroupPermission": { - "name": "boardGroupPermission", - "columns": { - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "boardGroupPermission_board_id_board_id_fk": { - "name": "boardGroupPermission_board_id_board_id_fk", - "tableFrom": "boardGroupPermission", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "boardGroupPermission_group_id_group_id_fk": { - "name": "boardGroupPermission_group_id_group_id_fk", - "tableFrom": "boardGroupPermission", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "boardGroupPermission_board_id_group_id_permission_pk": { - "columns": ["board_id", "group_id", "permission"], - "name": "boardGroupPermission_board_id_group_id_permission_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "boardUserPermission": { - "name": "boardUserPermission", - "columns": { - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "boardUserPermission_board_id_board_id_fk": { - "name": "boardUserPermission_board_id_board_id_fk", - "tableFrom": "boardUserPermission", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "boardUserPermission_user_id_user_id_fk": { - "name": "boardUserPermission_user_id_user_id_fk", - "tableFrom": "boardUserPermission", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "boardUserPermission_board_id_user_id_permission_pk": { - "columns": ["board_id", "user_id", "permission"], - "name": "boardUserPermission_board_id_user_id_permission_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "board": { - "name": "board", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_public": { - "name": "is_public", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "creator_id": { - "name": "creator_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "page_title": { - "name": "page_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "meta_title": { - "name": "meta_title", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "logo_image_url": { - "name": "logo_image_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "favicon_image_url": { - "name": "favicon_image_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "background_image_url": { - "name": "background_image_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "background_image_attachment": { - "name": "background_image_attachment", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'fixed'" - }, - "background_image_repeat": { - "name": "background_image_repeat", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'no-repeat'" - }, - "background_image_size": { - "name": "background_image_size", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'cover'" - }, - "primary_color": { - "name": "primary_color", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'#fa5252'" - }, - "secondary_color": { - "name": "secondary_color", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'#fd7e14'" - }, - "opacity": { - "name": "opacity", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 100 - }, - "custom_css": { - "name": "custom_css", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_color": { - "name": "icon_color", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "item_radius": { - "name": "item_radius", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'lg'" - }, - "disable_status": { - "name": "disable_status", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": { - "board_name_unique": { - "name": "board_name_unique", - "columns": ["name"], - "isUnique": true - } - }, - "foreignKeys": { - "board_creator_id_user_id_fk": { - "name": "board_creator_id_user_id_fk", - "tableFrom": "board", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "cron_job_configuration": { - "name": "cron_job_configuration", - "columns": { - "name": { - "name": "name", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "cron_expression": { - "name": "cron_expression", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "is_enabled": { - "name": "is_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "custom_widget_v2_definition": { - "name": "custom_widget_v2_definition", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "sources": { - "name": "sources", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "requests": { - "name": "requests", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "template": { - "name": "template", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - }, - "creator_id": { - "name": "creator_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_v2_definition_creator_id_user_id_fk": { - "name": "custom_widget_v2_definition_creator_id_user_id_fk", - "tableFrom": "custom_widget_v2_definition", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "custom_widget_v2_secret": { - "name": "custom_widget_v2_secret", - "columns": { - "source_id": { - "name": "source_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "encrypted_value": { - "name": "encrypted_value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "definition_id": { - "name": "definition_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_v2_secret_definition_id_fk": { - "name": "custom_widget_v2_secret_definition_id_fk", - "tableFrom": "custom_widget_v2_secret", - "columnsFrom": ["definition_id"], - "tableTo": "custom_widget_v2_definition", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "custom_widget_v2_secret_definition_id_source_id_kind_pk": { - "columns": ["definition_id", "source_id", "kind"], - "name": "custom_widget_v2_secret_definition_id_source_id_kind_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "groupMember": { - "name": "groupMember", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "groupMember_group_id_group_id_fk": { - "name": "groupMember_group_id_group_id_fk", - "tableFrom": "groupMember", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "groupMember_user_id_user_id_fk": { - "name": "groupMember_user_id_user_id_fk", - "tableFrom": "groupMember", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "groupMember_group_id_user_id_pk": { - "columns": ["group_id", "user_id"], - "name": "groupMember_group_id_user_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "groupPermission": { - "name": "groupPermission", - "columns": { - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "groupPermission_group_id_group_id_fk": { - "name": "groupPermission_group_id_group_id_fk", - "tableFrom": "groupPermission", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "group": { - "name": "group", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "owner_id": { - "name": "owner_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "home_board_id": { - "name": "home_board_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mobile_home_board_id": { - "name": "mobile_home_board_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "position": { - "name": "position", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "group_name_unique": { - "name": "group_name_unique", - "columns": ["name"], - "isUnique": true - } - }, - "foreignKeys": { - "group_owner_id_user_id_fk": { - "name": "group_owner_id_user_id_fk", - "tableFrom": "group", - "columnsFrom": ["owner_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "group_home_board_id_board_id_fk": { - "name": "group_home_board_id_board_id_fk", - "tableFrom": "group", - "columnsFrom": ["home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "group_mobile_home_board_id_board_id_fk": { - "name": "group_mobile_home_board_id_board_id_fk", - "tableFrom": "group", - "columnsFrom": ["mobile_home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "iconRepository": { - "name": "iconRepository", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "slug": { - "name": "slug", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "icon": { - "name": "icon", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "checksum": { - "name": "checksum", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "icon_repository_id": { - "name": "icon_repository_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "icon_icon_repository_id_iconRepository_id_fk": { - "name": "icon_icon_repository_id_iconRepository_id_fk", - "tableFrom": "icon", - "columnsFrom": ["icon_repository_id"], - "tableTo": "iconRepository", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "integrationGroupPermissions": { - "name": "integrationGroupPermissions", - "columns": { - "integration_id": { - "name": "integration_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "group_id": { - "name": "group_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "integrationGroupPermissions_integration_id_integration_id_fk": { - "name": "integrationGroupPermissions_integration_id_integration_id_fk", - "tableFrom": "integrationGroupPermissions", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integrationGroupPermissions_group_id_group_id_fk": { - "name": "integrationGroupPermissions_group_id_group_id_fk", - "tableFrom": "integrationGroupPermissions", - "columnsFrom": ["group_id"], - "tableTo": "group", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integrationGroupPermissions_integration_id_group_id_permission_pk": { - "columns": ["integration_id", "group_id", "permission"], - "name": "integrationGroupPermissions_integration_id_group_id_permission_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "integration_item": { - "name": "integration_item", - "columns": { - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "integration_id": { - "name": "integration_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "integration_item_item_id_item_id_fk": { - "name": "integration_item_item_id_item_id_fk", - "tableFrom": "integration_item", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integration_item_integration_id_integration_id_fk": { - "name": "integration_item_integration_id_integration_id_fk", - "tableFrom": "integration_item", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integration_item_item_id_integration_id_pk": { - "columns": ["item_id", "integration_id"], - "name": "integration_item_item_id_integration_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "integrationSecret": { - "name": "integrationSecret", - "columns": { - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "integration_id": { - "name": "integration_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "integration_secret__kind_idx": { - "name": "integration_secret__kind_idx", - "columns": ["kind"], - "isUnique": false - }, - "integration_secret__updated_at_idx": { - "name": "integration_secret__updated_at_idx", - "columns": ["updated_at"], - "isUnique": false - } - }, - "foreignKeys": { - "integrationSecret_integration_id_integration_id_fk": { - "name": "integrationSecret_integration_id_integration_id_fk", - "tableFrom": "integrationSecret", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integrationSecret_integration_id_kind_pk": { - "columns": ["integration_id", "kind"], - "name": "integrationSecret_integration_id_kind_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "integrationUserPermission": { - "name": "integrationUserPermission", - "columns": { - "integration_id": { - "name": "integration_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "permission": { - "name": "permission", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "integrationUserPermission_integration_id_integration_id_fk": { - "name": "integrationUserPermission_integration_id_integration_id_fk", - "tableFrom": "integrationUserPermission", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "integrationUserPermission_user_id_user_id_fk": { - "name": "integrationUserPermission_user_id_user_id_fk", - "tableFrom": "integrationUserPermission", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "integrationUserPermission_integration_id_user_id_permission_pk": { - "columns": ["integration_id", "user_id", "permission"], - "name": "integrationUserPermission_integration_id_user_id_permission_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "integration": { - "name": "integration", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "app_id": { - "name": "app_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "integration__kind_idx": { - "name": "integration__kind_idx", - "columns": ["kind"], - "isUnique": false - } - }, - "foreignKeys": { - "integration_app_id_app_id_fk": { - "name": "integration_app_id_app_id_fk", - "tableFrom": "integration", - "columnsFrom": ["app_id"], - "tableTo": "app", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "invite": { - "name": "invite", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "expiration_date": { - "name": "expiration_date", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "creator_id": { - "name": "creator_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "invite_token_unique": { - "name": "invite_token_unique", - "columns": ["token"], - "isUnique": true - } - }, - "foreignKeys": { - "invite_creator_id_user_id_fk": { - "name": "invite_creator_id_user_id_fk", - "tableFrom": "invite", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "item_layout": { - "name": "item_layout", - "columns": { - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "section_id": { - "name": "section_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "layout_id": { - "name": "layout_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "x_offset": { - "name": "x_offset", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "y_offset": { - "name": "y_offset", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "width": { - "name": "width", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "height": { - "name": "height", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "item_layout_item_id_item_id_fk": { - "name": "item_layout_item_id_item_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "item_layout_section_id_section_id_fk": { - "name": "item_layout_section_id_section_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "item_layout_layout_id_layout_id_fk": { - "name": "item_layout_layout_id_layout_id_fk", - "tableFrom": "item_layout", - "columnsFrom": ["layout_id"], - "tableTo": "layout", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "item_layout_item_id_section_id_layout_id_pk": { - "columns": ["item_id", "section_id", "layout_id"], - "name": "item_layout_item_id_section_id_layout_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "item": { - "name": "item", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'{\"json\": {}}'" - }, - "advanced_options": { - "name": "advanced_options", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'{\"json\": {}}'" - } - }, - "indexes": {}, - "foreignKeys": { - "item_board_id_board_id_fk": { - "name": "item_board_id_board_id_fk", - "tableFrom": "item", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "layout": { - "name": "layout", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "column_count": { - "name": "column_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "left_gutter_column_count": { - "name": "left_gutter_column_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "right_gutter_column_count": { - "name": "right_gutter_column_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "breakpoint": { - "name": "breakpoint", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 0 - }, - "role": { - "name": "role", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'custom'" - } - }, - "indexes": {}, - "foreignKeys": { - "layout_board_id_board_id_fk": { - "name": "layout_board_id_board_id_fk", - "tableFrom": "layout", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "custom_widget_definition": { - "name": "custom_widget_definition", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url": { - "name": "url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "auth_type": { - "name": "auth_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'none'" - }, - "header_name": { - "name": "header_name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "method": { - "name": "method", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'GET'" - }, - "request_body": { - "name": "request_body", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "display_type": { - "name": "display_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'singleValue'" - }, - "display_config": { - "name": "display_config", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'{\"json\": {}}'" - }, - "enabled": { - "name": "enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - }, - "creator_id": { - "name": "creator_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_definition_creator_id_user_id_fk": { - "name": "custom_widget_definition_creator_id_user_id_fk", - "tableFrom": "custom_widget_definition", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "custom_widget_secret": { - "name": "custom_widget_secret", - "columns": { - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "definition_id": { - "name": "definition_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "custom_widget_secret_definition_id_custom_widget_definition_id_fk": { - "name": "custom_widget_secret_definition_id_custom_widget_definition_id_fk", - "tableFrom": "custom_widget_secret", - "columnsFrom": ["definition_id"], - "tableTo": "custom_widget_definition", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "custom_widget_secret_definition_id_kind_pk": { - "columns": ["definition_id", "kind"], - "name": "custom_widget_secret_definition_id_kind_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "media": { - "name": "media", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content": { - "name": "content", - "type": "blob", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "content_type": { - "name": "content_type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "created_at": { - "name": "created_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "(unixepoch())" - }, - "creator_id": { - "name": "creator_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "media_creator_id_user_id_fk": { - "name": "media_creator_id_user_id_fk", - "tableFrom": "media", - "columnsFrom": ["creator_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "onboarding": { - "name": "onboarding", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "step": { - "name": "step", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "previous_step": { - "name": "previous_step", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "search_engine": { - "name": "search_engine", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "icon_url": { - "name": "icon_url", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "short": { - "name": "short", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "description": { - "name": "description", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "url_template": { - "name": "url_template", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'generic'" - }, - "integration_id": { - "name": "integration_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - } - }, - "indexes": { - "search_engine_short_unique": { - "name": "search_engine_short_unique", - "columns": ["short"], - "isUnique": true - } - }, - "foreignKeys": { - "search_engine_integration_id_integration_id_fk": { - "name": "search_engine_integration_id_integration_id_fk", - "tableFrom": "search_engine", - "columnsFrom": ["integration_id"], - "tableTo": "integration", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "section_collapse_state": { - "name": "section_collapse_state", - "columns": { - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "section_id": { - "name": "section_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "collapsed": { - "name": "collapsed", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "section_collapse_state_user_id_user_id_fk": { - "name": "section_collapse_state_user_id_user_id_fk", - "tableFrom": "section_collapse_state", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_collapse_state_section_id_section_id_fk": { - "name": "section_collapse_state_section_id_section_id_fk", - "tableFrom": "section_collapse_state", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "section_collapse_state_user_id_section_id_pk": { - "columns": ["user_id", "section_id"], - "name": "section_collapse_state_user_id_section_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "section_layout": { - "name": "section_layout", - "columns": { - "section_id": { - "name": "section_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "layout_id": { - "name": "layout_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "parent_section_id": { - "name": "parent_section_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "x_offset": { - "name": "x_offset", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "y_offset": { - "name": "y_offset", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "width": { - "name": "width", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "height": { - "name": "height", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "section_layout_section_id_section_id_fk": { - "name": "section_layout_section_id_section_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_layout_layout_id_layout_id_fk": { - "name": "section_layout_layout_id_layout_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["layout_id"], - "tableTo": "layout", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - }, - "section_layout_parent_section_id_section_id_fk": { - "name": "section_layout_parent_section_id_section_id_fk", - "tableFrom": "section_layout", - "columnsFrom": ["parent_section_id"], - "tableTo": "section", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "section_layout_section_id_layout_id_pk": { - "columns": ["section_id", "layout_id"], - "name": "section_layout_section_id_layout_id_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "section": { - "name": "section", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "board_id": { - "name": "board_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "x_offset": { - "name": "x_offset", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "y_offset": { - "name": "y_offset", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "options": { - "name": "options", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false, - "default": "'{\"json\": {}}'" - } - }, - "indexes": {}, - "foreignKeys": { - "section_board_id_board_id_fk": { - "name": "section_board_id_board_id_fk", - "tableFrom": "section", - "columnsFrom": ["board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "serverSetting": { - "name": "serverSetting", - "columns": { - "setting_key": { - "name": "setting_key", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'{\"json\": {}}'" - } - }, - "indexes": { - "serverSetting_settingKey_unique": { - "name": "serverSetting_settingKey_unique", - "columns": ["setting_key"], - "isUnique": true - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "session": { - "name": "session", - "columns": { - "session_token": { - "name": "session_token", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "expires": { - "name": "expires", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": { - "user_id_idx": { - "name": "user_id_idx", - "columns": ["user_id"], - "isUnique": false - } - }, - "foreignKeys": { - "session_user_id_user_id_fk": { - "name": "session_user_id_user_id_fk", - "tableFrom": "session", - "columnsFrom": ["user_id"], - "tableTo": "user", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "trusted_certificate_hostname": { - "name": "trusted_certificate_hostname", - "columns": { - "hostname": { - "name": "hostname", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "thumbprint": { - "name": "thumbprint", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "certificate": { - "name": "certificate", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "trusted_certificate_hostname_hostname_thumbprint_pk": { - "columns": ["hostname", "thumbprint"], - "name": "trusted_certificate_hostname_hostname_thumbprint_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "user": { - "name": "user", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true, - "autoincrement": false - }, - "name": { - "name": "name", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email": { - "name": "email", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "email_verified": { - "name": "email_verified", - "type": "integer", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "image": { - "name": "image", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "password": { - "name": "password", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "provider": { - "name": "provider", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'credentials'" - }, - "home_board_id": { - "name": "home_board_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "mobile_home_board_id": { - "name": "mobile_home_board_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "default_search_engine_id": { - "name": "default_search_engine_id", - "type": "text", - "primaryKey": false, - "notNull": false, - "autoincrement": false - }, - "open_search_in_new_tab": { - "name": "open_search_in_new_tab", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "ddg_bangs": { - "name": "ddg_bangs", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "color_scheme": { - "name": "color_scheme", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'dark'" - }, - "first_day_of_week": { - "name": "first_day_of_week", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": 1 - }, - "ping_icons_enabled": { - "name": "ping_icons_enabled", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "enable_right_click_on_widgets": { - "name": "enable_right_click_on_widgets", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": true - }, - "header_preferences": { - "name": "header_preferences", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": "'{\"version\":3,\"visible\":true,\"searchDisplay\":\"input\",\"zones\":{\"left\":[{\"type\":\"builtin\",\"id\":\"logo\"}],\"center\":[{\"type\":\"builtin\",\"id\":\"search\"}],\"right\":[{\"type\":\"builtin\",\"id\":\"user\"}]}}'" - }, - "completed_manage_tour": { - "name": "completed_manage_tour", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - }, - "completed_board_tour": { - "name": "completed_board_tour", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false, - "default": false - } - }, - "indexes": {}, - "foreignKeys": { - "user_home_board_id_board_id_fk": { - "name": "user_home_board_id_board_id_fk", - "tableFrom": "user", - "columnsFrom": ["home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "user_mobile_home_board_id_board_id_fk": { - "name": "user_mobile_home_board_id_board_id_fk", - "tableFrom": "user", - "columnsFrom": ["mobile_home_board_id"], - "tableTo": "board", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - }, - "user_default_search_engine_id_search_engine_id_fk": { - "name": "user_default_search_engine_id_search_engine_id_fk", - "tableFrom": "user", - "columnsFrom": ["default_search_engine_id"], - "tableTo": "search_engine", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "set null" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "verificationToken": { - "name": "verificationToken", - "columns": { - "identifier": { - "name": "identifier", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "token": { - "name": "token", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "expires": { - "name": "expires", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": { - "verificationToken_identifier_token_pk": { - "columns": ["identifier", "token"], - "name": "verificationToken_identifier_token_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - }, - "widget_secret": { - "name": "widget_secret", - "columns": { - "item_id": { - "name": "item_id", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "kind": { - "name": "kind", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true, - "autoincrement": false - }, - "updated_at": { - "name": "updated_at", - "type": "integer", - "primaryKey": false, - "notNull": true, - "autoincrement": false - } - }, - "indexes": {}, - "foreignKeys": { - "widget_secret_item_id_item_id_fk": { - "name": "widget_secret_item_id_item_id_fk", - "tableFrom": "widget_secret", - "columnsFrom": ["item_id"], - "tableTo": "item", - "columnsTo": ["id"], - "onUpdate": "no action", - "onDelete": "cascade" - } - }, - "compositePrimaryKeys": { - "widget_secret_item_id_kind_pk": { - "columns": ["item_id", "kind"], - "name": "widget_secret_item_id_kind_pk" - } - }, - "uniqueConstraints": {}, - "checkConstraints": {} - } - }, - "views": {}, - "enums": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - }, - "internal": { - "indexes": {} - } -} diff --git a/packages/db/migrations/sqlite/meta/_journal.json b/packages/db/migrations/sqlite/meta/_journal.json index 466eddb44..a1e292bfc 100644 --- a/packages/db/migrations/sqlite/meta/_journal.json +++ b/packages/db/migrations/sqlite/meta/_journal.json @@ -337,13 +337,6 @@ "when": 1787496053654, "tag": "0047_add_server_branding_settings", "breakpoints": true - }, - { - "idx": 48, - "version": "6", - "when": 1787496060000, - "tag": "0048_add_feature_controls_server_setting", - "breakpoints": true } ] } diff --git a/packages/db/queries/server-setting.ts b/packages/db/queries/server-setting.ts index 684edd3cd..33e30f078 100644 --- a/packages/db/queries/server-setting.ts +++ b/packages/db/queries/server-setting.ts @@ -1,12 +1,7 @@ import SuperJSON from "superjson"; import type { ServerSettings } from "@homarr/server-settings"; -import { - defaultServerSettings, - defaultServerSettingsKeys, - parseBrandingSettings, - parseFeatureControls, -} from "@homarr/server-settings"; +import { defaultServerSettings, defaultServerSettingsKeys, parseBrandingSettings } from "@homarr/server-settings"; import type { Database } from ".."; import { eq } from ".."; @@ -28,11 +23,6 @@ export const getServerSettingsAsync = async (db: Database) => { acc[settingKey] = parseBrandingSettings(parsedSetting) as never; return acc; } - if (settingKey === "featureControls") { - acc[settingKey] = parseFeatureControls(parsedSetting) as never; - return acc; - } - acc[settingKey] = { ...defaultServerSettings[settingKey], ...parsedSetting, @@ -54,10 +44,6 @@ export const getServerSettingByKeyAsync = async { @@ -272,6 +274,7 @@ export const IconPicker = ({ (query.data ? tCommon("iconPicker.header", { countIcons: String(query.data.countIcons) }) : tCommon("iconPicker.headerLoading")); + const inputDescription = description === undefined ? tCommon("iconPicker.description") : description; return ( ; - const brandingImageUrlSchema = z .string() .trim() @@ -81,12 +73,6 @@ export const defaultBrandingSettings: BrandingSettings = { defaultRadius: "md", }; -export const defaultFeatureControls: FeatureControlsSettings = { - assistantEnabled: true, - boardSwitcherEnabled: true, - widgetContextMenuEnabled: true, -}; - const legacyLoginBrandingSchema = z.object({ showCustomAppNameOnLogin: z.boolean().optional(), showCustomLogoOnLogin: z.boolean().optional(), @@ -122,16 +108,6 @@ export const parseBrandingSettings = (value: unknown): BrandingSettings => { return result.data; }; -export const parseFeatureControls = (value: unknown) => { - const partialValue = z.record(z.string(), z.unknown()).safeParse(value); - if (!partialValue.success) return defaultFeatureControls; - - const result = featureControlsServerSettingsSchema.safeParse({ ...defaultFeatureControls, ...partialValue.data }); - if (!result.success) return defaultFeatureControls; - - return result.data; -}; - export const defaultServerSettings = { analytics: { enableGeneral: true, @@ -156,7 +132,6 @@ export const defaultServerSettings = { defaultColorScheme: "auto" as ColorScheme, }, branding: defaultBrandingSettings, - featureControls: defaultFeatureControls, culture: { defaultLocale: "en" as SupportedLanguage, }, diff --git a/packages/settings/src/creator.ts b/packages/settings/src/creator.ts index 508eb9faf..7991c91db 100644 --- a/packages/settings/src/creator.ts +++ b/packages/settings/src/creator.ts @@ -24,7 +24,6 @@ export type SettingsContextProps = Omit< > & Pick & { branding: ServerSettings["branding"]; - featureControls: ServerSettings["featureControls"]; }; export interface PublicServerSettings { @@ -35,7 +34,6 @@ export interface PublicServerSettings { >; user: Pick; branding: ServerSettings["branding"]; - featureControls: ServerSettings["featureControls"]; } export type UserSettings = Pick< @@ -71,5 +69,4 @@ export const createSettings = ({ forceDisableStatus: serverSettings.board.forceDisableStatus, enableGravatar: serverSettings.user.enableGravatar, branding: parseBrandingSettings(serverSettings.branding), - featureControls: serverSettings.featureControls, }); diff --git a/packages/translation/src/lang/en.json b/packages/translation/src/lang/en.json index 8b9f8873e..dcc0e4dad 100644 --- a/packages/translation/src/lang/en.json +++ b/packages/translation/src/lang/en.json @@ -5689,7 +5689,7 @@ "header": { "title": "Header studio", "badge": "Personal", - "description": "Drag each control across the fixed Left, Center, and Right dividers. Click a control to configure it.", + "description": "This is one continuous row. Drag controls anywhere; Left, Center, and Right are fixed dividers and never move.", "device": { "desktop": "Desktop", "mobile": "Mobile" @@ -5704,7 +5704,7 @@ "show": "Show the header", "configure": "Move or configure {item}", "remove": "Remove {item}", - "dropAtEnd": "Drop at the end of the {zone} zone" + "dropIntoZone": "Move into the {zone} section" }, "preview": { "board": "Dashboard preview for {name}", @@ -5713,7 +5713,7 @@ "available": { "title": "Available controls", "description": "Add a control, then drag its full button into position above.", - "accountAlways": "Account access always remains available", + "requiredAlways": "This control is required, but you can move it anywhere in the header.", "allAdded": "Every built-in control is already in your header.", "add": "Add {item}", "boardShortcut": "Board shortcut", @@ -5733,6 +5733,8 @@ "boardSwitcher": "Boards", "assistant": "Assistant", "docker": "Docker", + "boardEdit": "Edit board", + "boardSettings": "Board settings", "settings": "Your settings", "themeToggle": "Toggle theme", "user": "Account", @@ -6011,21 +6013,6 @@ "off": "Off" } }, - "featureControls": { - "title": "Feature controls", - "assistant": { - "label": "Assistant", - "description": "Show and allow the instance Assistant." - }, - "boardSwitcher": { - "label": "Board switcher", - "description": "Allow board switching from the header, account menu, and keyboard shortcut." - }, - "widgetContextMenu": { - "label": "Widget context menu", - "description": "Allow widget actions from the context menu." - } - }, "culture": { "title": "Culture", "defaultLocale": { @@ -7625,7 +7612,6 @@ }, "unavailable": { "checking": "Checking whether the assistant is available…", - "disabledByServer": "An administrator has disabled Assistant for this server.", "error": "The assistant's availability could not be checked. Try again.", "notConfigured": "An administrator must configure and enable the assistant first.", "signIn": "Sign in to use Assistant." diff --git a/packages/validation/src/header-preferences.ts b/packages/validation/src/header-preferences.ts index 438b224ee..36807960e 100644 --- a/packages/validation/src/header-preferences.ts +++ b/packages/validation/src/header-preferences.ts @@ -9,11 +9,15 @@ export const headerBuiltinItemIds = [ "boardSwitcher", "assistant", "docker", + "boardEdit", + "boardSettings", "settings", "themeToggle", "user", ] as const; +export const requiredHeaderBuiltinItemIds = ["boardEdit", "boardSettings", "user"] as const; + export const headerPreferenceItemIds = headerBuiltinItemIds; export const headerItemIds = headerBuiltinItemIds; @@ -52,6 +56,9 @@ export const createBuiltinHeaderItem = (id: HeaderBuiltinItemId): HeaderBuiltinI export const createBoardHeaderItem = (boardId: string): HeaderBoardItem => ({ type: "board", boardId }); +export const isRequiredHeaderItem = (item: HeaderItem) => + item.type === "builtin" && requiredHeaderBuiltinItemIds.some((itemId) => itemId === item.id); + export const getHeaderItemKey = (item: HeaderItem): string => { if (item.type === "board") return `board:${item.boardId}`; return `builtin:${item.id}`; @@ -165,6 +172,22 @@ const migrateLegacyHeaderPreferencesV1 = ( const migrateLegacyHeaderPreferencesV2 = (legacy: z.infer): HeaderPreferences => migrateLegacyItems(legacy.visible, legacy.zones); +const includeRequiredHeaderItems = (preferences: HeaderPreferences): HeaderPreferences => { + const itemKeys = new Set(getHeaderItems(preferences.zones).map(getHeaderItemKey)); + const missingItems = requiredHeaderBuiltinItemIds + .map(createBuiltinHeaderItem) + .filter((item) => !itemKeys.has(getHeaderItemKey(item))); + if (missingItems.length === 0) return preferences; + + return { + ...preferences, + zones: { + ...preferences.zones, + right: [...preferences.zones.right, ...missingItems], + }, + }; +}; + export const headerPreferencesMutationSchema = z .discriminatedUnion("version", [ headerPreferencesSchema, @@ -172,9 +195,9 @@ export const headerPreferencesMutationSchema = z legacyHeaderPreferencesV2Schema, ]) .transform((preferences): HeaderPreferences => { - if (preferences.version === 1) return migrateLegacyHeaderPreferencesV1(preferences); - if (preferences.version === 2) return migrateLegacyHeaderPreferencesV2(preferences); - return preferences; + if (preferences.version === 1) return includeRequiredHeaderItems(migrateLegacyHeaderPreferencesV1(preferences)); + if (preferences.version === 2) return includeRequiredHeaderItems(migrateLegacyHeaderPreferencesV2(preferences)); + return includeRequiredHeaderItems(preferences); }); export const defaultHeaderPreferences = { @@ -184,7 +207,11 @@ export const defaultHeaderPreferences = { zones: { left: [createBuiltinHeaderItem("logo")], center: [createBuiltinHeaderItem("search")], - right: [createBuiltinHeaderItem("user")], + right: [ + createBuiltinHeaderItem("user"), + createBuiltinHeaderItem("boardEdit"), + createBuiltinHeaderItem("boardSettings"), + ], }, } satisfies HeaderPreferences; @@ -201,4 +228,5 @@ export const parseHeaderPreferences = (value: unknown): HeaderPreferences => { } }; -export const serializeHeaderPreferences = (value: HeaderPreferences) => JSON.stringify(value); +export const serializeHeaderPreferences = (value: HeaderPreferences) => + JSON.stringify(includeRequiredHeaderItems(value)); diff --git a/packages/validation/src/user.ts b/packages/validation/src/user.ts index 70f809752..ce08bb367 100644 --- a/packages/validation/src/user.ts +++ b/packages/validation/src/user.ts @@ -25,7 +25,9 @@ export { headerPreferencesVersion, headerSearchDisplayValues, headerZoneIds, + isRequiredHeaderItem, parseHeaderPreferences, + requiredHeaderBuiltinItemIds, } from "./header-preferences"; export type { HeaderBoardItem,