Openstatus www.openstatus.dev

fix: on delete cascade (#1205)

* fix: on delete cascade

* feat: status page form danger section

* chore: add badge to quick actions

* ci: apply automated fixes

* fix: export

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

authored by

Maximilian Kaske
autofix-ci[bot]
and committed by
GitHub
8412ca57 8402e22c

+2644 -66
+1 -6
apps/web/src/app/status-page/[domain]/badge/route.tsx
··· 51 51 const { status } = await getStatus(params.domain); 52 52 const theme = req.nextUrl.searchParams.get("theme"); 53 53 const size = req.nextUrl.searchParams.get("size"); 54 - let s = SIZE.sm; 55 - if (size) { 56 - if (SIZE[size]) { 57 - s = SIZE[size]; 58 - } 59 - } 54 + const s = SIZE[size ?? "sm"] ?? SIZE.sm; 60 55 const { label, color } = statusDictionary[status]; 61 56 const light = "border-gray-200 text-gray-700 bg-white"; 62 57 const dark = "border-gray-800 text-gray-300 bg-gray-900";
+154 -59
apps/web/src/components/data-table/status-page/data-table-row-actions.tsx
··· 18 18 AlertDialogTitle, 19 19 AlertDialogTrigger, 20 20 Button, 21 + Dialog, 22 + DialogContent, 23 + DialogDescription, 24 + DialogHeader, 25 + DialogTitle, 26 + DialogTrigger, 21 27 DropdownMenu, 22 28 DropdownMenuContent, 23 29 DropdownMenuItem, 24 30 DropdownMenuSeparator, 25 31 DropdownMenuTrigger, 32 + Label, 33 + RadioGroup, 34 + RadioGroupItem, 26 35 } from "@openstatus/ui"; 27 36 28 37 import { LoadingAnimation } from "@/components/loading-animation"; 38 + import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard"; 29 39 import { toastAction } from "@/lib/toast"; 30 40 import { api } from "@/trpc/client"; 31 41 42 + export const SIZE: Record<string, { width: number; height: number }> = { 43 + sm: { width: 120, height: 34 }, 44 + md: { width: 160, height: 46 }, 45 + lg: { width: 200, height: 56 }, 46 + xl: { width: 240, height: 68 }, 47 + }; 48 + 32 49 interface DataTableRowActionsProps<TData> { 33 50 row: Row<TData>; 34 51 } ··· 40 57 const router = useRouter(); 41 58 const [alertOpen, setAlertOpen] = React.useState(false); 42 59 const [isPending, startTransition] = React.useTransition(); 60 + const [size, setSize] = React.useState<"sm" | "md" | "lg" | "xl">("sm"); 61 + const [theme, setTheme] = React.useState<"light" | "dark">("light"); 62 + const { copy } = useCopyToClipboard(); 43 63 44 64 async function onDelete() { 45 65 startTransition(async () => { ··· 56 76 } 57 77 58 78 return ( 59 - <AlertDialog open={alertOpen} onOpenChange={(value) => setAlertOpen(value)}> 60 - <DropdownMenu> 61 - <DropdownMenuTrigger asChild> 62 - <Button 63 - variant="ghost" 64 - className="h-8 w-8 p-0 data-[state=open]:bg-accent" 65 - > 66 - <span className="sr-only">Open menu</span> 67 - <MoreHorizontal className="h-4 w-4" /> 68 - </Button> 69 - </DropdownMenuTrigger> 70 - <DropdownMenuContent align="end"> 71 - <Link href={`./status-pages/${page.id}/edit`}> 72 - <DropdownMenuItem>Edit</DropdownMenuItem> 73 - </Link> 74 - <Link 75 - href={ 76 - process.env.NODE_ENV === "production" 77 - ? `https://${page.slug}.openstatus.dev` 78 - : `/status-page/${page.slug}` 79 - } 80 - target="_blank" 81 - > 82 - <DropdownMenuItem>Visit</DropdownMenuItem> 83 - </Link> 84 - <DropdownMenuSeparator /> 85 - <Link href={`./status-pages/${page.id}/reports/new`}> 86 - <DropdownMenuItem>Create Report</DropdownMenuItem> 87 - </Link> 88 - <DropdownMenuSeparator /> 89 - <AlertDialogTrigger asChild> 90 - <DropdownMenuItem className="text-destructive focus:bg-destructive focus:text-background"> 91 - Delete 92 - </DropdownMenuItem> 93 - </AlertDialogTrigger> 94 - </DropdownMenuContent> 95 - </DropdownMenu> 96 - <AlertDialogContent> 97 - <AlertDialogHeader> 98 - <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle> 99 - <AlertDialogDescription> 100 - This action cannot be undone. This will permanently delete the 101 - monitor. 102 - </AlertDialogDescription> 103 - </AlertDialogHeader> 104 - <AlertDialogFooter> 105 - <AlertDialogCancel>Cancel</AlertDialogCancel> 106 - <AlertDialogAction 107 - onClick={(e) => { 108 - e.preventDefault(); 109 - onDelete(); 110 - }} 111 - disabled={isPending} 112 - className="bg-destructive text-destructive-foreground hover:bg-destructive/90" 79 + <Dialog> 80 + <AlertDialog 81 + open={alertOpen} 82 + onOpenChange={(value) => setAlertOpen(value)} 83 + > 84 + <DropdownMenu> 85 + <DropdownMenuTrigger asChild> 86 + <Button 87 + variant="ghost" 88 + className="h-8 w-8 p-0 data-[state=open]:bg-accent" 89 + > 90 + <span className="sr-only">Open menu</span> 91 + <MoreHorizontal className="h-4 w-4" /> 92 + </Button> 93 + </DropdownMenuTrigger> 94 + <DropdownMenuContent align="end"> 95 + <Link href={`./status-pages/${page.id}/edit`}> 96 + <DropdownMenuItem>Edit</DropdownMenuItem> 97 + </Link> 98 + <Link 99 + href={ 100 + process.env.NODE_ENV === "production" 101 + ? `https://${page.slug}.openstatus.dev` 102 + : `/status-page/${page.slug}` 103 + } 104 + target="_blank" 105 + > 106 + <DropdownMenuItem>Visit</DropdownMenuItem> 107 + </Link> 108 + <DropdownMenuSeparator /> 109 + <Link href={`./status-pages/${page.id}/reports/new`}> 110 + <DropdownMenuItem>Create Report</DropdownMenuItem> 111 + </Link> 112 + <DialogTrigger asChild> 113 + <DropdownMenuItem>Create Badge</DropdownMenuItem> 114 + </DialogTrigger> 115 + <DropdownMenuSeparator /> 116 + <AlertDialogTrigger asChild> 117 + <DropdownMenuItem className="text-destructive focus:bg-destructive focus:text-background"> 118 + Delete 119 + </DropdownMenuItem> 120 + </AlertDialogTrigger> 121 + </DropdownMenuContent> 122 + </DropdownMenu> 123 + <AlertDialogContent> 124 + <AlertDialogHeader> 125 + <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle> 126 + <AlertDialogDescription> 127 + This action cannot be undone. This will permanently delete the 128 + monitor. 129 + </AlertDialogDescription> 130 + </AlertDialogHeader> 131 + <AlertDialogFooter> 132 + <AlertDialogCancel>Cancel</AlertDialogCancel> 133 + <AlertDialogAction 134 + onClick={(e) => { 135 + e.preventDefault(); 136 + onDelete(); 137 + }} 138 + disabled={isPending} 139 + className="bg-destructive text-destructive-foreground hover:bg-destructive/90" 140 + > 141 + {!isPending ? "Delete" : <LoadingAnimation />} 142 + </AlertDialogAction> 143 + </AlertDialogFooter> 144 + </AlertDialogContent> 145 + <DialogContent> 146 + <DialogHeader> 147 + <DialogTitle>Create Badge</DialogTitle> 148 + </DialogHeader> 149 + <DialogDescription> 150 + Create an uptime badge for your status page. 151 + </DialogDescription> 152 + <div className="flex items-center justify-center"> 153 + <div className="flex items-center justify-center p-4 border rounded-md w-full"> 154 + <img 155 + src={`/status-page/${page.slug}/badge?size=${size}&theme=${theme}`} 156 + alt="Badge" 157 + width={SIZE[size].width} 158 + height={SIZE[size].height} 159 + /> 160 + </div> 161 + </div> 162 + <div className="flex items-center justify-between"> 163 + <RadioGroup 164 + className="flex" 165 + onValueChange={(value) => 166 + setSize(value as "sm" | "md" | "lg" | "xl") 167 + } 168 + value={size} 169 + > 170 + {Object.keys(SIZE).map((size) => ( 171 + <div className="flex items-center space-x-2" key={size}> 172 + <RadioGroupItem value={size} id={size} /> 173 + <Label htmlFor={size}>{size}</Label> 174 + </div> 175 + ))} 176 + </RadioGroup> 177 + <div> 178 + <span className="text-sm text-muted-foreground font-mono"> 179 + {SIZE[size].width}x{SIZE[size].height} 180 + </span> 181 + </div> 182 + </div> 183 + <RadioGroup 184 + className="flex" 185 + onValueChange={(value) => setTheme(value as "light" | "dark")} 186 + value={theme} 113 187 > 114 - {!isPending ? "Delete" : <LoadingAnimation />} 115 - </AlertDialogAction> 116 - </AlertDialogFooter> 117 - </AlertDialogContent> 118 - </AlertDialog> 188 + {["light", "dark"].map((theme) => ( 189 + <div className="flex items-center space-x-2" key={theme}> 190 + <RadioGroupItem value={theme} id={theme} /> 191 + <Label htmlFor={theme}>{theme}</Label> 192 + </div> 193 + ))} 194 + </RadioGroup> 195 + <div className="flex items-center justify-center"> 196 + <Button 197 + variant="outline" 198 + className="w-full" 199 + size="sm" 200 + onClick={() => 201 + copy( 202 + `https://openstatus.dev/status-page/${page.slug}/badge?size=${size}&theme=${theme}`, 203 + { withToast: true }, 204 + ) 205 + } 206 + > 207 + https://openstatus.dev/status-page/{page.slug}/badge?size={size} 208 + &theme={theme} 209 + </Button> 210 + </div> 211 + </DialogContent> 212 + </AlertDialog> 213 + </Dialog> 119 214 ); 120 215 }
+9
apps/web/src/components/forms/status-page/form.tsx
··· 27 27 import { SaveButton } from "../shared/save-button"; 28 28 import { General } from "./general"; 29 29 import { SectionAdvanced } from "./section-advanced"; 30 + import { SectionDanger } from "./section-danger"; 30 31 import { SectionMonitor } from "./section-monitor"; 31 32 import { SectionVisibility } from "./section-visibility"; 32 33 ··· 183 184 </TabsTrigger> 184 185 <TabsTrigger value="advanced">Advanced</TabsTrigger> 185 186 <TabsTrigger value="visibility">Visibility</TabsTrigger> 187 + {defaultValues?.id ? ( 188 + <TabsTrigger value="danger">Danger</TabsTrigger> 189 + ) : null} 186 190 </TabsList> 187 191 <TabsContent value="monitors"> 188 192 <SectionMonitor form={form} monitors={allMonitors} /> ··· 193 197 <TabsContent value="visibility"> 194 198 <SectionVisibility {...{ form, plan, workspaceSlug }} /> 195 199 </TabsContent> 200 + {defaultValues?.id ? ( 201 + <TabsContent value="danger"> 202 + <SectionDanger pageId={defaultValues.id} /> 203 + </TabsContent> 204 + ) : null} 196 205 </Tabs> 197 206 <SaveButton 198 207 isPending={isPending}
+92
apps/web/src/components/forms/status-page/section-danger.tsx
··· 1 + "use client"; 2 + 3 + import { useRouter } from "next/navigation"; 4 + 5 + import { 6 + AlertDialog, 7 + AlertDialogAction, 8 + AlertDialogCancel, 9 + AlertDialogContent, 10 + AlertDialogDescription, 11 + AlertDialogFooter, 12 + AlertDialogHeader, 13 + AlertDialogTitle, 14 + AlertDialogTrigger, 15 + Button, 16 + FormDescription, 17 + } from "@openstatus/ui"; 18 + 19 + import { LoadingAnimation } from "@/components/loading-animation"; 20 + import { toastAction } from "@/lib/toast"; 21 + import { api } from "@/trpc/client"; 22 + import React from "react"; 23 + import { SectionHeader } from "../shared/section-header"; 24 + 25 + interface Props { 26 + pageId: number; 27 + } 28 + 29 + export function SectionDanger({ pageId }: Props) { 30 + const router = useRouter(); 31 + const [open, setOpen] = React.useState(false); 32 + const [isPending, startTransition] = React.useTransition(); 33 + 34 + async function onDelete() { 35 + startTransition(async () => { 36 + try { 37 + await api.page.delete.mutate({ id: pageId }); 38 + toastAction("deleted"); 39 + setOpen(false); 40 + router.push("../"); 41 + } catch { 42 + toastAction("error"); 43 + } 44 + }); 45 + } 46 + 47 + return ( 48 + <div className="grid w-full gap-4"> 49 + <SectionHeader 50 + title="Danger Zone" 51 + description="Be aware of the changes you are about to make." 52 + /> 53 + <div className="grid gap-4 sm:grid-cols-3"> 54 + <div className="col-start-1 flex flex-col items-center gap-4 sm:col-span-2 sm:flex-row"> 55 + <AlertDialog open={open} onOpenChange={setOpen}> 56 + <AlertDialogTrigger asChild> 57 + <Button variant="destructive" className="w-full sm:w-auto"> 58 + Delete 59 + </Button> 60 + </AlertDialogTrigger> 61 + <AlertDialogContent> 62 + <AlertDialogHeader> 63 + <AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle> 64 + <AlertDialogDescription> 65 + This action cannot be undone. This will permanently delete the 66 + status page. 67 + </AlertDialogDescription> 68 + </AlertDialogHeader> 69 + <AlertDialogFooter> 70 + <AlertDialogCancel>Cancel</AlertDialogCancel> 71 + <AlertDialogAction 72 + onClick={(e) => { 73 + e.preventDefault(); 74 + onDelete(); 75 + }} 76 + disabled={isPending} 77 + className="bg-destructive text-destructive-foreground hover:bg-destructive/90" 78 + > 79 + {!isPending ? "Delete" : <LoadingAnimation />} 80 + </AlertDialogAction> 81 + </AlertDialogFooter> 82 + </AlertDialogContent> 83 + </AlertDialog> 84 + <FormDescription className="order-1 text-red-500 sm:order-2"> 85 + This action cannot be undone. This will permanently delete the 86 + status page. 87 + </FormDescription> 88 + </div> 89 + </div> 90 + </div> 91 + ); 92 + }
+45
apps/web/src/hooks/use-copy-to-clipboard.ts
··· 1 + import { useCallback, useState } from "react"; 2 + import { toast } from "sonner"; 3 + 4 + export function useCopyToClipboard() { 5 + const [text, setText] = useState<string | null>(null); 6 + 7 + const copy = useCallback( 8 + async ( 9 + text: string, 10 + { 11 + timeout = 3000, 12 + withToast = false, 13 + }: { timeout?: number; withToast?: boolean }, 14 + ) => { 15 + if (!navigator?.clipboard) { 16 + console.warn("Clipboard not supported"); 17 + return false; 18 + } 19 + 20 + try { 21 + await navigator.clipboard.writeText(text); 22 + setText(text); 23 + 24 + if (timeout) { 25 + setTimeout(() => { 26 + setText(null); 27 + }, timeout); 28 + } 29 + 30 + if (withToast) { 31 + toast.success("Copied to clipboard"); 32 + } 33 + 34 + return true; 35 + } catch (error) { 36 + console.warn("Copy failed", error); 37 + setText(null); 38 + return false; 39 + } 40 + }, 41 + [], 42 + ); 43 + 44 + return { text, copy, isCopied: text !== null }; 45 + }
+17
packages/db/drizzle/0040_narrow_anthem.sql
··· 1 + PRAGMA foreign_keys=OFF;--> statement-breakpoint 2 + CREATE TABLE `__new_page_subscriber` ( 3 + `id` integer PRIMARY KEY NOT NULL, 4 + `email` text NOT NULL, 5 + `page_id` integer NOT NULL, 6 + `token` text, 7 + `accepted_at` integer, 8 + `expires_at` integer, 9 + `created_at` integer DEFAULT (strftime('%s', 'now')), 10 + `updated_at` integer DEFAULT (strftime('%s', 'now')), 11 + FOREIGN KEY (`page_id`) REFERENCES `page`(`id`) ON UPDATE no action ON DELETE cascade 12 + ); 13 + --> statement-breakpoint 14 + INSERT INTO `__new_page_subscriber`("id", "email", "page_id", "token", "accepted_at", "expires_at", "created_at", "updated_at") SELECT "id", "email", "page_id", "token", "accepted_at", "expires_at", "created_at", "updated_at" FROM `page_subscriber`;--> statement-breakpoint 15 + DROP TABLE `page_subscriber`;--> statement-breakpoint 16 + ALTER TABLE `__new_page_subscriber` RENAME TO `page_subscriber`;--> statement-breakpoint 17 + PRAGMA foreign_keys=ON;
+2318
packages/db/drizzle/meta/0040_snapshot.json
··· 1 + { 2 + "version": "6", 3 + "dialect": "sqlite", 4 + "id": "377a6822-a9c1-48a8-b07a-c18130fa682c", 5 + "prevId": "83c9c2dc-5d06-4b92-8604-86a5426a59d9", 6 + "tables": { 7 + "status_report_to_monitors": { 8 + "name": "status_report_to_monitors", 9 + "columns": { 10 + "monitor_id": { 11 + "name": "monitor_id", 12 + "type": "integer", 13 + "primaryKey": false, 14 + "notNull": true, 15 + "autoincrement": false 16 + }, 17 + "status_report_id": { 18 + "name": "status_report_id", 19 + "type": "integer", 20 + "primaryKey": false, 21 + "notNull": true, 22 + "autoincrement": false 23 + }, 24 + "created_at": { 25 + "name": "created_at", 26 + "type": "integer", 27 + "primaryKey": false, 28 + "notNull": false, 29 + "autoincrement": false, 30 + "default": "(strftime('%s', 'now'))" 31 + } 32 + }, 33 + "indexes": {}, 34 + "foreignKeys": { 35 + "status_report_to_monitors_monitor_id_monitor_id_fk": { 36 + "name": "status_report_to_monitors_monitor_id_monitor_id_fk", 37 + "tableFrom": "status_report_to_monitors", 38 + "tableTo": "monitor", 39 + "columnsFrom": [ 40 + "monitor_id" 41 + ], 42 + "columnsTo": [ 43 + "id" 44 + ], 45 + "onDelete": "cascade", 46 + "onUpdate": "no action" 47 + }, 48 + "status_report_to_monitors_status_report_id_status_report_id_fk": { 49 + "name": "status_report_to_monitors_status_report_id_status_report_id_fk", 50 + "tableFrom": "status_report_to_monitors", 51 + "tableTo": "status_report", 52 + "columnsFrom": [ 53 + "status_report_id" 54 + ], 55 + "columnsTo": [ 56 + "id" 57 + ], 58 + "onDelete": "cascade", 59 + "onUpdate": "no action" 60 + } 61 + }, 62 + "compositePrimaryKeys": { 63 + "status_report_to_monitors_monitor_id_status_report_id_pk": { 64 + "columns": [ 65 + "monitor_id", 66 + "status_report_id" 67 + ], 68 + "name": "status_report_to_monitors_monitor_id_status_report_id_pk" 69 + } 70 + }, 71 + "uniqueConstraints": {}, 72 + "checkConstraints": {} 73 + }, 74 + "status_report": { 75 + "name": "status_report", 76 + "columns": { 77 + "id": { 78 + "name": "id", 79 + "type": "integer", 80 + "primaryKey": true, 81 + "notNull": true, 82 + "autoincrement": false 83 + }, 84 + "status": { 85 + "name": "status", 86 + "type": "text", 87 + "primaryKey": false, 88 + "notNull": true, 89 + "autoincrement": false 90 + }, 91 + "title": { 92 + "name": "title", 93 + "type": "text(256)", 94 + "primaryKey": false, 95 + "notNull": true, 96 + "autoincrement": false 97 + }, 98 + "workspace_id": { 99 + "name": "workspace_id", 100 + "type": "integer", 101 + "primaryKey": false, 102 + "notNull": false, 103 + "autoincrement": false 104 + }, 105 + "page_id": { 106 + "name": "page_id", 107 + "type": "integer", 108 + "primaryKey": false, 109 + "notNull": false, 110 + "autoincrement": false 111 + }, 112 + "created_at": { 113 + "name": "created_at", 114 + "type": "integer", 115 + "primaryKey": false, 116 + "notNull": false, 117 + "autoincrement": false, 118 + "default": "(strftime('%s', 'now'))" 119 + }, 120 + "updated_at": { 121 + "name": "updated_at", 122 + "type": "integer", 123 + "primaryKey": false, 124 + "notNull": false, 125 + "autoincrement": false, 126 + "default": "(strftime('%s', 'now'))" 127 + } 128 + }, 129 + "indexes": {}, 130 + "foreignKeys": { 131 + "status_report_workspace_id_workspace_id_fk": { 132 + "name": "status_report_workspace_id_workspace_id_fk", 133 + "tableFrom": "status_report", 134 + "tableTo": "workspace", 135 + "columnsFrom": [ 136 + "workspace_id" 137 + ], 138 + "columnsTo": [ 139 + "id" 140 + ], 141 + "onDelete": "no action", 142 + "onUpdate": "no action" 143 + }, 144 + "status_report_page_id_page_id_fk": { 145 + "name": "status_report_page_id_page_id_fk", 146 + "tableFrom": "status_report", 147 + "tableTo": "page", 148 + "columnsFrom": [ 149 + "page_id" 150 + ], 151 + "columnsTo": [ 152 + "id" 153 + ], 154 + "onDelete": "no action", 155 + "onUpdate": "no action" 156 + } 157 + }, 158 + "compositePrimaryKeys": {}, 159 + "uniqueConstraints": {}, 160 + "checkConstraints": {} 161 + }, 162 + "status_report_update": { 163 + "name": "status_report_update", 164 + "columns": { 165 + "id": { 166 + "name": "id", 167 + "type": "integer", 168 + "primaryKey": true, 169 + "notNull": true, 170 + "autoincrement": false 171 + }, 172 + "status": { 173 + "name": "status", 174 + "type": "text(4)", 175 + "primaryKey": false, 176 + "notNull": true, 177 + "autoincrement": false 178 + }, 179 + "date": { 180 + "name": "date", 181 + "type": "integer", 182 + "primaryKey": false, 183 + "notNull": true, 184 + "autoincrement": false 185 + }, 186 + "message": { 187 + "name": "message", 188 + "type": "text", 189 + "primaryKey": false, 190 + "notNull": true, 191 + "autoincrement": false 192 + }, 193 + "status_report_id": { 194 + "name": "status_report_id", 195 + "type": "integer", 196 + "primaryKey": false, 197 + "notNull": true, 198 + "autoincrement": false 199 + }, 200 + "created_at": { 201 + "name": "created_at", 202 + "type": "integer", 203 + "primaryKey": false, 204 + "notNull": false, 205 + "autoincrement": false, 206 + "default": "(strftime('%s', 'now'))" 207 + }, 208 + "updated_at": { 209 + "name": "updated_at", 210 + "type": "integer", 211 + "primaryKey": false, 212 + "notNull": false, 213 + "autoincrement": false, 214 + "default": "(strftime('%s', 'now'))" 215 + } 216 + }, 217 + "indexes": {}, 218 + "foreignKeys": { 219 + "status_report_update_status_report_id_status_report_id_fk": { 220 + "name": "status_report_update_status_report_id_status_report_id_fk", 221 + "tableFrom": "status_report_update", 222 + "tableTo": "status_report", 223 + "columnsFrom": [ 224 + "status_report_id" 225 + ], 226 + "columnsTo": [ 227 + "id" 228 + ], 229 + "onDelete": "cascade", 230 + "onUpdate": "no action" 231 + } 232 + }, 233 + "compositePrimaryKeys": {}, 234 + "uniqueConstraints": {}, 235 + "checkConstraints": {} 236 + }, 237 + "integration": { 238 + "name": "integration", 239 + "columns": { 240 + "id": { 241 + "name": "id", 242 + "type": "integer", 243 + "primaryKey": true, 244 + "notNull": true, 245 + "autoincrement": false 246 + }, 247 + "name": { 248 + "name": "name", 249 + "type": "text(256)", 250 + "primaryKey": false, 251 + "notNull": true, 252 + "autoincrement": false 253 + }, 254 + "workspace_id": { 255 + "name": "workspace_id", 256 + "type": "integer", 257 + "primaryKey": false, 258 + "notNull": false, 259 + "autoincrement": false 260 + }, 261 + "credential": { 262 + "name": "credential", 263 + "type": "text", 264 + "primaryKey": false, 265 + "notNull": false, 266 + "autoincrement": false 267 + }, 268 + "external_id": { 269 + "name": "external_id", 270 + "type": "text", 271 + "primaryKey": false, 272 + "notNull": true, 273 + "autoincrement": false 274 + }, 275 + "created_at": { 276 + "name": "created_at", 277 + "type": "integer", 278 + "primaryKey": false, 279 + "notNull": false, 280 + "autoincrement": false, 281 + "default": "(strftime('%s', 'now'))" 282 + }, 283 + "updated_at": { 284 + "name": "updated_at", 285 + "type": "integer", 286 + "primaryKey": false, 287 + "notNull": false, 288 + "autoincrement": false, 289 + "default": "(strftime('%s', 'now'))" 290 + }, 291 + "data": { 292 + "name": "data", 293 + "type": "text", 294 + "primaryKey": false, 295 + "notNull": true, 296 + "autoincrement": false 297 + } 298 + }, 299 + "indexes": {}, 300 + "foreignKeys": { 301 + "integration_workspace_id_workspace_id_fk": { 302 + "name": "integration_workspace_id_workspace_id_fk", 303 + "tableFrom": "integration", 304 + "tableTo": "workspace", 305 + "columnsFrom": [ 306 + "workspace_id" 307 + ], 308 + "columnsTo": [ 309 + "id" 310 + ], 311 + "onDelete": "no action", 312 + "onUpdate": "no action" 313 + } 314 + }, 315 + "compositePrimaryKeys": {}, 316 + "uniqueConstraints": {}, 317 + "checkConstraints": {} 318 + }, 319 + "page": { 320 + "name": "page", 321 + "columns": { 322 + "id": { 323 + "name": "id", 324 + "type": "integer", 325 + "primaryKey": true, 326 + "notNull": true, 327 + "autoincrement": false 328 + }, 329 + "workspace_id": { 330 + "name": "workspace_id", 331 + "type": "integer", 332 + "primaryKey": false, 333 + "notNull": true, 334 + "autoincrement": false 335 + }, 336 + "title": { 337 + "name": "title", 338 + "type": "text", 339 + "primaryKey": false, 340 + "notNull": true, 341 + "autoincrement": false 342 + }, 343 + "description": { 344 + "name": "description", 345 + "type": "text", 346 + "primaryKey": false, 347 + "notNull": true, 348 + "autoincrement": false 349 + }, 350 + "icon": { 351 + "name": "icon", 352 + "type": "text(256)", 353 + "primaryKey": false, 354 + "notNull": false, 355 + "autoincrement": false, 356 + "default": "''" 357 + }, 358 + "slug": { 359 + "name": "slug", 360 + "type": "text(256)", 361 + "primaryKey": false, 362 + "notNull": true, 363 + "autoincrement": false 364 + }, 365 + "custom_domain": { 366 + "name": "custom_domain", 367 + "type": "text(256)", 368 + "primaryKey": false, 369 + "notNull": true, 370 + "autoincrement": false 371 + }, 372 + "published": { 373 + "name": "published", 374 + "type": "integer", 375 + "primaryKey": false, 376 + "notNull": false, 377 + "autoincrement": false, 378 + "default": false 379 + }, 380 + "password": { 381 + "name": "password", 382 + "type": "text(256)", 383 + "primaryKey": false, 384 + "notNull": false, 385 + "autoincrement": false 386 + }, 387 + "password_protected": { 388 + "name": "password_protected", 389 + "type": "integer", 390 + "primaryKey": false, 391 + "notNull": false, 392 + "autoincrement": false, 393 + "default": false 394 + }, 395 + "show_monitor_values": { 396 + "name": "show_monitor_values", 397 + "type": "integer", 398 + "primaryKey": false, 399 + "notNull": false, 400 + "autoincrement": false, 401 + "default": true 402 + }, 403 + "created_at": { 404 + "name": "created_at", 405 + "type": "integer", 406 + "primaryKey": false, 407 + "notNull": false, 408 + "autoincrement": false, 409 + "default": "(strftime('%s', 'now'))" 410 + }, 411 + "updated_at": { 412 + "name": "updated_at", 413 + "type": "integer", 414 + "primaryKey": false, 415 + "notNull": false, 416 + "autoincrement": false, 417 + "default": "(strftime('%s', 'now'))" 418 + } 419 + }, 420 + "indexes": { 421 + "page_slug_unique": { 422 + "name": "page_slug_unique", 423 + "columns": [ 424 + "slug" 425 + ], 426 + "isUnique": true 427 + } 428 + }, 429 + "foreignKeys": { 430 + "page_workspace_id_workspace_id_fk": { 431 + "name": "page_workspace_id_workspace_id_fk", 432 + "tableFrom": "page", 433 + "tableTo": "workspace", 434 + "columnsFrom": [ 435 + "workspace_id" 436 + ], 437 + "columnsTo": [ 438 + "id" 439 + ], 440 + "onDelete": "cascade", 441 + "onUpdate": "no action" 442 + } 443 + }, 444 + "compositePrimaryKeys": {}, 445 + "uniqueConstraints": {}, 446 + "checkConstraints": {} 447 + }, 448 + "monitor": { 449 + "name": "monitor", 450 + "columns": { 451 + "id": { 452 + "name": "id", 453 + "type": "integer", 454 + "primaryKey": true, 455 + "notNull": true, 456 + "autoincrement": false 457 + }, 458 + "job_type": { 459 + "name": "job_type", 460 + "type": "text", 461 + "primaryKey": false, 462 + "notNull": true, 463 + "autoincrement": false, 464 + "default": "'http'" 465 + }, 466 + "periodicity": { 467 + "name": "periodicity", 468 + "type": "text", 469 + "primaryKey": false, 470 + "notNull": true, 471 + "autoincrement": false, 472 + "default": "'other'" 473 + }, 474 + "status": { 475 + "name": "status", 476 + "type": "text", 477 + "primaryKey": false, 478 + "notNull": true, 479 + "autoincrement": false, 480 + "default": "'active'" 481 + }, 482 + "active": { 483 + "name": "active", 484 + "type": "integer", 485 + "primaryKey": false, 486 + "notNull": false, 487 + "autoincrement": false, 488 + "default": false 489 + }, 490 + "regions": { 491 + "name": "regions", 492 + "type": "text", 493 + "primaryKey": false, 494 + "notNull": true, 495 + "autoincrement": false, 496 + "default": "''" 497 + }, 498 + "url": { 499 + "name": "url", 500 + "type": "text(2048)", 501 + "primaryKey": false, 502 + "notNull": true, 503 + "autoincrement": false 504 + }, 505 + "name": { 506 + "name": "name", 507 + "type": "text(256)", 508 + "primaryKey": false, 509 + "notNull": true, 510 + "autoincrement": false, 511 + "default": "''" 512 + }, 513 + "description": { 514 + "name": "description", 515 + "type": "text", 516 + "primaryKey": false, 517 + "notNull": true, 518 + "autoincrement": false, 519 + "default": "''" 520 + }, 521 + "headers": { 522 + "name": "headers", 523 + "type": "text", 524 + "primaryKey": false, 525 + "notNull": false, 526 + "autoincrement": false, 527 + "default": "''" 528 + }, 529 + "body": { 530 + "name": "body", 531 + "type": "text", 532 + "primaryKey": false, 533 + "notNull": false, 534 + "autoincrement": false, 535 + "default": "''" 536 + }, 537 + "method": { 538 + "name": "method", 539 + "type": "text", 540 + "primaryKey": false, 541 + "notNull": false, 542 + "autoincrement": false, 543 + "default": "'GET'" 544 + }, 545 + "workspace_id": { 546 + "name": "workspace_id", 547 + "type": "integer", 548 + "primaryKey": false, 549 + "notNull": false, 550 + "autoincrement": false 551 + }, 552 + "timeout": { 553 + "name": "timeout", 554 + "type": "integer", 555 + "primaryKey": false, 556 + "notNull": true, 557 + "autoincrement": false, 558 + "default": 45000 559 + }, 560 + "degraded_after": { 561 + "name": "degraded_after", 562 + "type": "integer", 563 + "primaryKey": false, 564 + "notNull": false, 565 + "autoincrement": false 566 + }, 567 + "assertions": { 568 + "name": "assertions", 569 + "type": "text", 570 + "primaryKey": false, 571 + "notNull": false, 572 + "autoincrement": false 573 + }, 574 + "otel_endpoint": { 575 + "name": "otel_endpoint", 576 + "type": "text", 577 + "primaryKey": false, 578 + "notNull": false, 579 + "autoincrement": false 580 + }, 581 + "otel_headers": { 582 + "name": "otel_headers", 583 + "type": "text", 584 + "primaryKey": false, 585 + "notNull": false, 586 + "autoincrement": false 587 + }, 588 + "public": { 589 + "name": "public", 590 + "type": "integer", 591 + "primaryKey": false, 592 + "notNull": false, 593 + "autoincrement": false, 594 + "default": false 595 + }, 596 + "created_at": { 597 + "name": "created_at", 598 + "type": "integer", 599 + "primaryKey": false, 600 + "notNull": false, 601 + "autoincrement": false, 602 + "default": "(strftime('%s', 'now'))" 603 + }, 604 + "updated_at": { 605 + "name": "updated_at", 606 + "type": "integer", 607 + "primaryKey": false, 608 + "notNull": false, 609 + "autoincrement": false, 610 + "default": "(strftime('%s', 'now'))" 611 + }, 612 + "deleted_at": { 613 + "name": "deleted_at", 614 + "type": "integer", 615 + "primaryKey": false, 616 + "notNull": false, 617 + "autoincrement": false 618 + } 619 + }, 620 + "indexes": {}, 621 + "foreignKeys": { 622 + "monitor_workspace_id_workspace_id_fk": { 623 + "name": "monitor_workspace_id_workspace_id_fk", 624 + "tableFrom": "monitor", 625 + "tableTo": "workspace", 626 + "columnsFrom": [ 627 + "workspace_id" 628 + ], 629 + "columnsTo": [ 630 + "id" 631 + ], 632 + "onDelete": "no action", 633 + "onUpdate": "no action" 634 + } 635 + }, 636 + "compositePrimaryKeys": {}, 637 + "uniqueConstraints": {}, 638 + "checkConstraints": {} 639 + }, 640 + "monitors_to_pages": { 641 + "name": "monitors_to_pages", 642 + "columns": { 643 + "monitor_id": { 644 + "name": "monitor_id", 645 + "type": "integer", 646 + "primaryKey": false, 647 + "notNull": true, 648 + "autoincrement": false 649 + }, 650 + "page_id": { 651 + "name": "page_id", 652 + "type": "integer", 653 + "primaryKey": false, 654 + "notNull": true, 655 + "autoincrement": false 656 + }, 657 + "created_at": { 658 + "name": "created_at", 659 + "type": "integer", 660 + "primaryKey": false, 661 + "notNull": false, 662 + "autoincrement": false, 663 + "default": "(strftime('%s', 'now'))" 664 + }, 665 + "order": { 666 + "name": "order", 667 + "type": "integer", 668 + "primaryKey": false, 669 + "notNull": false, 670 + "autoincrement": false, 671 + "default": 0 672 + } 673 + }, 674 + "indexes": {}, 675 + "foreignKeys": { 676 + "monitors_to_pages_monitor_id_monitor_id_fk": { 677 + "name": "monitors_to_pages_monitor_id_monitor_id_fk", 678 + "tableFrom": "monitors_to_pages", 679 + "tableTo": "monitor", 680 + "columnsFrom": [ 681 + "monitor_id" 682 + ], 683 + "columnsTo": [ 684 + "id" 685 + ], 686 + "onDelete": "cascade", 687 + "onUpdate": "no action" 688 + }, 689 + "monitors_to_pages_page_id_page_id_fk": { 690 + "name": "monitors_to_pages_page_id_page_id_fk", 691 + "tableFrom": "monitors_to_pages", 692 + "tableTo": "page", 693 + "columnsFrom": [ 694 + "page_id" 695 + ], 696 + "columnsTo": [ 697 + "id" 698 + ], 699 + "onDelete": "cascade", 700 + "onUpdate": "no action" 701 + } 702 + }, 703 + "compositePrimaryKeys": { 704 + "monitors_to_pages_monitor_id_page_id_pk": { 705 + "columns": [ 706 + "monitor_id", 707 + "page_id" 708 + ], 709 + "name": "monitors_to_pages_monitor_id_page_id_pk" 710 + } 711 + }, 712 + "uniqueConstraints": {}, 713 + "checkConstraints": {} 714 + }, 715 + "workspace": { 716 + "name": "workspace", 717 + "columns": { 718 + "id": { 719 + "name": "id", 720 + "type": "integer", 721 + "primaryKey": true, 722 + "notNull": true, 723 + "autoincrement": false 724 + }, 725 + "slug": { 726 + "name": "slug", 727 + "type": "text", 728 + "primaryKey": false, 729 + "notNull": true, 730 + "autoincrement": false 731 + }, 732 + "name": { 733 + "name": "name", 734 + "type": "text", 735 + "primaryKey": false, 736 + "notNull": false, 737 + "autoincrement": false 738 + }, 739 + "stripe_id": { 740 + "name": "stripe_id", 741 + "type": "text(256)", 742 + "primaryKey": false, 743 + "notNull": false, 744 + "autoincrement": false 745 + }, 746 + "subscription_id": { 747 + "name": "subscription_id", 748 + "type": "text", 749 + "primaryKey": false, 750 + "notNull": false, 751 + "autoincrement": false 752 + }, 753 + "plan": { 754 + "name": "plan", 755 + "type": "text", 756 + "primaryKey": false, 757 + "notNull": false, 758 + "autoincrement": false 759 + }, 760 + "ends_at": { 761 + "name": "ends_at", 762 + "type": "integer", 763 + "primaryKey": false, 764 + "notNull": false, 765 + "autoincrement": false 766 + }, 767 + "paid_until": { 768 + "name": "paid_until", 769 + "type": "integer", 770 + "primaryKey": false, 771 + "notNull": false, 772 + "autoincrement": false 773 + }, 774 + "limits": { 775 + "name": "limits", 776 + "type": "text", 777 + "primaryKey": false, 778 + "notNull": true, 779 + "autoincrement": false, 780 + "default": "'{}'" 781 + }, 782 + "created_at": { 783 + "name": "created_at", 784 + "type": "integer", 785 + "primaryKey": false, 786 + "notNull": false, 787 + "autoincrement": false, 788 + "default": "(strftime('%s', 'now'))" 789 + }, 790 + "updated_at": { 791 + "name": "updated_at", 792 + "type": "integer", 793 + "primaryKey": false, 794 + "notNull": false, 795 + "autoincrement": false, 796 + "default": "(strftime('%s', 'now'))" 797 + }, 798 + "dsn": { 799 + "name": "dsn", 800 + "type": "text", 801 + "primaryKey": false, 802 + "notNull": false, 803 + "autoincrement": false 804 + } 805 + }, 806 + "indexes": { 807 + "workspace_slug_unique": { 808 + "name": "workspace_slug_unique", 809 + "columns": [ 810 + "slug" 811 + ], 812 + "isUnique": true 813 + }, 814 + "workspace_stripe_id_unique": { 815 + "name": "workspace_stripe_id_unique", 816 + "columns": [ 817 + "stripe_id" 818 + ], 819 + "isUnique": true 820 + }, 821 + "workspace_id_dsn_unique": { 822 + "name": "workspace_id_dsn_unique", 823 + "columns": [ 824 + "id", 825 + "dsn" 826 + ], 827 + "isUnique": true 828 + } 829 + }, 830 + "foreignKeys": {}, 831 + "compositePrimaryKeys": {}, 832 + "uniqueConstraints": {}, 833 + "checkConstraints": {} 834 + }, 835 + "account": { 836 + "name": "account", 837 + "columns": { 838 + "user_id": { 839 + "name": "user_id", 840 + "type": "integer", 841 + "primaryKey": false, 842 + "notNull": true, 843 + "autoincrement": false 844 + }, 845 + "type": { 846 + "name": "type", 847 + "type": "text", 848 + "primaryKey": false, 849 + "notNull": true, 850 + "autoincrement": false 851 + }, 852 + "provider": { 853 + "name": "provider", 854 + "type": "text", 855 + "primaryKey": false, 856 + "notNull": true, 857 + "autoincrement": false 858 + }, 859 + "provider_account_id": { 860 + "name": "provider_account_id", 861 + "type": "text", 862 + "primaryKey": false, 863 + "notNull": true, 864 + "autoincrement": false 865 + }, 866 + "refresh_token": { 867 + "name": "refresh_token", 868 + "type": "text", 869 + "primaryKey": false, 870 + "notNull": false, 871 + "autoincrement": false 872 + }, 873 + "access_token": { 874 + "name": "access_token", 875 + "type": "text", 876 + "primaryKey": false, 877 + "notNull": false, 878 + "autoincrement": false 879 + }, 880 + "expires_at": { 881 + "name": "expires_at", 882 + "type": "integer", 883 + "primaryKey": false, 884 + "notNull": false, 885 + "autoincrement": false 886 + }, 887 + "token_type": { 888 + "name": "token_type", 889 + "type": "text", 890 + "primaryKey": false, 891 + "notNull": false, 892 + "autoincrement": false 893 + }, 894 + "scope": { 895 + "name": "scope", 896 + "type": "text", 897 + "primaryKey": false, 898 + "notNull": false, 899 + "autoincrement": false 900 + }, 901 + "id_token": { 902 + "name": "id_token", 903 + "type": "text", 904 + "primaryKey": false, 905 + "notNull": false, 906 + "autoincrement": false 907 + }, 908 + "session_state": { 909 + "name": "session_state", 910 + "type": "text", 911 + "primaryKey": false, 912 + "notNull": false, 913 + "autoincrement": false 914 + } 915 + }, 916 + "indexes": {}, 917 + "foreignKeys": { 918 + "account_user_id_user_id_fk": { 919 + "name": "account_user_id_user_id_fk", 920 + "tableFrom": "account", 921 + "tableTo": "user", 922 + "columnsFrom": [ 923 + "user_id" 924 + ], 925 + "columnsTo": [ 926 + "id" 927 + ], 928 + "onDelete": "cascade", 929 + "onUpdate": "no action" 930 + } 931 + }, 932 + "compositePrimaryKeys": { 933 + "account_provider_provider_account_id_pk": { 934 + "columns": [ 935 + "provider", 936 + "provider_account_id" 937 + ], 938 + "name": "account_provider_provider_account_id_pk" 939 + } 940 + }, 941 + "uniqueConstraints": {}, 942 + "checkConstraints": {} 943 + }, 944 + "session": { 945 + "name": "session", 946 + "columns": { 947 + "session_token": { 948 + "name": "session_token", 949 + "type": "text", 950 + "primaryKey": true, 951 + "notNull": true, 952 + "autoincrement": false 953 + }, 954 + "user_id": { 955 + "name": "user_id", 956 + "type": "integer", 957 + "primaryKey": false, 958 + "notNull": true, 959 + "autoincrement": false 960 + }, 961 + "expires": { 962 + "name": "expires", 963 + "type": "integer", 964 + "primaryKey": false, 965 + "notNull": true, 966 + "autoincrement": false 967 + } 968 + }, 969 + "indexes": {}, 970 + "foreignKeys": { 971 + "session_user_id_user_id_fk": { 972 + "name": "session_user_id_user_id_fk", 973 + "tableFrom": "session", 974 + "tableTo": "user", 975 + "columnsFrom": [ 976 + "user_id" 977 + ], 978 + "columnsTo": [ 979 + "id" 980 + ], 981 + "onDelete": "cascade", 982 + "onUpdate": "no action" 983 + } 984 + }, 985 + "compositePrimaryKeys": {}, 986 + "uniqueConstraints": {}, 987 + "checkConstraints": {} 988 + }, 989 + "user": { 990 + "name": "user", 991 + "columns": { 992 + "id": { 993 + "name": "id", 994 + "type": "integer", 995 + "primaryKey": true, 996 + "notNull": true, 997 + "autoincrement": false 998 + }, 999 + "tenant_id": { 1000 + "name": "tenant_id", 1001 + "type": "text(256)", 1002 + "primaryKey": false, 1003 + "notNull": false, 1004 + "autoincrement": false 1005 + }, 1006 + "first_name": { 1007 + "name": "first_name", 1008 + "type": "text", 1009 + "primaryKey": false, 1010 + "notNull": false, 1011 + "autoincrement": false, 1012 + "default": "''" 1013 + }, 1014 + "last_name": { 1015 + "name": "last_name", 1016 + "type": "text", 1017 + "primaryKey": false, 1018 + "notNull": false, 1019 + "autoincrement": false, 1020 + "default": "''" 1021 + }, 1022 + "photo_url": { 1023 + "name": "photo_url", 1024 + "type": "text", 1025 + "primaryKey": false, 1026 + "notNull": false, 1027 + "autoincrement": false, 1028 + "default": "''" 1029 + }, 1030 + "name": { 1031 + "name": "name", 1032 + "type": "text", 1033 + "primaryKey": false, 1034 + "notNull": false, 1035 + "autoincrement": false 1036 + }, 1037 + "email": { 1038 + "name": "email", 1039 + "type": "text", 1040 + "primaryKey": false, 1041 + "notNull": false, 1042 + "autoincrement": false, 1043 + "default": "''" 1044 + }, 1045 + "emailVerified": { 1046 + "name": "emailVerified", 1047 + "type": "integer", 1048 + "primaryKey": false, 1049 + "notNull": false, 1050 + "autoincrement": false 1051 + }, 1052 + "created_at": { 1053 + "name": "created_at", 1054 + "type": "integer", 1055 + "primaryKey": false, 1056 + "notNull": false, 1057 + "autoincrement": false, 1058 + "default": "(strftime('%s', 'now'))" 1059 + }, 1060 + "updated_at": { 1061 + "name": "updated_at", 1062 + "type": "integer", 1063 + "primaryKey": false, 1064 + "notNull": false, 1065 + "autoincrement": false, 1066 + "default": "(strftime('%s', 'now'))" 1067 + } 1068 + }, 1069 + "indexes": { 1070 + "user_tenant_id_unique": { 1071 + "name": "user_tenant_id_unique", 1072 + "columns": [ 1073 + "tenant_id" 1074 + ], 1075 + "isUnique": true 1076 + } 1077 + }, 1078 + "foreignKeys": {}, 1079 + "compositePrimaryKeys": {}, 1080 + "uniqueConstraints": {}, 1081 + "checkConstraints": {} 1082 + }, 1083 + "users_to_workspaces": { 1084 + "name": "users_to_workspaces", 1085 + "columns": { 1086 + "user_id": { 1087 + "name": "user_id", 1088 + "type": "integer", 1089 + "primaryKey": false, 1090 + "notNull": true, 1091 + "autoincrement": false 1092 + }, 1093 + "workspace_id": { 1094 + "name": "workspace_id", 1095 + "type": "integer", 1096 + "primaryKey": false, 1097 + "notNull": true, 1098 + "autoincrement": false 1099 + }, 1100 + "role": { 1101 + "name": "role", 1102 + "type": "text", 1103 + "primaryKey": false, 1104 + "notNull": true, 1105 + "autoincrement": false, 1106 + "default": "'member'" 1107 + }, 1108 + "created_at": { 1109 + "name": "created_at", 1110 + "type": "integer", 1111 + "primaryKey": false, 1112 + "notNull": false, 1113 + "autoincrement": false, 1114 + "default": "(strftime('%s', 'now'))" 1115 + } 1116 + }, 1117 + "indexes": {}, 1118 + "foreignKeys": { 1119 + "users_to_workspaces_user_id_user_id_fk": { 1120 + "name": "users_to_workspaces_user_id_user_id_fk", 1121 + "tableFrom": "users_to_workspaces", 1122 + "tableTo": "user", 1123 + "columnsFrom": [ 1124 + "user_id" 1125 + ], 1126 + "columnsTo": [ 1127 + "id" 1128 + ], 1129 + "onDelete": "no action", 1130 + "onUpdate": "no action" 1131 + }, 1132 + "users_to_workspaces_workspace_id_workspace_id_fk": { 1133 + "name": "users_to_workspaces_workspace_id_workspace_id_fk", 1134 + "tableFrom": "users_to_workspaces", 1135 + "tableTo": "workspace", 1136 + "columnsFrom": [ 1137 + "workspace_id" 1138 + ], 1139 + "columnsTo": [ 1140 + "id" 1141 + ], 1142 + "onDelete": "no action", 1143 + "onUpdate": "no action" 1144 + } 1145 + }, 1146 + "compositePrimaryKeys": { 1147 + "users_to_workspaces_user_id_workspace_id_pk": { 1148 + "columns": [ 1149 + "user_id", 1150 + "workspace_id" 1151 + ], 1152 + "name": "users_to_workspaces_user_id_workspace_id_pk" 1153 + } 1154 + }, 1155 + "uniqueConstraints": {}, 1156 + "checkConstraints": {} 1157 + }, 1158 + "verification_token": { 1159 + "name": "verification_token", 1160 + "columns": { 1161 + "identifier": { 1162 + "name": "identifier", 1163 + "type": "text", 1164 + "primaryKey": false, 1165 + "notNull": true, 1166 + "autoincrement": false 1167 + }, 1168 + "token": { 1169 + "name": "token", 1170 + "type": "text", 1171 + "primaryKey": false, 1172 + "notNull": true, 1173 + "autoincrement": false 1174 + }, 1175 + "expires": { 1176 + "name": "expires", 1177 + "type": "integer", 1178 + "primaryKey": false, 1179 + "notNull": true, 1180 + "autoincrement": false 1181 + } 1182 + }, 1183 + "indexes": {}, 1184 + "foreignKeys": {}, 1185 + "compositePrimaryKeys": { 1186 + "verification_token_identifier_token_pk": { 1187 + "columns": [ 1188 + "identifier", 1189 + "token" 1190 + ], 1191 + "name": "verification_token_identifier_token_pk" 1192 + } 1193 + }, 1194 + "uniqueConstraints": {}, 1195 + "checkConstraints": {} 1196 + }, 1197 + "page_subscriber": { 1198 + "name": "page_subscriber", 1199 + "columns": { 1200 + "id": { 1201 + "name": "id", 1202 + "type": "integer", 1203 + "primaryKey": true, 1204 + "notNull": true, 1205 + "autoincrement": false 1206 + }, 1207 + "email": { 1208 + "name": "email", 1209 + "type": "text", 1210 + "primaryKey": false, 1211 + "notNull": true, 1212 + "autoincrement": false 1213 + }, 1214 + "page_id": { 1215 + "name": "page_id", 1216 + "type": "integer", 1217 + "primaryKey": false, 1218 + "notNull": true, 1219 + "autoincrement": false 1220 + }, 1221 + "token": { 1222 + "name": "token", 1223 + "type": "text", 1224 + "primaryKey": false, 1225 + "notNull": false, 1226 + "autoincrement": false 1227 + }, 1228 + "accepted_at": { 1229 + "name": "accepted_at", 1230 + "type": "integer", 1231 + "primaryKey": false, 1232 + "notNull": false, 1233 + "autoincrement": false 1234 + }, 1235 + "expires_at": { 1236 + "name": "expires_at", 1237 + "type": "integer", 1238 + "primaryKey": false, 1239 + "notNull": false, 1240 + "autoincrement": false 1241 + }, 1242 + "created_at": { 1243 + "name": "created_at", 1244 + "type": "integer", 1245 + "primaryKey": false, 1246 + "notNull": false, 1247 + "autoincrement": false, 1248 + "default": "(strftime('%s', 'now'))" 1249 + }, 1250 + "updated_at": { 1251 + "name": "updated_at", 1252 + "type": "integer", 1253 + "primaryKey": false, 1254 + "notNull": false, 1255 + "autoincrement": false, 1256 + "default": "(strftime('%s', 'now'))" 1257 + } 1258 + }, 1259 + "indexes": {}, 1260 + "foreignKeys": { 1261 + "page_subscriber_page_id_page_id_fk": { 1262 + "name": "page_subscriber_page_id_page_id_fk", 1263 + "tableFrom": "page_subscriber", 1264 + "tableTo": "page", 1265 + "columnsFrom": [ 1266 + "page_id" 1267 + ], 1268 + "columnsTo": [ 1269 + "id" 1270 + ], 1271 + "onDelete": "cascade", 1272 + "onUpdate": "no action" 1273 + } 1274 + }, 1275 + "compositePrimaryKeys": {}, 1276 + "uniqueConstraints": {}, 1277 + "checkConstraints": {} 1278 + }, 1279 + "notification": { 1280 + "name": "notification", 1281 + "columns": { 1282 + "id": { 1283 + "name": "id", 1284 + "type": "integer", 1285 + "primaryKey": true, 1286 + "notNull": true, 1287 + "autoincrement": false 1288 + }, 1289 + "name": { 1290 + "name": "name", 1291 + "type": "text", 1292 + "primaryKey": false, 1293 + "notNull": true, 1294 + "autoincrement": false 1295 + }, 1296 + "provider": { 1297 + "name": "provider", 1298 + "type": "text", 1299 + "primaryKey": false, 1300 + "notNull": true, 1301 + "autoincrement": false 1302 + }, 1303 + "data": { 1304 + "name": "data", 1305 + "type": "text", 1306 + "primaryKey": false, 1307 + "notNull": false, 1308 + "autoincrement": false, 1309 + "default": "'{}'" 1310 + }, 1311 + "workspace_id": { 1312 + "name": "workspace_id", 1313 + "type": "integer", 1314 + "primaryKey": false, 1315 + "notNull": false, 1316 + "autoincrement": false 1317 + }, 1318 + "created_at": { 1319 + "name": "created_at", 1320 + "type": "integer", 1321 + "primaryKey": false, 1322 + "notNull": false, 1323 + "autoincrement": false, 1324 + "default": "(strftime('%s', 'now'))" 1325 + }, 1326 + "updated_at": { 1327 + "name": "updated_at", 1328 + "type": "integer", 1329 + "primaryKey": false, 1330 + "notNull": false, 1331 + "autoincrement": false, 1332 + "default": "(strftime('%s', 'now'))" 1333 + } 1334 + }, 1335 + "indexes": {}, 1336 + "foreignKeys": { 1337 + "notification_workspace_id_workspace_id_fk": { 1338 + "name": "notification_workspace_id_workspace_id_fk", 1339 + "tableFrom": "notification", 1340 + "tableTo": "workspace", 1341 + "columnsFrom": [ 1342 + "workspace_id" 1343 + ], 1344 + "columnsTo": [ 1345 + "id" 1346 + ], 1347 + "onDelete": "no action", 1348 + "onUpdate": "no action" 1349 + } 1350 + }, 1351 + "compositePrimaryKeys": {}, 1352 + "uniqueConstraints": {}, 1353 + "checkConstraints": {} 1354 + }, 1355 + "notifications_to_monitors": { 1356 + "name": "notifications_to_monitors", 1357 + "columns": { 1358 + "monitor_id": { 1359 + "name": "monitor_id", 1360 + "type": "integer", 1361 + "primaryKey": false, 1362 + "notNull": true, 1363 + "autoincrement": false 1364 + }, 1365 + "notification_id": { 1366 + "name": "notification_id", 1367 + "type": "integer", 1368 + "primaryKey": false, 1369 + "notNull": true, 1370 + "autoincrement": false 1371 + }, 1372 + "created_at": { 1373 + "name": "created_at", 1374 + "type": "integer", 1375 + "primaryKey": false, 1376 + "notNull": false, 1377 + "autoincrement": false, 1378 + "default": "(strftime('%s', 'now'))" 1379 + } 1380 + }, 1381 + "indexes": {}, 1382 + "foreignKeys": { 1383 + "notifications_to_monitors_monitor_id_monitor_id_fk": { 1384 + "name": "notifications_to_monitors_monitor_id_monitor_id_fk", 1385 + "tableFrom": "notifications_to_monitors", 1386 + "tableTo": "monitor", 1387 + "columnsFrom": [ 1388 + "monitor_id" 1389 + ], 1390 + "columnsTo": [ 1391 + "id" 1392 + ], 1393 + "onDelete": "cascade", 1394 + "onUpdate": "no action" 1395 + }, 1396 + "notifications_to_monitors_notification_id_notification_id_fk": { 1397 + "name": "notifications_to_monitors_notification_id_notification_id_fk", 1398 + "tableFrom": "notifications_to_monitors", 1399 + "tableTo": "notification", 1400 + "columnsFrom": [ 1401 + "notification_id" 1402 + ], 1403 + "columnsTo": [ 1404 + "id" 1405 + ], 1406 + "onDelete": "cascade", 1407 + "onUpdate": "no action" 1408 + } 1409 + }, 1410 + "compositePrimaryKeys": { 1411 + "notifications_to_monitors_monitor_id_notification_id_pk": { 1412 + "columns": [ 1413 + "monitor_id", 1414 + "notification_id" 1415 + ], 1416 + "name": "notifications_to_monitors_monitor_id_notification_id_pk" 1417 + } 1418 + }, 1419 + "uniqueConstraints": {}, 1420 + "checkConstraints": {} 1421 + }, 1422 + "monitor_status": { 1423 + "name": "monitor_status", 1424 + "columns": { 1425 + "monitor_id": { 1426 + "name": "monitor_id", 1427 + "type": "integer", 1428 + "primaryKey": false, 1429 + "notNull": true, 1430 + "autoincrement": false 1431 + }, 1432 + "region": { 1433 + "name": "region", 1434 + "type": "text", 1435 + "primaryKey": false, 1436 + "notNull": true, 1437 + "autoincrement": false, 1438 + "default": "''" 1439 + }, 1440 + "status": { 1441 + "name": "status", 1442 + "type": "text", 1443 + "primaryKey": false, 1444 + "notNull": true, 1445 + "autoincrement": false, 1446 + "default": "'active'" 1447 + }, 1448 + "created_at": { 1449 + "name": "created_at", 1450 + "type": "integer", 1451 + "primaryKey": false, 1452 + "notNull": false, 1453 + "autoincrement": false, 1454 + "default": "(strftime('%s', 'now'))" 1455 + }, 1456 + "updated_at": { 1457 + "name": "updated_at", 1458 + "type": "integer", 1459 + "primaryKey": false, 1460 + "notNull": false, 1461 + "autoincrement": false, 1462 + "default": "(strftime('%s', 'now'))" 1463 + } 1464 + }, 1465 + "indexes": { 1466 + "monitor_status_idx": { 1467 + "name": "monitor_status_idx", 1468 + "columns": [ 1469 + "monitor_id", 1470 + "region" 1471 + ], 1472 + "isUnique": false 1473 + } 1474 + }, 1475 + "foreignKeys": { 1476 + "monitor_status_monitor_id_monitor_id_fk": { 1477 + "name": "monitor_status_monitor_id_monitor_id_fk", 1478 + "tableFrom": "monitor_status", 1479 + "tableTo": "monitor", 1480 + "columnsFrom": [ 1481 + "monitor_id" 1482 + ], 1483 + "columnsTo": [ 1484 + "id" 1485 + ], 1486 + "onDelete": "cascade", 1487 + "onUpdate": "no action" 1488 + } 1489 + }, 1490 + "compositePrimaryKeys": { 1491 + "monitor_status_monitor_id_region_pk": { 1492 + "columns": [ 1493 + "monitor_id", 1494 + "region" 1495 + ], 1496 + "name": "monitor_status_monitor_id_region_pk" 1497 + } 1498 + }, 1499 + "uniqueConstraints": {}, 1500 + "checkConstraints": {} 1501 + }, 1502 + "invitation": { 1503 + "name": "invitation", 1504 + "columns": { 1505 + "id": { 1506 + "name": "id", 1507 + "type": "integer", 1508 + "primaryKey": true, 1509 + "notNull": true, 1510 + "autoincrement": false 1511 + }, 1512 + "email": { 1513 + "name": "email", 1514 + "type": "text", 1515 + "primaryKey": false, 1516 + "notNull": true, 1517 + "autoincrement": false 1518 + }, 1519 + "role": { 1520 + "name": "role", 1521 + "type": "text", 1522 + "primaryKey": false, 1523 + "notNull": true, 1524 + "autoincrement": false, 1525 + "default": "'member'" 1526 + }, 1527 + "workspace_id": { 1528 + "name": "workspace_id", 1529 + "type": "integer", 1530 + "primaryKey": false, 1531 + "notNull": true, 1532 + "autoincrement": false 1533 + }, 1534 + "token": { 1535 + "name": "token", 1536 + "type": "text", 1537 + "primaryKey": false, 1538 + "notNull": true, 1539 + "autoincrement": false 1540 + }, 1541 + "expires_at": { 1542 + "name": "expires_at", 1543 + "type": "integer", 1544 + "primaryKey": false, 1545 + "notNull": true, 1546 + "autoincrement": false 1547 + }, 1548 + "created_at": { 1549 + "name": "created_at", 1550 + "type": "integer", 1551 + "primaryKey": false, 1552 + "notNull": false, 1553 + "autoincrement": false, 1554 + "default": "(strftime('%s', 'now'))" 1555 + }, 1556 + "accepted_at": { 1557 + "name": "accepted_at", 1558 + "type": "integer", 1559 + "primaryKey": false, 1560 + "notNull": false, 1561 + "autoincrement": false 1562 + } 1563 + }, 1564 + "indexes": {}, 1565 + "foreignKeys": {}, 1566 + "compositePrimaryKeys": {}, 1567 + "uniqueConstraints": {}, 1568 + "checkConstraints": {} 1569 + }, 1570 + "incident": { 1571 + "name": "incident", 1572 + "columns": { 1573 + "id": { 1574 + "name": "id", 1575 + "type": "integer", 1576 + "primaryKey": true, 1577 + "notNull": true, 1578 + "autoincrement": false 1579 + }, 1580 + "title": { 1581 + "name": "title", 1582 + "type": "text", 1583 + "primaryKey": false, 1584 + "notNull": true, 1585 + "autoincrement": false, 1586 + "default": "''" 1587 + }, 1588 + "summary": { 1589 + "name": "summary", 1590 + "type": "text", 1591 + "primaryKey": false, 1592 + "notNull": true, 1593 + "autoincrement": false, 1594 + "default": "''" 1595 + }, 1596 + "status": { 1597 + "name": "status", 1598 + "type": "text", 1599 + "primaryKey": false, 1600 + "notNull": true, 1601 + "autoincrement": false, 1602 + "default": "'triage'" 1603 + }, 1604 + "monitor_id": { 1605 + "name": "monitor_id", 1606 + "type": "integer", 1607 + "primaryKey": false, 1608 + "notNull": false, 1609 + "autoincrement": false 1610 + }, 1611 + "workspace_id": { 1612 + "name": "workspace_id", 1613 + "type": "integer", 1614 + "primaryKey": false, 1615 + "notNull": false, 1616 + "autoincrement": false 1617 + }, 1618 + "started_at": { 1619 + "name": "started_at", 1620 + "type": "integer", 1621 + "primaryKey": false, 1622 + "notNull": true, 1623 + "autoincrement": false, 1624 + "default": "(strftime('%s', 'now'))" 1625 + }, 1626 + "acknowledged_at": { 1627 + "name": "acknowledged_at", 1628 + "type": "integer", 1629 + "primaryKey": false, 1630 + "notNull": false, 1631 + "autoincrement": false 1632 + }, 1633 + "acknowledged_by": { 1634 + "name": "acknowledged_by", 1635 + "type": "integer", 1636 + "primaryKey": false, 1637 + "notNull": false, 1638 + "autoincrement": false 1639 + }, 1640 + "resolved_at": { 1641 + "name": "resolved_at", 1642 + "type": "integer", 1643 + "primaryKey": false, 1644 + "notNull": false, 1645 + "autoincrement": false 1646 + }, 1647 + "resolved_by": { 1648 + "name": "resolved_by", 1649 + "type": "integer", 1650 + "primaryKey": false, 1651 + "notNull": false, 1652 + "autoincrement": false 1653 + }, 1654 + "incident_screenshot_url": { 1655 + "name": "incident_screenshot_url", 1656 + "type": "text", 1657 + "primaryKey": false, 1658 + "notNull": false, 1659 + "autoincrement": false 1660 + }, 1661 + "recovery_screenshot_url": { 1662 + "name": "recovery_screenshot_url", 1663 + "type": "text", 1664 + "primaryKey": false, 1665 + "notNull": false, 1666 + "autoincrement": false 1667 + }, 1668 + "auto_resolved": { 1669 + "name": "auto_resolved", 1670 + "type": "integer", 1671 + "primaryKey": false, 1672 + "notNull": false, 1673 + "autoincrement": false, 1674 + "default": false 1675 + }, 1676 + "created_at": { 1677 + "name": "created_at", 1678 + "type": "integer", 1679 + "primaryKey": false, 1680 + "notNull": false, 1681 + "autoincrement": false, 1682 + "default": "(strftime('%s', 'now'))" 1683 + }, 1684 + "updated_at": { 1685 + "name": "updated_at", 1686 + "type": "integer", 1687 + "primaryKey": false, 1688 + "notNull": false, 1689 + "autoincrement": false, 1690 + "default": "(strftime('%s', 'now'))" 1691 + } 1692 + }, 1693 + "indexes": { 1694 + "incident_monitor_id_started_at_unique": { 1695 + "name": "incident_monitor_id_started_at_unique", 1696 + "columns": [ 1697 + "monitor_id", 1698 + "started_at" 1699 + ], 1700 + "isUnique": true 1701 + } 1702 + }, 1703 + "foreignKeys": { 1704 + "incident_monitor_id_monitor_id_fk": { 1705 + "name": "incident_monitor_id_monitor_id_fk", 1706 + "tableFrom": "incident", 1707 + "tableTo": "monitor", 1708 + "columnsFrom": [ 1709 + "monitor_id" 1710 + ], 1711 + "columnsTo": [ 1712 + "id" 1713 + ], 1714 + "onDelete": "set default", 1715 + "onUpdate": "no action" 1716 + }, 1717 + "incident_workspace_id_workspace_id_fk": { 1718 + "name": "incident_workspace_id_workspace_id_fk", 1719 + "tableFrom": "incident", 1720 + "tableTo": "workspace", 1721 + "columnsFrom": [ 1722 + "workspace_id" 1723 + ], 1724 + "columnsTo": [ 1725 + "id" 1726 + ], 1727 + "onDelete": "no action", 1728 + "onUpdate": "no action" 1729 + }, 1730 + "incident_acknowledged_by_user_id_fk": { 1731 + "name": "incident_acknowledged_by_user_id_fk", 1732 + "tableFrom": "incident", 1733 + "tableTo": "user", 1734 + "columnsFrom": [ 1735 + "acknowledged_by" 1736 + ], 1737 + "columnsTo": [ 1738 + "id" 1739 + ], 1740 + "onDelete": "no action", 1741 + "onUpdate": "no action" 1742 + }, 1743 + "incident_resolved_by_user_id_fk": { 1744 + "name": "incident_resolved_by_user_id_fk", 1745 + "tableFrom": "incident", 1746 + "tableTo": "user", 1747 + "columnsFrom": [ 1748 + "resolved_by" 1749 + ], 1750 + "columnsTo": [ 1751 + "id" 1752 + ], 1753 + "onDelete": "no action", 1754 + "onUpdate": "no action" 1755 + } 1756 + }, 1757 + "compositePrimaryKeys": {}, 1758 + "uniqueConstraints": {}, 1759 + "checkConstraints": {} 1760 + }, 1761 + "monitor_tag": { 1762 + "name": "monitor_tag", 1763 + "columns": { 1764 + "id": { 1765 + "name": "id", 1766 + "type": "integer", 1767 + "primaryKey": true, 1768 + "notNull": true, 1769 + "autoincrement": false 1770 + }, 1771 + "workspace_id": { 1772 + "name": "workspace_id", 1773 + "type": "integer", 1774 + "primaryKey": false, 1775 + "notNull": true, 1776 + "autoincrement": false 1777 + }, 1778 + "name": { 1779 + "name": "name", 1780 + "type": "text", 1781 + "primaryKey": false, 1782 + "notNull": true, 1783 + "autoincrement": false 1784 + }, 1785 + "color": { 1786 + "name": "color", 1787 + "type": "text", 1788 + "primaryKey": false, 1789 + "notNull": true, 1790 + "autoincrement": false 1791 + }, 1792 + "created_at": { 1793 + "name": "created_at", 1794 + "type": "integer", 1795 + "primaryKey": false, 1796 + "notNull": false, 1797 + "autoincrement": false, 1798 + "default": "(strftime('%s', 'now'))" 1799 + }, 1800 + "updated_at": { 1801 + "name": "updated_at", 1802 + "type": "integer", 1803 + "primaryKey": false, 1804 + "notNull": false, 1805 + "autoincrement": false, 1806 + "default": "(strftime('%s', 'now'))" 1807 + } 1808 + }, 1809 + "indexes": {}, 1810 + "foreignKeys": { 1811 + "monitor_tag_workspace_id_workspace_id_fk": { 1812 + "name": "monitor_tag_workspace_id_workspace_id_fk", 1813 + "tableFrom": "monitor_tag", 1814 + "tableTo": "workspace", 1815 + "columnsFrom": [ 1816 + "workspace_id" 1817 + ], 1818 + "columnsTo": [ 1819 + "id" 1820 + ], 1821 + "onDelete": "cascade", 1822 + "onUpdate": "no action" 1823 + } 1824 + }, 1825 + "compositePrimaryKeys": {}, 1826 + "uniqueConstraints": {}, 1827 + "checkConstraints": {} 1828 + }, 1829 + "monitor_tag_to_monitor": { 1830 + "name": "monitor_tag_to_monitor", 1831 + "columns": { 1832 + "monitor_id": { 1833 + "name": "monitor_id", 1834 + "type": "integer", 1835 + "primaryKey": false, 1836 + "notNull": true, 1837 + "autoincrement": false 1838 + }, 1839 + "monitor_tag_id": { 1840 + "name": "monitor_tag_id", 1841 + "type": "integer", 1842 + "primaryKey": false, 1843 + "notNull": true, 1844 + "autoincrement": false 1845 + }, 1846 + "created_at": { 1847 + "name": "created_at", 1848 + "type": "integer", 1849 + "primaryKey": false, 1850 + "notNull": false, 1851 + "autoincrement": false, 1852 + "default": "(strftime('%s', 'now'))" 1853 + } 1854 + }, 1855 + "indexes": {}, 1856 + "foreignKeys": { 1857 + "monitor_tag_to_monitor_monitor_id_monitor_id_fk": { 1858 + "name": "monitor_tag_to_monitor_monitor_id_monitor_id_fk", 1859 + "tableFrom": "monitor_tag_to_monitor", 1860 + "tableTo": "monitor", 1861 + "columnsFrom": [ 1862 + "monitor_id" 1863 + ], 1864 + "columnsTo": [ 1865 + "id" 1866 + ], 1867 + "onDelete": "cascade", 1868 + "onUpdate": "no action" 1869 + }, 1870 + "monitor_tag_to_monitor_monitor_tag_id_monitor_tag_id_fk": { 1871 + "name": "monitor_tag_to_monitor_monitor_tag_id_monitor_tag_id_fk", 1872 + "tableFrom": "monitor_tag_to_monitor", 1873 + "tableTo": "monitor_tag", 1874 + "columnsFrom": [ 1875 + "monitor_tag_id" 1876 + ], 1877 + "columnsTo": [ 1878 + "id" 1879 + ], 1880 + "onDelete": "cascade", 1881 + "onUpdate": "no action" 1882 + } 1883 + }, 1884 + "compositePrimaryKeys": { 1885 + "monitor_tag_to_monitor_monitor_id_monitor_tag_id_pk": { 1886 + "columns": [ 1887 + "monitor_id", 1888 + "monitor_tag_id" 1889 + ], 1890 + "name": "monitor_tag_to_monitor_monitor_id_monitor_tag_id_pk" 1891 + } 1892 + }, 1893 + "uniqueConstraints": {}, 1894 + "checkConstraints": {} 1895 + }, 1896 + "application": { 1897 + "name": "application", 1898 + "columns": { 1899 + "id": { 1900 + "name": "id", 1901 + "type": "integer", 1902 + "primaryKey": true, 1903 + "notNull": true, 1904 + "autoincrement": false 1905 + }, 1906 + "name": { 1907 + "name": "name", 1908 + "type": "text", 1909 + "primaryKey": false, 1910 + "notNull": false, 1911 + "autoincrement": false 1912 + }, 1913 + "dsn": { 1914 + "name": "dsn", 1915 + "type": "text", 1916 + "primaryKey": false, 1917 + "notNull": false, 1918 + "autoincrement": false 1919 + }, 1920 + "workspace_id": { 1921 + "name": "workspace_id", 1922 + "type": "integer", 1923 + "primaryKey": false, 1924 + "notNull": false, 1925 + "autoincrement": false 1926 + }, 1927 + "created_at": { 1928 + "name": "created_at", 1929 + "type": "integer", 1930 + "primaryKey": false, 1931 + "notNull": false, 1932 + "autoincrement": false, 1933 + "default": "(strftime('%s', 'now'))" 1934 + }, 1935 + "updated_at": { 1936 + "name": "updated_at", 1937 + "type": "integer", 1938 + "primaryKey": false, 1939 + "notNull": false, 1940 + "autoincrement": false, 1941 + "default": "(strftime('%s', 'now'))" 1942 + } 1943 + }, 1944 + "indexes": { 1945 + "application_dsn_unique": { 1946 + "name": "application_dsn_unique", 1947 + "columns": [ 1948 + "dsn" 1949 + ], 1950 + "isUnique": true 1951 + } 1952 + }, 1953 + "foreignKeys": { 1954 + "application_workspace_id_workspace_id_fk": { 1955 + "name": "application_workspace_id_workspace_id_fk", 1956 + "tableFrom": "application", 1957 + "tableTo": "workspace", 1958 + "columnsFrom": [ 1959 + "workspace_id" 1960 + ], 1961 + "columnsTo": [ 1962 + "id" 1963 + ], 1964 + "onDelete": "no action", 1965 + "onUpdate": "no action" 1966 + } 1967 + }, 1968 + "compositePrimaryKeys": {}, 1969 + "uniqueConstraints": {}, 1970 + "checkConstraints": {} 1971 + }, 1972 + "maintenance": { 1973 + "name": "maintenance", 1974 + "columns": { 1975 + "id": { 1976 + "name": "id", 1977 + "type": "integer", 1978 + "primaryKey": true, 1979 + "notNull": true, 1980 + "autoincrement": false 1981 + }, 1982 + "title": { 1983 + "name": "title", 1984 + "type": "text(256)", 1985 + "primaryKey": false, 1986 + "notNull": true, 1987 + "autoincrement": false 1988 + }, 1989 + "message": { 1990 + "name": "message", 1991 + "type": "text", 1992 + "primaryKey": false, 1993 + "notNull": true, 1994 + "autoincrement": false 1995 + }, 1996 + "from": { 1997 + "name": "from", 1998 + "type": "integer", 1999 + "primaryKey": false, 2000 + "notNull": true, 2001 + "autoincrement": false 2002 + }, 2003 + "to": { 2004 + "name": "to", 2005 + "type": "integer", 2006 + "primaryKey": false, 2007 + "notNull": true, 2008 + "autoincrement": false 2009 + }, 2010 + "workspace_id": { 2011 + "name": "workspace_id", 2012 + "type": "integer", 2013 + "primaryKey": false, 2014 + "notNull": false, 2015 + "autoincrement": false 2016 + }, 2017 + "page_id": { 2018 + "name": "page_id", 2019 + "type": "integer", 2020 + "primaryKey": false, 2021 + "notNull": false, 2022 + "autoincrement": false 2023 + }, 2024 + "created_at": { 2025 + "name": "created_at", 2026 + "type": "integer", 2027 + "primaryKey": false, 2028 + "notNull": false, 2029 + "autoincrement": false, 2030 + "default": "(strftime('%s', 'now'))" 2031 + }, 2032 + "updated_at": { 2033 + "name": "updated_at", 2034 + "type": "integer", 2035 + "primaryKey": false, 2036 + "notNull": false, 2037 + "autoincrement": false, 2038 + "default": "(strftime('%s', 'now'))" 2039 + } 2040 + }, 2041 + "indexes": {}, 2042 + "foreignKeys": { 2043 + "maintenance_workspace_id_workspace_id_fk": { 2044 + "name": "maintenance_workspace_id_workspace_id_fk", 2045 + "tableFrom": "maintenance", 2046 + "tableTo": "workspace", 2047 + "columnsFrom": [ 2048 + "workspace_id" 2049 + ], 2050 + "columnsTo": [ 2051 + "id" 2052 + ], 2053 + "onDelete": "no action", 2054 + "onUpdate": "no action" 2055 + }, 2056 + "maintenance_page_id_page_id_fk": { 2057 + "name": "maintenance_page_id_page_id_fk", 2058 + "tableFrom": "maintenance", 2059 + "tableTo": "page", 2060 + "columnsFrom": [ 2061 + "page_id" 2062 + ], 2063 + "columnsTo": [ 2064 + "id" 2065 + ], 2066 + "onDelete": "no action", 2067 + "onUpdate": "no action" 2068 + } 2069 + }, 2070 + "compositePrimaryKeys": {}, 2071 + "uniqueConstraints": {}, 2072 + "checkConstraints": {} 2073 + }, 2074 + "maintenance_to_monitor": { 2075 + "name": "maintenance_to_monitor", 2076 + "columns": { 2077 + "maintenance_id": { 2078 + "name": "maintenance_id", 2079 + "type": "integer", 2080 + "primaryKey": false, 2081 + "notNull": true, 2082 + "autoincrement": false 2083 + }, 2084 + "monitor_id": { 2085 + "name": "monitor_id", 2086 + "type": "integer", 2087 + "primaryKey": false, 2088 + "notNull": true, 2089 + "autoincrement": false 2090 + }, 2091 + "created_at": { 2092 + "name": "created_at", 2093 + "type": "integer", 2094 + "primaryKey": false, 2095 + "notNull": false, 2096 + "autoincrement": false, 2097 + "default": "(strftime('%s', 'now'))" 2098 + } 2099 + }, 2100 + "indexes": {}, 2101 + "foreignKeys": { 2102 + "maintenance_to_monitor_maintenance_id_maintenance_id_fk": { 2103 + "name": "maintenance_to_monitor_maintenance_id_maintenance_id_fk", 2104 + "tableFrom": "maintenance_to_monitor", 2105 + "tableTo": "maintenance", 2106 + "columnsFrom": [ 2107 + "maintenance_id" 2108 + ], 2109 + "columnsTo": [ 2110 + "id" 2111 + ], 2112 + "onDelete": "cascade", 2113 + "onUpdate": "no action" 2114 + }, 2115 + "maintenance_to_monitor_monitor_id_monitor_id_fk": { 2116 + "name": "maintenance_to_monitor_monitor_id_monitor_id_fk", 2117 + "tableFrom": "maintenance_to_monitor", 2118 + "tableTo": "monitor", 2119 + "columnsFrom": [ 2120 + "monitor_id" 2121 + ], 2122 + "columnsTo": [ 2123 + "id" 2124 + ], 2125 + "onDelete": "cascade", 2126 + "onUpdate": "no action" 2127 + } 2128 + }, 2129 + "compositePrimaryKeys": { 2130 + "maintenance_to_monitor_maintenance_id_monitor_id_pk": { 2131 + "columns": [ 2132 + "maintenance_id", 2133 + "monitor_id" 2134 + ], 2135 + "name": "maintenance_to_monitor_maintenance_id_monitor_id_pk" 2136 + } 2137 + }, 2138 + "uniqueConstraints": {}, 2139 + "checkConstraints": {} 2140 + }, 2141 + "check": { 2142 + "name": "check", 2143 + "columns": { 2144 + "id": { 2145 + "name": "id", 2146 + "type": "integer", 2147 + "primaryKey": true, 2148 + "notNull": true, 2149 + "autoincrement": true 2150 + }, 2151 + "regions": { 2152 + "name": "regions", 2153 + "type": "text", 2154 + "primaryKey": false, 2155 + "notNull": true, 2156 + "autoincrement": false, 2157 + "default": "''" 2158 + }, 2159 + "url": { 2160 + "name": "url", 2161 + "type": "text(4096)", 2162 + "primaryKey": false, 2163 + "notNull": true, 2164 + "autoincrement": false 2165 + }, 2166 + "headers": { 2167 + "name": "headers", 2168 + "type": "text", 2169 + "primaryKey": false, 2170 + "notNull": false, 2171 + "autoincrement": false, 2172 + "default": "''" 2173 + }, 2174 + "body": { 2175 + "name": "body", 2176 + "type": "text", 2177 + "primaryKey": false, 2178 + "notNull": false, 2179 + "autoincrement": false, 2180 + "default": "''" 2181 + }, 2182 + "method": { 2183 + "name": "method", 2184 + "type": "text", 2185 + "primaryKey": false, 2186 + "notNull": false, 2187 + "autoincrement": false, 2188 + "default": "'GET'" 2189 + }, 2190 + "count_requests": { 2191 + "name": "count_requests", 2192 + "type": "integer", 2193 + "primaryKey": false, 2194 + "notNull": false, 2195 + "autoincrement": false, 2196 + "default": 1 2197 + }, 2198 + "workspace_id": { 2199 + "name": "workspace_id", 2200 + "type": "integer", 2201 + "primaryKey": false, 2202 + "notNull": false, 2203 + "autoincrement": false 2204 + }, 2205 + "created_at": { 2206 + "name": "created_at", 2207 + "type": "integer", 2208 + "primaryKey": false, 2209 + "notNull": false, 2210 + "autoincrement": false, 2211 + "default": "(strftime('%s', 'now'))" 2212 + } 2213 + }, 2214 + "indexes": {}, 2215 + "foreignKeys": { 2216 + "check_workspace_id_workspace_id_fk": { 2217 + "name": "check_workspace_id_workspace_id_fk", 2218 + "tableFrom": "check", 2219 + "tableTo": "workspace", 2220 + "columnsFrom": [ 2221 + "workspace_id" 2222 + ], 2223 + "columnsTo": [ 2224 + "id" 2225 + ], 2226 + "onDelete": "no action", 2227 + "onUpdate": "no action" 2228 + } 2229 + }, 2230 + "compositePrimaryKeys": {}, 2231 + "uniqueConstraints": {}, 2232 + "checkConstraints": {} 2233 + }, 2234 + "monitor_run": { 2235 + "name": "monitor_run", 2236 + "columns": { 2237 + "id": { 2238 + "name": "id", 2239 + "type": "integer", 2240 + "primaryKey": true, 2241 + "notNull": true, 2242 + "autoincrement": false 2243 + }, 2244 + "workspace_id": { 2245 + "name": "workspace_id", 2246 + "type": "integer", 2247 + "primaryKey": false, 2248 + "notNull": false, 2249 + "autoincrement": false 2250 + }, 2251 + "monitor_id": { 2252 + "name": "monitor_id", 2253 + "type": "integer", 2254 + "primaryKey": false, 2255 + "notNull": false, 2256 + "autoincrement": false 2257 + }, 2258 + "runned_at": { 2259 + "name": "runned_at", 2260 + "type": "integer", 2261 + "primaryKey": false, 2262 + "notNull": false, 2263 + "autoincrement": false 2264 + }, 2265 + "created_at": { 2266 + "name": "created_at", 2267 + "type": "integer", 2268 + "primaryKey": false, 2269 + "notNull": false, 2270 + "autoincrement": false, 2271 + "default": "(strftime('%s', 'now'))" 2272 + } 2273 + }, 2274 + "indexes": {}, 2275 + "foreignKeys": { 2276 + "monitor_run_workspace_id_workspace_id_fk": { 2277 + "name": "monitor_run_workspace_id_workspace_id_fk", 2278 + "tableFrom": "monitor_run", 2279 + "tableTo": "workspace", 2280 + "columnsFrom": [ 2281 + "workspace_id" 2282 + ], 2283 + "columnsTo": [ 2284 + "id" 2285 + ], 2286 + "onDelete": "no action", 2287 + "onUpdate": "no action" 2288 + }, 2289 + "monitor_run_monitor_id_monitor_id_fk": { 2290 + "name": "monitor_run_monitor_id_monitor_id_fk", 2291 + "tableFrom": "monitor_run", 2292 + "tableTo": "monitor", 2293 + "columnsFrom": [ 2294 + "monitor_id" 2295 + ], 2296 + "columnsTo": [ 2297 + "id" 2298 + ], 2299 + "onDelete": "no action", 2300 + "onUpdate": "no action" 2301 + } 2302 + }, 2303 + "compositePrimaryKeys": {}, 2304 + "uniqueConstraints": {}, 2305 + "checkConstraints": {} 2306 + } 2307 + }, 2308 + "views": {}, 2309 + "enums": {}, 2310 + "_meta": { 2311 + "schemas": {}, 2312 + "tables": {}, 2313 + "columns": {} 2314 + }, 2315 + "internal": { 2316 + "indexes": {} 2317 + } 2318 + }
+7
packages/db/drizzle/meta/_journal.json
··· 281 281 "when": 1739193014150, 282 282 "tag": "0039_lonely_jigsaw", 283 283 "breakpoints": true 284 + }, 285 + { 286 + "idx": 40, 287 + "version": "6", 288 + "when": 1740684132626, 289 + "tag": "0040_narrow_anthem", 290 + "breakpoints": true 284 291 } 285 292 ] 286 293 }
+1 -1
packages/db/src/schema/page_subscribers/page_subscribers.ts
··· 9 9 10 10 pageId: integer("page_id") 11 11 .notNull() 12 - .references(() => page.id), 12 + .references(() => page.id, { onDelete: "cascade" }), 13 13 14 14 token: text("token"), 15 15 acceptedAt: integer("accepted_at", { mode: "timestamp" }),