diff --git a/LogisticsSupportTool_API_DOCS/environments/lst.bru b/LogisticsSupportTool_API_DOCS/environments/lst.bru index fd387a9..bd1ed2c 100644 --- a/LogisticsSupportTool_API_DOCS/environments/lst.bru +++ b/LogisticsSupportTool_API_DOCS/environments/lst.bru @@ -1,5 +1,5 @@ vars { - url: https://usmcd1vms036.alpla.net + url: http://localhost:5500 session_cookie: urlv2: http://localhost:3000 jwtV2: diff --git a/app/src/internal/admin/routes/users/getActiveSessions.ts b/app/src/internal/admin/routes/users/getActiveSessions.ts index eded91b..0269e49 100644 --- a/app/src/internal/admin/routes/users/getActiveSessions.ts +++ b/app/src/internal/admin/routes/users/getActiveSessions.ts @@ -8,17 +8,7 @@ router.get("/:userId", async (req: Request, res: Response) => { const cookieHeader = req.headers.cookie ?? ""; const authorization = req.headers.authorization ?? ""; - const data = await auth.api.setUserPassword({ - body: { - newPassword: req.body.password, // required - userId: userId, // required - }, - // This endpoint requires session cookies. - headers: { - cookie: cookieHeader, - authorization, - }, - }); + //session stuff return res.status(200).json({ message: "Password was just changed." }); }); diff --git a/app/src/internal/system/controller/modules/modules.json b/app/src/internal/system/controller/modules/modules.json index 18a8fef..b180c9c 100644 --- a/app/src/internal/system/controller/modules/modules.json +++ b/app/src/internal/system/controller/modules/modules.json @@ -26,7 +26,7 @@ { "name": "rfidReaders", "category": "production", - "icon": "Tags", + "icon": "Tag", "link": "/lst/app/old/rfid", "active": false, "roles": ["viewer", "manager", "tester", "systemAdmin", "admin"] @@ -91,7 +91,7 @@ "name": "production", "category": "production", "active": false, - "icon": "", + "icon": "Tags", "link": "", "roles": ["admin", "systemAdmin", "manager", "viewer", "tester"] }, diff --git a/app/src/internal/system/routes/modules/getModules.ts b/app/src/internal/system/routes/modules/getModules.ts index 22e8926..b271c2d 100644 --- a/app/src/internal/system/routes/modules/getModules.ts +++ b/app/src/internal/system/routes/modules/getModules.ts @@ -1,9 +1,9 @@ -import { and, asc, eq } from "drizzle-orm"; +import { asc } from "drizzle-orm"; import type { Request, Response } from "express"; import { Router } from "express"; import { db } from "../../../../pkg/db/db.js"; import { modules } from "../../../../pkg/db/schema/modules.js"; -import { serverData } from "../../../../pkg/db/schema/servers.js"; + import { tryCatch } from "../../../../pkg/utils/tryCatch.js"; const router = Router(); @@ -24,6 +24,7 @@ router.get("/", async (req: Request, res: Response) => { .select() .from(modules) //.where(and(...conditions)) + //.groupBy(modules.category) .orderBy(asc(modules.name)), ); diff --git a/frontend/.tanstack/tmp/4048fd0d-f4a99b9d94dad09ecb130786d5536cef b/frontend/.tanstack/tmp/4048fd0d-f4a99b9d94dad09ecb130786d5536cef deleted file mode 100644 index a17a486..0000000 --- a/frontend/.tanstack/tmp/4048fd0d-f4a99b9d94dad09ecb130786d5536cef +++ /dev/null @@ -1,9 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' - -export const Route = createFileRoute('/_old')({ - component: RouteComponent, -}) - -function RouteComponent() { - return
Hello "/_old"!
-} diff --git a/frontend/src/components/navBar/Admin.tsx b/frontend/src/components/navBar/Admin.tsx index 17485b5..c92c2e9 100644 --- a/frontend/src/components/navBar/Admin.tsx +++ b/frontend/src/components/navBar/Admin.tsx @@ -1,72 +1,79 @@ -import { Server, Settings, User, type LucideIcon } from "lucide-react"; -import { userAccess, type UserRoles } from "../../lib/authClient"; -import { - SidebarGroup, - SidebarGroupContent, - SidebarGroupLabel, - SidebarMenu, - SidebarMenuButton, - SidebarMenuItem, -} from "../ui/sidebar"; import { Link } from "@tanstack/react-router"; +import { type LucideIcon, Server, Settings, User } from "lucide-react"; +import { type UserRoles, userAccess } from "../../lib/authClient"; +import { + SidebarGroup, + SidebarGroupContent, + SidebarGroupLabel, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, +} from "../ui/sidebar"; type Items = { - title: string; - url: string; - icon: LucideIcon; - role: UserRoles["role"][]; - module: string; - active: boolean; + title: string; + url: string; + icon: LucideIcon; + role: UserRoles["role"][]; + module: string; + active: boolean; }; export default function Admin() { - const items: Items[] = [ - { - title: "Users", - url: "/lst/app/admin/users", - icon: User, - role: ["systemAdmin", "admin"], - module: "admin", - active: true, - }, - { - title: "Settings", - url: "/lst/app/admin/settings", - icon: Settings, - role: ["systemAdmin", "admin"], - module: "admin", - active: true, - }, - { - title: "Servers", - url: "/lst/app/admin/servers", - icon: Server, - role: ["systemAdmin", "admin"], - module: "admin", - active: true, - }, - ]; - return ( - - Admin - - - {items.map((item) => ( - - <> - {userAccess(item.module, item.role) && - item.active && ( - - - - {item.title} - - - )} - - - ))} - - - - ); + const items: Items[] = [ + { + title: "Users", + url: "/lst/app/admin/users", + icon: User, + role: ["systemAdmin", "admin"], + module: "admin", + active: true, + }, + { + title: "System", + url: "/lst/app/admin/settings", + icon: Settings, + role: ["systemAdmin", "admin"], + module: "admin", + active: true, + }, + { + title: "Modules", + url: "/lst/app/admin/modules", + icon: Settings, + role: ["systemAdmin", "admin"], + module: "admin", + active: true, + }, + { + title: "Servers", + url: "/lst/app/admin/servers", + icon: Server, + role: ["systemAdmin", "admin"], + module: "admin", + active: true, + }, + ]; + return ( + + Admin + + + {items.map((item) => ( + + <> + {userAccess(item.module, item.role) && item.active && ( + + + + {item.title} + + + )} + + + ))} + + + + ); } diff --git a/frontend/src/lib/querys/admin/getModules.ts b/frontend/src/lib/querys/admin/getModules.ts new file mode 100644 index 0000000..ca0f542 --- /dev/null +++ b/frontend/src/lib/querys/admin/getModules.ts @@ -0,0 +1,17 @@ +import { queryOptions } from "@tanstack/react-query"; +import axios from "axios"; + +export function getModules() { + return queryOptions({ + queryKey: ["getModules"], + queryFn: () => fetchSession(), + staleTime: 5000, + refetchOnWindowFocus: true, + }); +} + +const fetchSession = async () => { + const { data } = await axios.get("/lst/api/system/modules"); + + return data.data; +}; diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts index fdc8d9b..aff9449 100644 --- a/frontend/src/routeTree.gen.ts +++ b/frontend/src/routeTree.gen.ts @@ -26,13 +26,13 @@ import { Route as AppauthUserIndexRouteImport } from './routes/_app/(auth)/user/ import { Route as MobileMobileLayoutMRelocateRouteImport } from './routes/_mobile/_mobileLayout/m/relocate' import { Route as MobileMobileLayoutMDeliveryRouteImport } from './routes/_mobile/_mobileLayout/m/delivery' import { Route as MobileMobileLayoutMCyclecountsRouteImport } from './routes/_mobile/_mobileLayout/m/cyclecounts' -import { Route as AppAdminLayoutAdminSettingsRouteImport } from './routes/_app/_adminLayout/admin/settings' import { Route as AppAdminLayoutAdminServersRouteImport } from './routes/_app/_adminLayout/admin/servers' import { Route as ApplogisticsLogisticsDeliveryScheduleRouteImport } from './routes/_app/(logistics)/logistics/deliverySchedule' import { Route as AppauthUserSignupRouteImport } from './routes/_app/(auth)/user/signup' import { Route as AppauthUserResetpasswordRouteImport } from './routes/_app/(auth)/user/resetpassword' import { Route as AppauthUserProfileRouteImport } from './routes/_app/(auth)/user/profile' import { Route as AppAdminLayoutAdminUsersRouteRouteImport } from './routes/_app/_adminLayout/admin/_users/route' +import { Route as AppAdminLayoutAdminSystemRouteRouteImport } from './routes/_app/_adminLayout/admin/_system/route' import { Route as OldOldocmeCyclecountIndexRouteImport } from './routes/_old/old/(ocme)/cyclecount/index' import { Route as OldOldlogisticsSiloAdjustmentsIndexRouteImport } from './routes/_old/old/(logistics)/siloAdjustments/index' import { Route as OldOldlogisticsMaterialHelperIndexRouteImport } from './routes/_old/old/(logistics)/materialHelper/index' @@ -42,6 +42,8 @@ import { Route as OldOldlogisticsBarcodegenIndexRouteImport } from './routes/_ol import { Route as OldOldlogisticsSiloAdjustmentsHistRouteImport } from './routes/_old/old/(logistics)/siloAdjustments/$hist' import { Route as AppAdminLayoutAdminUsersUsersRouteImport } from './routes/_app/_adminLayout/admin/_users/users' import { Route as AppAdminLayoutAdminUsersProdUsersRouteImport } from './routes/_app/_adminLayout/admin/_users/prodUsers' +import { Route as AppAdminLayoutAdminSystemSettingsRouteImport } from './routes/_app/_adminLayout/admin/_system/settings' +import { Route as AppAdminLayoutAdminSystemModulesRouteImport } from './routes/_app/_adminLayout/admin/_system/modules' import { Route as OldOldlogisticsMaterialHelperConsumptionIndexRouteImport } from './routes/_old/old/(logistics)/materialHelper/consumption/index' import { Route as OldOldlogisticsSiloAdjustmentsCommentCommentRouteImport } from './routes/_old/old/(logistics)/siloAdjustments/comment/$comment' @@ -130,12 +132,6 @@ const MobileMobileLayoutMCyclecountsRoute = path: '/m/cyclecounts', getParentRoute: () => MobileMobileLayoutRouteRoute, } as any) -const AppAdminLayoutAdminSettingsRoute = - AppAdminLayoutAdminSettingsRouteImport.update({ - id: '/settings', - path: '/settings', - getParentRoute: () => AppAdminLayoutAdminRoute, - } as any) const AppAdminLayoutAdminServersRoute = AppAdminLayoutAdminServersRouteImport.update({ id: '/servers', @@ -169,6 +165,11 @@ const AppAdminLayoutAdminUsersRouteRoute = id: '/_users', getParentRoute: () => AppAdminLayoutAdminRoute, } as any) +const AppAdminLayoutAdminSystemRouteRoute = + AppAdminLayoutAdminSystemRouteRouteImport.update({ + id: '/_system', + getParentRoute: () => AppAdminLayoutAdminRoute, + } as any) const OldOldocmeCyclecountIndexRoute = OldOldocmeCyclecountIndexRouteImport.update({ id: '/(ocme)/cyclecount/', @@ -222,6 +223,18 @@ const AppAdminLayoutAdminUsersProdUsersRoute = path: '/prodUsers', getParentRoute: () => AppAdminLayoutAdminUsersRouteRoute, } as any) +const AppAdminLayoutAdminSystemSettingsRoute = + AppAdminLayoutAdminSystemSettingsRouteImport.update({ + id: '/settings', + path: '/settings', + getParentRoute: () => AppAdminLayoutAdminSystemRouteRoute, + } as any) +const AppAdminLayoutAdminSystemModulesRoute = + AppAdminLayoutAdminSystemModulesRouteImport.update({ + id: '/modules', + path: '/modules', + getParentRoute: () => AppAdminLayoutAdminSystemRouteRoute, + } as any) const OldOldlogisticsMaterialHelperConsumptionIndexRoute = OldOldlogisticsMaterialHelperConsumptionIndexRouteImport.update({ id: '/(logistics)/materialHelper/consumption/', @@ -247,7 +260,6 @@ export interface FileRoutesByFullPath { '/user/signup': typeof AppauthUserSignupRoute '/logistics/deliverySchedule': typeof ApplogisticsLogisticsDeliveryScheduleRoute '/admin/servers': typeof AppAdminLayoutAdminServersRoute - '/admin/settings': typeof AppAdminLayoutAdminSettingsRoute '/m/cyclecounts': typeof MobileMobileLayoutMCyclecountsRoute '/m/delivery': typeof MobileMobileLayoutMDeliveryRoute '/m/relocate': typeof MobileMobileLayoutMRelocateRoute @@ -255,6 +267,8 @@ export interface FileRoutesByFullPath { '/m': typeof MobileMobileLayoutMIndexRoute '/old/ocp': typeof OldOldOcpIndexRoute '/old/rfid': typeof OldOldRfidIndexRoute + '/admin/modules': typeof AppAdminLayoutAdminSystemModulesRoute + '/admin/settings': typeof AppAdminLayoutAdminSystemSettingsRoute '/admin/prodUsers': typeof AppAdminLayoutAdminUsersProdUsersRoute '/admin/users': typeof AppAdminLayoutAdminUsersUsersRoute '/old/siloAdjustments/$hist': typeof OldOldlogisticsSiloAdjustmentsHistRoute @@ -278,7 +292,6 @@ export interface FileRoutesByTo { '/user/signup': typeof AppauthUserSignupRoute '/logistics/deliverySchedule': typeof ApplogisticsLogisticsDeliveryScheduleRoute '/admin/servers': typeof AppAdminLayoutAdminServersRoute - '/admin/settings': typeof AppAdminLayoutAdminSettingsRoute '/m/cyclecounts': typeof MobileMobileLayoutMCyclecountsRoute '/m/delivery': typeof MobileMobileLayoutMDeliveryRoute '/m/relocate': typeof MobileMobileLayoutMRelocateRoute @@ -286,6 +299,8 @@ export interface FileRoutesByTo { '/m': typeof MobileMobileLayoutMIndexRoute '/old/ocp': typeof OldOldOcpIndexRoute '/old/rfid': typeof OldOldRfidIndexRoute + '/admin/modules': typeof AppAdminLayoutAdminSystemModulesRoute + '/admin/settings': typeof AppAdminLayoutAdminSystemSettingsRoute '/admin/prodUsers': typeof AppAdminLayoutAdminUsersProdUsersRoute '/admin/users': typeof AppAdminLayoutAdminUsersUsersRoute '/old/siloAdjustments/$hist': typeof OldOldlogisticsSiloAdjustmentsHistRoute @@ -309,13 +324,13 @@ export interface FileRoutesById { '/_app/(auth)/login': typeof AppauthLoginRoute '/_old/old/': typeof OldOldIndexRoute '/_app/_adminLayout/admin': typeof AppAdminLayoutAdminRouteWithChildren + '/_app/_adminLayout/admin/_system': typeof AppAdminLayoutAdminSystemRouteRouteWithChildren '/_app/_adminLayout/admin/_users': typeof AppAdminLayoutAdminUsersRouteRouteWithChildren '/_app/(auth)/user/profile': typeof AppauthUserProfileRoute '/_app/(auth)/user/resetpassword': typeof AppauthUserResetpasswordRoute '/_app/(auth)/user/signup': typeof AppauthUserSignupRoute '/_app/(logistics)/logistics/deliverySchedule': typeof ApplogisticsLogisticsDeliveryScheduleRoute '/_app/_adminLayout/admin/servers': typeof AppAdminLayoutAdminServersRoute - '/_app/_adminLayout/admin/settings': typeof AppAdminLayoutAdminSettingsRoute '/_mobile/_mobileLayout/m/cyclecounts': typeof MobileMobileLayoutMCyclecountsRoute '/_mobile/_mobileLayout/m/delivery': typeof MobileMobileLayoutMDeliveryRoute '/_mobile/_mobileLayout/m/relocate': typeof MobileMobileLayoutMRelocateRoute @@ -323,6 +338,8 @@ export interface FileRoutesById { '/_mobile/_mobileLayout/m/': typeof MobileMobileLayoutMIndexRoute '/_old/old/ocp/': typeof OldOldOcpIndexRoute '/_old/old/rfid/': typeof OldOldRfidIndexRoute + '/_app/_adminLayout/admin/_system/modules': typeof AppAdminLayoutAdminSystemModulesRoute + '/_app/_adminLayout/admin/_system/settings': typeof AppAdminLayoutAdminSystemSettingsRoute '/_app/_adminLayout/admin/_users/prodUsers': typeof AppAdminLayoutAdminUsersProdUsersRoute '/_app/_adminLayout/admin/_users/users': typeof AppAdminLayoutAdminUsersUsersRoute '/_old/old/(logistics)/siloAdjustments/$hist': typeof OldOldlogisticsSiloAdjustmentsHistRoute @@ -349,7 +366,6 @@ export interface FileRouteTypes { | '/user/signup' | '/logistics/deliverySchedule' | '/admin/servers' - | '/admin/settings' | '/m/cyclecounts' | '/m/delivery' | '/m/relocate' @@ -357,6 +373,8 @@ export interface FileRouteTypes { | '/m' | '/old/ocp' | '/old/rfid' + | '/admin/modules' + | '/admin/settings' | '/admin/prodUsers' | '/admin/users' | '/old/siloAdjustments/$hist' @@ -380,7 +398,6 @@ export interface FileRouteTypes { | '/user/signup' | '/logistics/deliverySchedule' | '/admin/servers' - | '/admin/settings' | '/m/cyclecounts' | '/m/delivery' | '/m/relocate' @@ -388,6 +405,8 @@ export interface FileRouteTypes { | '/m' | '/old/ocp' | '/old/rfid' + | '/admin/modules' + | '/admin/settings' | '/admin/prodUsers' | '/admin/users' | '/old/siloAdjustments/$hist' @@ -410,13 +429,13 @@ export interface FileRouteTypes { | '/_app/(auth)/login' | '/_old/old/' | '/_app/_adminLayout/admin' + | '/_app/_adminLayout/admin/_system' | '/_app/_adminLayout/admin/_users' | '/_app/(auth)/user/profile' | '/_app/(auth)/user/resetpassword' | '/_app/(auth)/user/signup' | '/_app/(logistics)/logistics/deliverySchedule' | '/_app/_adminLayout/admin/servers' - | '/_app/_adminLayout/admin/settings' | '/_mobile/_mobileLayout/m/cyclecounts' | '/_mobile/_mobileLayout/m/delivery' | '/_mobile/_mobileLayout/m/relocate' @@ -424,6 +443,8 @@ export interface FileRouteTypes { | '/_mobile/_mobileLayout/m/' | '/_old/old/ocp/' | '/_old/old/rfid/' + | '/_app/_adminLayout/admin/_system/modules' + | '/_app/_adminLayout/admin/_system/settings' | '/_app/_adminLayout/admin/_users/prodUsers' | '/_app/_adminLayout/admin/_users/users' | '/_old/old/(logistics)/siloAdjustments/$hist' @@ -557,13 +578,6 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof MobileMobileLayoutMCyclecountsRouteImport parentRoute: typeof MobileMobileLayoutRouteRoute } - '/_app/_adminLayout/admin/settings': { - id: '/_app/_adminLayout/admin/settings' - path: '/settings' - fullPath: '/admin/settings' - preLoaderRoute: typeof AppAdminLayoutAdminSettingsRouteImport - parentRoute: typeof AppAdminLayoutAdminRoute - } '/_app/_adminLayout/admin/servers': { id: '/_app/_adminLayout/admin/servers' path: '/servers' @@ -601,11 +615,18 @@ declare module '@tanstack/react-router' { } '/_app/_adminLayout/admin/_users': { id: '/_app/_adminLayout/admin/_users' - path: '/admin' + path: '' fullPath: '/admin' preLoaderRoute: typeof AppAdminLayoutAdminUsersRouteRouteImport parentRoute: typeof AppAdminLayoutAdminRoute } + '/_app/_adminLayout/admin/_system': { + id: '/_app/_adminLayout/admin/_system' + path: '/admin' + fullPath: '/admin' + preLoaderRoute: typeof AppAdminLayoutAdminSystemRouteRouteImport + parentRoute: typeof AppAdminLayoutAdminRoute + } '/_old/old/(ocme)/cyclecount/': { id: '/_old/old/(ocme)/cyclecount/' path: '/cyclecount' @@ -669,6 +690,20 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AppAdminLayoutAdminUsersProdUsersRouteImport parentRoute: typeof AppAdminLayoutAdminUsersRouteRoute } + '/_app/_adminLayout/admin/_system/settings': { + id: '/_app/_adminLayout/admin/_system/settings' + path: '/settings' + fullPath: '/admin/settings' + preLoaderRoute: typeof AppAdminLayoutAdminSystemSettingsRouteImport + parentRoute: typeof AppAdminLayoutAdminSystemRouteRoute + } + '/_app/_adminLayout/admin/_system/modules': { + id: '/_app/_adminLayout/admin/_system/modules' + path: '/modules' + fullPath: '/admin/modules' + preLoaderRoute: typeof AppAdminLayoutAdminSystemModulesRouteImport + parentRoute: typeof AppAdminLayoutAdminSystemRouteRoute + } '/_old/old/(logistics)/materialHelper/consumption/': { id: '/_old/old/(logistics)/materialHelper/consumption/' path: '/materialHelper/consumption' @@ -686,6 +721,24 @@ declare module '@tanstack/react-router' { } } +interface AppAdminLayoutAdminSystemRouteRouteChildren { + AppAdminLayoutAdminSystemModulesRoute: typeof AppAdminLayoutAdminSystemModulesRoute + AppAdminLayoutAdminSystemSettingsRoute: typeof AppAdminLayoutAdminSystemSettingsRoute +} + +const AppAdminLayoutAdminSystemRouteRouteChildren: AppAdminLayoutAdminSystemRouteRouteChildren = + { + AppAdminLayoutAdminSystemModulesRoute: + AppAdminLayoutAdminSystemModulesRoute, + AppAdminLayoutAdminSystemSettingsRoute: + AppAdminLayoutAdminSystemSettingsRoute, + } + +const AppAdminLayoutAdminSystemRouteRouteWithChildren = + AppAdminLayoutAdminSystemRouteRoute._addFileChildren( + AppAdminLayoutAdminSystemRouteRouteChildren, + ) + interface AppAdminLayoutAdminUsersRouteRouteChildren { AppAdminLayoutAdminUsersProdUsersRoute: typeof AppAdminLayoutAdminUsersProdUsersRoute AppAdminLayoutAdminUsersUsersRoute: typeof AppAdminLayoutAdminUsersUsersRoute @@ -704,16 +757,17 @@ const AppAdminLayoutAdminUsersRouteRouteWithChildren = ) interface AppAdminLayoutAdminRouteChildren { + AppAdminLayoutAdminSystemRouteRoute: typeof AppAdminLayoutAdminSystemRouteRouteWithChildren AppAdminLayoutAdminUsersRouteRoute: typeof AppAdminLayoutAdminUsersRouteRouteWithChildren AppAdminLayoutAdminServersRoute: typeof AppAdminLayoutAdminServersRoute - AppAdminLayoutAdminSettingsRoute: typeof AppAdminLayoutAdminSettingsRoute } const AppAdminLayoutAdminRouteChildren: AppAdminLayoutAdminRouteChildren = { + AppAdminLayoutAdminSystemRouteRoute: + AppAdminLayoutAdminSystemRouteRouteWithChildren, AppAdminLayoutAdminUsersRouteRoute: AppAdminLayoutAdminUsersRouteRouteWithChildren, AppAdminLayoutAdminServersRoute: AppAdminLayoutAdminServersRoute, - AppAdminLayoutAdminSettingsRoute: AppAdminLayoutAdminSettingsRoute, } const AppAdminLayoutAdminRouteWithChildren = diff --git a/frontend/src/routes/_app/_adminLayout/-components/ExpandedRow.tsx b/frontend/src/routes/_app/_adminLayout/-components/users/ExpandedRow.tsx similarity index 95% rename from frontend/src/routes/_app/_adminLayout/-components/ExpandedRow.tsx rename to frontend/src/routes/_app/_adminLayout/-components/users/ExpandedRow.tsx index 9c99e19..935ec27 100644 --- a/frontend/src/routes/_app/_adminLayout/-components/ExpandedRow.tsx +++ b/frontend/src/routes/_app/_adminLayout/-components/users/ExpandedRow.tsx @@ -1,14 +1,14 @@ import { useState } from "react"; import { toast } from "sonner"; -import { Button } from "../../../../components/ui/button"; +import { Button } from "../../../../../components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, -} from "../../../../components/ui/select"; -import { api } from "../../../../lib/axiosAPI"; +} from "../../../../../components/ui/select"; +import { api } from "../../../../../lib/axiosAPI"; const modules: string[] = [ "users", diff --git a/frontend/src/routes/_app/_adminLayout/admin/_system/modules.tsx b/frontend/src/routes/_app/_adminLayout/admin/_system/modules.tsx new file mode 100644 index 0000000..955510d --- /dev/null +++ b/frontend/src/routes/_app/_adminLayout/admin/_system/modules.tsx @@ -0,0 +1,297 @@ +import { useMutation, useQuery } from "@tanstack/react-query"; +import { createFileRoute } from "@tanstack/react-router"; +import { + createColumnHelper, + flexRender, + getCoreRowModel, + getPaginationRowModel, + getSortedRowModel, + //type Row, + type SortingState, + useReactTable, +} from "@tanstack/react-table"; +import axios from "axios"; +import { + Activity, + ArrowDown, + ArrowUp, + BookOpenCheck, + FolderPen, +} from "lucide-react"; +import React, { useState } from "react"; +import { Button } from "@/components/ui/button"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { getModules } from "@/lib/querys/admin/getModules"; +import { cn } from "@/lib/utils"; +import { useModuleStore } from "@/routes/_old/old/-lib/store/useModuleStore"; + +type Modules = { + category: string; + name: string; + active: boolean; + link: string; + roles: string[]; +}; + +const updateModuleActive = async (module: string, active: boolean) => { + return axios.patch( + `/lst/api/system/modules/update/${module}`, + { active }, + { withCredentials: true }, + ); +}; + +export const Route = createFileRoute( + "/_app/_adminLayout/admin/_system/modules", +)({ + component: RouteComponent, +}); + +function RouteComponent() { + const { data, isLoading, refetch } = useQuery(getModules()); + const [sorting, setSorting] = useState([]); + const columnHelper = createColumnHelper(); + const { fetchModules } = useModuleStore(); + + const updateActive = useMutation({ + mutationFn: ({ module, active }: { module: string; active: boolean }) => + updateModuleActive(module, active), + onSuccess: () => { + // refetch or update cache + fetchModules(); + refetch(); + }, + }); + const columns = [ + columnHelper.accessor("category", { + cell: (i) => i.getValue(), + header: ({ column }) => { + return ( + + ); + }, + }), + + columnHelper.accessor("name", { + cell: (i) => i.getValue(), + header: ({ column }) => { + return ( + + ); + }, + }), + columnHelper.accessor("active", { + header: ({ column }) => { + return ( + + ); + }, + cell: ({ row, getValue }) => { + const active = getValue(); + const module = row.original.name; + const ignoreModules = ["admin", "system", "users"]; + return ( + <> + {ignoreModules.includes(module) ? ( + <> + ) : ( + + )} + + ); + }, + }), + + columnHelper.accessor("link", { + cell: (i) => i.getValue(), + header: ({ column }) => { + return ( + + ); + }, + }), + ]; + + const table = useReactTable({ + data, + columns, + getCoreRowModel: getCoreRowModel(), + getPaginationRowModel: getPaginationRowModel(), + onSortingChange: setSorting, + getSortedRowModel: getSortedRowModel(), + //renderSubComponent: ({ row }: { row: any }) => , + //getRowCanExpand: () => true, + state: { + sorting, + }, + }); + + if (isLoading) { + return
Loading user data
; + } + + // function renderSubComponent( { row: Row }): React.ReactNode { + // throw new Error("Function not implemented."); + // } + + //console.log(data); + + return ( +
+
+ + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => { + return ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext(), + )} + + ); + })} + + ))} + + + {table.getRowModel().rows.map((row) => ( + + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext(), + )} + + ))} + + + {/* {row.getIsExpanded() && ( + + + {renderSubComponent({ row })} + + + )} */} + + ))} + +
+
+ + +
+
+
+ ); +} diff --git a/frontend/src/routes/_app/_adminLayout/admin/_system/route.tsx b/frontend/src/routes/_app/_adminLayout/admin/_system/route.tsx new file mode 100644 index 0000000..9555ba8 --- /dev/null +++ b/frontend/src/routes/_app/_adminLayout/admin/_system/route.tsx @@ -0,0 +1,33 @@ +import { createFileRoute, Link, Outlet } from "@tanstack/react-router"; + +export const Route = createFileRoute("/_app/_adminLayout/admin/_system")({ + component: RouteComponent, +}); + +function RouteComponent() { + return ( +
+ + +
+ ); +} diff --git a/frontend/src/routes/_app/_adminLayout/admin/_system/settings.tsx b/frontend/src/routes/_app/_adminLayout/admin/_system/settings.tsx new file mode 100644 index 0000000..78016cf --- /dev/null +++ b/frontend/src/routes/_app/_adminLayout/admin/_system/settings.tsx @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute( + '/_app/_adminLayout/admin/_system/settings', +)({ + component: RouteComponent, +}) + +function RouteComponent() { + return
Hello "/_app/_adminLayout/admin/_system/settings"!
+} diff --git a/frontend/src/routes/_app/_adminLayout/admin/_users/users.tsx b/frontend/src/routes/_app/_adminLayout/admin/_users/users.tsx index 32a8c06..e2db4e1 100644 --- a/frontend/src/routes/_app/_adminLayout/admin/_users/users.tsx +++ b/frontend/src/routes/_app/_adminLayout/admin/_users/users.tsx @@ -30,7 +30,7 @@ import { TableRow, } from "../../../../../components/ui/table"; import { getUsers } from "../../../../../lib/querys/admin/getUsers"; -import ExpandedRow from "../../-components/ExpandedRow"; +import ExpandedRow from "../../-components/users/ExpandedRow"; type User = { username: string; diff --git a/frontend/src/routes/_app/_adminLayout/admin/settings.tsx b/frontend/src/routes/_app/_adminLayout/admin/settings.tsx deleted file mode 100644 index 338df1e..0000000 --- a/frontend/src/routes/_app/_adminLayout/admin/settings.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router' - -export const Route = createFileRoute('/_app/_adminLayout/admin/settings')({ - component: RouteComponent, -}) - -function RouteComponent() { - return
Hello "/_adminLayout/admin/settings"!
-} diff --git a/frontend/src/routes/_old/old/-components/layout/side-components/production.tsx b/frontend/src/routes/_old/old/-components/layout/side-components/production.tsx index 2ec432e..78db909 100644 --- a/frontend/src/routes/_old/old/-components/layout/side-components/production.tsx +++ b/frontend/src/routes/_old/old/-components/layout/side-components/production.tsx @@ -15,7 +15,6 @@ import { hasPageAccess } from "../../../-utils/userAccess"; const iconMap: any = { Printer: Printer, Tag: Tag, - Cat: Cat, }; @@ -29,9 +28,8 @@ export function ProductionSideBar({ //const url: string = window.location.host.split(":")[0]; const { modules } = useModuleStore(); - const items = modules?.filter((m) => m.category === "production"); + const items = modules?.filter((m) => m.category === "production" && m.active); const userUpdate = { ...user, roles: userRoles }; - return ( Production diff --git a/migrations/0024_uneven_the_fury.sql b/migrations/0024_uneven_the_fury.sql new file mode 100644 index 0000000..a0296b0 --- /dev/null +++ b/migrations/0024_uneven_the_fury.sql @@ -0,0 +1,3 @@ +ALTER TABLE "modules" RENAME COLUMN "name" TO "module_name";--> statement-breakpoint +DROP INDEX "module_name";--> statement-breakpoint +CREATE UNIQUE INDEX "module_name" ON "modules" USING btree ("module_name"); \ No newline at end of file diff --git a/migrations/0025_foamy_mattie_franklin.sql b/migrations/0025_foamy_mattie_franklin.sql new file mode 100644 index 0000000..32015ca --- /dev/null +++ b/migrations/0025_foamy_mattie_franklin.sql @@ -0,0 +1,3 @@ +ALTER TABLE "modules" RENAME COLUMN "module_name" TO "name";--> statement-breakpoint +DROP INDEX "module_name";--> statement-breakpoint +CREATE UNIQUE INDEX "module_name" ON "modules" USING btree ("name"); \ No newline at end of file diff --git a/migrations/meta/0024_snapshot.json b/migrations/meta/0024_snapshot.json new file mode 100644 index 0000000..d00c7e6 --- /dev/null +++ b/migrations/meta/0024_snapshot.json @@ -0,0 +1,1739 @@ +{ + "id": "c81d5cbd-2a53-4810-bce8-4b9ddf7089aa", + "prevId": "1c522601-1d75-48ad-a08b-f47d84a8de70", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "method": { + "name": "method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "body": { + "name": "body", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "duration": { + "name": "duration", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "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 + } + }, + "indexes": {}, + "foreignKeys": { + "account_user_id_user_id_fk": { + "name": "account_user_id_user_id_fk", + "tableFrom": "account", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.apikey": { + "name": "apikey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refill_interval": { + "name": "refill_interval", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "refill_amount": { + "name": "refill_amount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_refill_at": { + "name": "last_refill_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "rate_limit_enabled": { + "name": "rate_limit_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "rate_limit_time_window": { + "name": "rate_limit_time_window", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 86400000 + }, + "rate_limit_max": { + "name": "rate_limit_max", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 10 + }, + "request_count": { + "name": "request_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "remaining": { + "name": "remaining", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_request": { + "name": "last_request", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "apikey_user_id_user_id_fk": { + "name": "apikey_user_id_user_id_fk", + "tableFrom": "apikey", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.jwks": { + "name": "jwks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "private_key": { + "name": "private_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": 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 + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "impersonated_by": { + "name": "impersonated_by", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_user_id_fk": { + "name": "session_user_id_user_id_fk", + "tableFrom": "session", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_token_unique": { + "name": "session_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "image": { + "name": "image", + "type": "text", + "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()" + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "banned": { + "name": "banned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "ban_reason": { + "name": "ban_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ban_expires": { + "name": "ban_expires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "display_username": { + "name": "display_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_login": { + "name": "last_login", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_email_unique": { + "name": "user_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + }, + "user_username_unique": { + "name": "user_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification": { + "name": "verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": 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()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.forecast_Data": { + "name": "forecast_Data", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "customer_article_number": { + "name": "customer_article_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "date_requested": { + "name": "date_requested", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "request_date": { + "name": "request_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "article": { + "name": "article", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "customer_id": { + "name": "customer_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "module": { + "name": "module", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subModule": { + "name": "subModule", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "stack": { + "name": "stack", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "hostname": { + "name": "hostname", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "module_name": { + "name": "module_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "module_name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.orderScheduler": { + "name": "orderScheduler", + "schema": "", + "columns": { + "schedule_id": { + "name": "schedule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "av": { + "name": "av", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "order_type": { + "name": "order_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "order_number": { + "name": "order_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "header": { + "name": "header", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "line_item_number": { + "name": "line_item_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customer_release_number": { + "name": "customer_release_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "delivery_date": { + "name": "delivery_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "loading_date": { + "name": "loading_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "order_qty": { + "name": "order_qty", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "order_lu": { + "name": "order_lu", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "delivered_qty": { + "name": "delivered_qty", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "delivered_lu": { + "name": "delivered_lu", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_as_EDI": { + "name": "created_as_EDI", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "current_state": { + "name": "current_state", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "lst_date_check": { + "name": "lst_date_check", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "customer_address_id": { + "name": "customer_address_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "customer_description": { + "name": "customer_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dock": { + "name": "dock", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "order_from": { + "name": "order_from", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "orderNumber": { + "name": "orderNumber", + "columns": [ + { + "expression": "order_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printers": { + "name": "printers", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status_text": { + "name": "status_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_time_printed": { + "name": "last_time_printed", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "print_delay": { + "name": "print_delay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitor_state": { + "name": "monitor_state", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "processes": { + "name": "processes", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "print_delay_override": { + "name": "print_delay_override", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodPermissions": { + "name": "prodPermissions", + "schema": "", + "columns": { + "prodPerm_id": { + "name": "prodPerm_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "rolesLegacy": { + "name": "rolesLegacy", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "prodPermName": { + "name": "prodPermName", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst_user'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst_user'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverStats": { + "name": "serverStats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "default": "'serverStats'" + }, + "build": { + "name": "build", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "lastUpdate": { + "name": "lastUpdate", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "settings_id": { + "name": "settings_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_roles": { + "name": "user_roles", + "schema": "", + "columns": { + "user_role_id": { + "name": "user_role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "module": { + "name": "module", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "unique_user_module": { + "name": "unique_user_module", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_roles_user_id_user_id_fk": { + "name": "user_roles_user_id_user_id_fk", + "tableFrom": "user_roles", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/migrations/meta/0025_snapshot.json b/migrations/meta/0025_snapshot.json new file mode 100644 index 0000000..170aed5 --- /dev/null +++ b/migrations/meta/0025_snapshot.json @@ -0,0 +1,1739 @@ +{ + "id": "a7b047b9-a6ed-4ae7-abb5-4d17d62d8e6d", + "prevId": "c81d5cbd-2a53-4810-bce8-4b9ddf7089aa", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.apiHits": { + "name": "apiHits", + "schema": "", + "columns": { + "apiHit_id": { + "name": "apiHit_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "method": { + "name": "method", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "body": { + "name": "body", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "duration": { + "name": "duration", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.account": { + "name": "account", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "account_id": { + "name": "account_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "provider_id": { + "name": "provider_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "id_token": { + "name": "id_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "access_token_expires_at": { + "name": "access_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "refresh_token_expires_at": { + "name": "refresh_token_expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "scope": { + "name": "scope", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "password": { + "name": "password", + "type": "text", + "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 + } + }, + "indexes": {}, + "foreignKeys": { + "account_user_id_user_id_fk": { + "name": "account_user_id_user_id_fk", + "tableFrom": "account", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.apikey": { + "name": "apikey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start": { + "name": "start", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "prefix": { + "name": "prefix", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refill_interval": { + "name": "refill_interval", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "refill_amount": { + "name": "refill_amount", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_refill_at": { + "name": "last_refill_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "rate_limit_enabled": { + "name": "rate_limit_enabled", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "rate_limit_time_window": { + "name": "rate_limit_time_window", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 86400000 + }, + "rate_limit_max": { + "name": "rate_limit_max", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 10 + }, + "request_count": { + "name": "request_count", + "type": "integer", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "remaining": { + "name": "remaining", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "last_request": { + "name": "last_request", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "permissions": { + "name": "permissions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "metadata": { + "name": "metadata", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "apikey_user_id_user_id_fk": { + "name": "apikey_user_id_user_id_fk", + "tableFrom": "apikey", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.jwks": { + "name": "jwks", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "public_key": { + "name": "public_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "private_key": { + "name": "private_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.session": { + "name": "session", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "token": { + "name": "token", + "type": "text", + "primaryKey": false, + "notNull": 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 + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_agent": { + "name": "user_agent", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "impersonated_by": { + "name": "impersonated_by", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "session_user_id_user_id_fk": { + "name": "session_user_id_user_id_fk", + "tableFrom": "session", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "session_token_unique": { + "name": "session_token_unique", + "nullsNotDistinct": false, + "columns": [ + "token" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email_verified": { + "name": "email_verified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "image": { + "name": "image", + "type": "text", + "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()" + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "banned": { + "name": "banned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "ban_reason": { + "name": "ban_reason", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ban_expires": { + "name": "ban_expires", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "display_username": { + "name": "display_username", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_login": { + "name": "last_login", + "type": "timestamp", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_email_unique": { + "name": "user_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + }, + "user_username_unique": { + "name": "user_username_unique", + "nullsNotDistinct": false, + "columns": [ + "username" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.verification": { + "name": "verification", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "identifier": { + "name": "identifier", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "expires_at": { + "name": "expires_at", + "type": "timestamp", + "primaryKey": false, + "notNull": 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()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.forecast_Data": { + "name": "forecast_Data", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "customer_article_number": { + "name": "customer_article_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "date_requested": { + "name": "date_requested", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "request_date": { + "name": "request_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "article": { + "name": "article", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "customer_id": { + "name": "customer_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.logs": { + "name": "logs", + "schema": "", + "columns": { + "log_id": { + "name": "log_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "level": { + "name": "level", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "module": { + "name": "module", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "subModule": { + "name": "subModule", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "stack": { + "name": "stack", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "checked": { + "name": "checked", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "hostname": { + "name": "hostname", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "createdAt": { + "name": "createdAt", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.modules": { + "name": "modules", + "schema": "", + "columns": { + "module_id": { + "name": "module_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "category": { + "name": "category", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"view\",\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "module_name": { + "name": "module_name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.orderScheduler": { + "name": "orderScheduler", + "schema": "", + "columns": { + "schedule_id": { + "name": "schedule_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "av": { + "name": "av", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "order_type": { + "name": "order_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "order_number": { + "name": "order_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "header": { + "name": "header", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "line_item_number": { + "name": "line_item_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customer_release_number": { + "name": "customer_release_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "delivery_date": { + "name": "delivery_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "loading_date": { + "name": "loading_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "order_qty": { + "name": "order_qty", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "order_lu": { + "name": "order_lu", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "delivered_qty": { + "name": "delivered_qty", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "delivered_lu": { + "name": "delivered_lu", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_as_EDI": { + "name": "created_as_EDI", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "current_state": { + "name": "current_state", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "lst_date_check": { + "name": "lst_date_check", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "customer_address_id": { + "name": "customer_address_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "customer_description": { + "name": "customer_description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dock": { + "name": "dock", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "order_from": { + "name": "order_from", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "orderNumber": { + "name": "orderNumber", + "columns": [ + { + "expression": "order_number", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.printers": { + "name": "printers", + "schema": "", + "columns": { + "printer_id": { + "name": "printer_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "humanReadableId": { + "name": "humanReadableId", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ip_address": { + "name": "ip_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "port": { + "name": "port", + "type": "numeric", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "status_text": { + "name": "status_text", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "last_time_printed": { + "name": "last_time_printed", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "assigned": { + "name": "assigned", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "remark": { + "name": "remark", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "print_delay": { + "name": "print_delay", + "type": "numeric", + "primaryKey": false, + "notNull": false, + "default": "'90'" + }, + "monitor_state": { + "name": "monitor_state", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "processes": { + "name": "processes", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "print_delay_override": { + "name": "print_delay_override", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "humanReadableId": { + "name": "humanReadableId", + "columns": [ + { + "expression": "humanReadableId", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodlabels": { + "name": "prodlabels", + "schema": "", + "columns": { + "label_id": { + "name": "label_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "printerID": { + "name": "printerID", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "printerName": { + "name": "printerName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "line": { + "name": "line", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "runningNr": { + "name": "runningNr", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "runningNr": { + "name": "runningNr", + "columns": [ + { + "expression": "runningNr", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.prodPermissions": { + "name": "prodPermissions", + "schema": "", + "columns": { + "prodPerm_id": { + "name": "prodPerm_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "rolesLegacy": { + "name": "rolesLegacy", + "type": "jsonb", + "primaryKey": false, + "notNull": false, + "default": "'[]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "prodPermName": { + "name": "prodPermName", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverData": { + "name": "serverData", + "schema": "", + "columns": { + "server_id": { + "name": "server_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "serverDNS": { + "name": "serverDNS", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "plantToken": { + "name": "plantToken", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ipAddress": { + "name": "ipAddress", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "greatPlainsPlantCode": { + "name": "greatPlainsPlantCode", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "streetAddress": { + "name": "streetAddress", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cityState": { + "name": "cityState", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "zipcode": { + "name": "zipcode", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "contactEmail": { + "name": "contactEmail", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "contactPhone": { + "name": "contactPhone", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "customerTiAcc": { + "name": "customerTiAcc", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lstServerPort": { + "name": "lstServerPort", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "serverLoc": { + "name": "serverLoc", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lastUpdated": { + "name": "lastUpdated", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "isUpgrading": { + "name": "isUpgrading", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "add_user": { + "name": "add_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst_user'" + }, + "add_date": { + "name": "add_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_user": { + "name": "upd_user", + "type": "text", + "primaryKey": false, + "notNull": false, + "default": "'lst_user'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "plantToken": { + "name": "plantToken", + "columns": [ + { + "expression": "plantToken", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.serverStats": { + "name": "serverStats", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true, + "default": "'serverStats'" + }, + "build": { + "name": "build", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 1 + }, + "lastUpdate": { + "name": "lastUpdate", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.settings": { + "name": "settings", + "schema": "", + "columns": { + "settings_id": { + "name": "settings_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "moduleName": { + "name": "moduleName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "active": { + "name": "active", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": true + }, + "roles": { + "name": "roles", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[\"systemAdmin\"]'::jsonb" + }, + "add_User": { + "name": "add_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "add_Date": { + "name": "add_Date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + }, + "upd_User": { + "name": "upd_User", + "type": "text", + "primaryKey": false, + "notNull": true, + "default": "'LST_System'" + }, + "upd_date": { + "name": "upd_date", + "type": "timestamp", + "primaryKey": false, + "notNull": false, + "default": "now()" + } + }, + "indexes": { + "name": { + "name": "name", + "columns": [ + { + "expression": "name", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_roles": { + "name": "user_roles", + "schema": "", + "columns": { + "user_role_id": { + "name": "user_role_id", + "type": "uuid", + "primaryKey": true, + "notNull": true, + "default": "gen_random_uuid()" + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "module": { + "name": "module", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "unique_user_module": { + "name": "unique_user_module", + "columns": [ + { + "expression": "user_id", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "module", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_roles_user_id_user_id_fk": { + "name": "user_roles_user_id_user_id_fk", + "tableFrom": "user_roles", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "cascade", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/migrations/meta/_journal.json b/migrations/meta/_journal.json index c98f433..636e4f7 100644 --- a/migrations/meta/_journal.json +++ b/migrations/meta/_journal.json @@ -169,6 +169,20 @@ "when": 1761781568161, "tag": "0023_minor_marvel_zombies", "breakpoints": true + }, + { + "idx": 24, + "version": "7", + "when": 1761829793348, + "tag": "0024_uneven_the_fury", + "breakpoints": true + }, + { + "idx": 25, + "version": "7", + "when": 1761830426770, + "tag": "0025_foamy_mattie_franklin", + "breakpoints": true } ] } \ No newline at end of file