Openstatus www.openstatus.dev

๐Ÿš€ Add retry (#1261)

* โŽ add retry policy

* ๐Ÿš€ api

* ๐Ÿš€

authored by

Thibault Le Ouay and committed by
GitHub
989de62f 50573c26

+2440 -8
+9 -3
apps/checker/handlers/checker.go
··· 95 95 96 96 var result checker.Response 97 97 98 + var retry int 99 + if req.Retry == 0 { 100 + retry = int(req.Retry) 101 + } else { 102 + retry = 3 103 + } 104 + 98 105 op := func() error { 99 106 called++ 100 107 res, err := checker.Http(ctx, requestClient, req) ··· 152 159 statusCode := statusCode(res.Status) 153 160 154 161 var isSuccessfull bool = true 155 - 156 162 if len(req.RawAssertions) > 0 { 157 163 for _, a := range req.RawAssertions { 158 164 var assert request.Assertion ··· 195 201 } 196 202 197 203 // let's retry at least once if the status code is not successful. 198 - if !isSuccessfull && called < 2 { 204 + if !isSuccessfull && called < retry { 199 205 return fmt.Errorf("unable to ping: %v with status %v", res, res.Status) 200 206 } 201 207 ··· 277 283 return nil 278 284 } 279 285 280 - if err := backoff.Retry(op, backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 3)); err != nil { 286 + if err := backoff.Retry(op, backoff.WithMaxRetries(backoff.NewExponentialBackOff(), uint64(retry))); err != nil { 281 287 id, e := uuid.NewV7() 282 288 if e != nil { 283 289 log.Ctx(ctx).Error().Err(e).Msg("failed to send event to tinybird")
+8 -3
apps/checker/handlers/tcp.go
··· 86 86 trigger = req.Trigger 87 87 } 88 88 89 - var called int 90 89 91 90 var response checker.TCPResponse 92 91 92 + var retry int 93 + if req.Retry == 0 { 94 + retry = int(req.Retry) 95 + } else { 96 + retry = 3 97 + } 98 + 93 99 op := func() error { 94 - called++ 95 100 res, err := checker.PingTcp(int(req.Timeout), req.URI) 96 101 97 102 if err != nil { ··· 193 198 return nil 194 199 } 195 200 196 - if err := backoff.Retry(op, backoff.WithMaxRetries(backoff.NewExponentialBackOff(), 3)); err != nil { 201 + if err := backoff.Retry(op, backoff.WithMaxRetries(backoff.NewExponentialBackOff(), uint64(retry))); err != nil { 197 202 198 203 id, e := uuid.NewV7() 199 204 if e != nil {
+2
apps/checker/request/request.go
··· 61 61 CronTimestamp int64 `json:"cronTimestamp"` 62 62 Timeout int64 `json:"timeout"` 63 63 DegradedAfter int64 `json:"degradedAfter,omitempty"` 64 + Retry int64 `json:"retry,omitempty"` 64 65 OtelConfig struct { 65 66 Endpoint string `json:"endpoint"` 66 67 Headers map[string]string `json:"headers,omitempty"` ··· 78 79 CronTimestamp int64 `json:"cronTimestamp"` 79 80 Timeout int64 `json:"timeout"` 80 81 DegradedAfter int64 `json:"degradedAfter,omitempty"` 82 + Retry int64 `json:"retry,omitempty"` 81 83 OtelConfig struct { 82 84 Endpoint string `json:"endpoint"` 83 85 Headers map[string]string `json:"headers,omitempty"`
+3
apps/server/src/routes/v1/monitors/schema.ts
··· 200 200 timeout: z.number().nullish().default(45000).openapi({ 201 201 description: "The timeout of the request in milliseconds", 202 202 }), 203 + retry: z.number().default(3).openapi({ 204 + description: "The number of retries to attempt", 205 + }), 203 206 jobType: z.enum(monitorJobTypes).optional().default("http").openapi({ 204 207 description: "The type of the monitor", 205 208 }),
+2
apps/web/src/app/api/checker/cron/_cron.ts
··· 186 186 headers: transformHeaders(row.otelHeaders), 187 187 } 188 188 : undefined, 189 + retry: row.retry || 3, 189 190 }; 190 191 } 191 192 if (row.jobType === "tcp") { ··· 199 200 degradedAfter: row.degradedAfter, 200 201 timeout: row.timeout, 201 202 trigger: "cron", 203 + retry: row.retry || 3, 202 204 otelConfig: row.otelEndpoint 203 205 ? { 204 206 endpoint: row.otelEndpoint,
+1
packages/db/drizzle/0043_low_lily_hollister.sql
··· 1 + ALTER TABLE `monitor` ADD `retry` integer DEFAULT 3;
+2401
packages/db/drizzle/meta/0043_snapshot.json
··· 1 + { 2 + "version": "6", 3 + "dialect": "sqlite", 4 + "id": "5ab3a069-5948-479e-8763-b5546564c0cc", 5 + "prevId": "42f5ca77-ee56-4d55-bea0-c4767a026152", 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": "cascade", 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", 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 + "retry": { 597 + "name": "retry", 598 + "type": "integer", 599 + "primaryKey": false, 600 + "notNull": false, 601 + "autoincrement": false, 602 + "default": 3 603 + }, 604 + "created_at": { 605 + "name": "created_at", 606 + "type": "integer", 607 + "primaryKey": false, 608 + "notNull": false, 609 + "autoincrement": false, 610 + "default": "(strftime('%s', 'now'))" 611 + }, 612 + "updated_at": { 613 + "name": "updated_at", 614 + "type": "integer", 615 + "primaryKey": false, 616 + "notNull": false, 617 + "autoincrement": false, 618 + "default": "(strftime('%s', 'now'))" 619 + }, 620 + "deleted_at": { 621 + "name": "deleted_at", 622 + "type": "integer", 623 + "primaryKey": false, 624 + "notNull": false, 625 + "autoincrement": false 626 + } 627 + }, 628 + "indexes": {}, 629 + "foreignKeys": { 630 + "monitor_workspace_id_workspace_id_fk": { 631 + "name": "monitor_workspace_id_workspace_id_fk", 632 + "tableFrom": "monitor", 633 + "tableTo": "workspace", 634 + "columnsFrom": [ 635 + "workspace_id" 636 + ], 637 + "columnsTo": [ 638 + "id" 639 + ], 640 + "onDelete": "no action", 641 + "onUpdate": "no action" 642 + } 643 + }, 644 + "compositePrimaryKeys": {}, 645 + "uniqueConstraints": {}, 646 + "checkConstraints": {} 647 + }, 648 + "monitors_to_pages": { 649 + "name": "monitors_to_pages", 650 + "columns": { 651 + "monitor_id": { 652 + "name": "monitor_id", 653 + "type": "integer", 654 + "primaryKey": false, 655 + "notNull": true, 656 + "autoincrement": false 657 + }, 658 + "page_id": { 659 + "name": "page_id", 660 + "type": "integer", 661 + "primaryKey": false, 662 + "notNull": true, 663 + "autoincrement": false 664 + }, 665 + "created_at": { 666 + "name": "created_at", 667 + "type": "integer", 668 + "primaryKey": false, 669 + "notNull": false, 670 + "autoincrement": false, 671 + "default": "(strftime('%s', 'now'))" 672 + }, 673 + "order": { 674 + "name": "order", 675 + "type": "integer", 676 + "primaryKey": false, 677 + "notNull": false, 678 + "autoincrement": false, 679 + "default": 0 680 + } 681 + }, 682 + "indexes": {}, 683 + "foreignKeys": { 684 + "monitors_to_pages_monitor_id_monitor_id_fk": { 685 + "name": "monitors_to_pages_monitor_id_monitor_id_fk", 686 + "tableFrom": "monitors_to_pages", 687 + "tableTo": "monitor", 688 + "columnsFrom": [ 689 + "monitor_id" 690 + ], 691 + "columnsTo": [ 692 + "id" 693 + ], 694 + "onDelete": "cascade", 695 + "onUpdate": "no action" 696 + }, 697 + "monitors_to_pages_page_id_page_id_fk": { 698 + "name": "monitors_to_pages_page_id_page_id_fk", 699 + "tableFrom": "monitors_to_pages", 700 + "tableTo": "page", 701 + "columnsFrom": [ 702 + "page_id" 703 + ], 704 + "columnsTo": [ 705 + "id" 706 + ], 707 + "onDelete": "cascade", 708 + "onUpdate": "no action" 709 + } 710 + }, 711 + "compositePrimaryKeys": { 712 + "monitors_to_pages_monitor_id_page_id_pk": { 713 + "columns": [ 714 + "monitor_id", 715 + "page_id" 716 + ], 717 + "name": "monitors_to_pages_monitor_id_page_id_pk" 718 + } 719 + }, 720 + "uniqueConstraints": {}, 721 + "checkConstraints": {} 722 + }, 723 + "workspace": { 724 + "name": "workspace", 725 + "columns": { 726 + "id": { 727 + "name": "id", 728 + "type": "integer", 729 + "primaryKey": true, 730 + "notNull": true, 731 + "autoincrement": false 732 + }, 733 + "slug": { 734 + "name": "slug", 735 + "type": "text", 736 + "primaryKey": false, 737 + "notNull": true, 738 + "autoincrement": false 739 + }, 740 + "name": { 741 + "name": "name", 742 + "type": "text", 743 + "primaryKey": false, 744 + "notNull": false, 745 + "autoincrement": false 746 + }, 747 + "stripe_id": { 748 + "name": "stripe_id", 749 + "type": "text(256)", 750 + "primaryKey": false, 751 + "notNull": false, 752 + "autoincrement": false 753 + }, 754 + "subscription_id": { 755 + "name": "subscription_id", 756 + "type": "text", 757 + "primaryKey": false, 758 + "notNull": false, 759 + "autoincrement": false 760 + }, 761 + "plan": { 762 + "name": "plan", 763 + "type": "text", 764 + "primaryKey": false, 765 + "notNull": false, 766 + "autoincrement": false 767 + }, 768 + "ends_at": { 769 + "name": "ends_at", 770 + "type": "integer", 771 + "primaryKey": false, 772 + "notNull": false, 773 + "autoincrement": false 774 + }, 775 + "paid_until": { 776 + "name": "paid_until", 777 + "type": "integer", 778 + "primaryKey": false, 779 + "notNull": false, 780 + "autoincrement": false 781 + }, 782 + "limits": { 783 + "name": "limits", 784 + "type": "text", 785 + "primaryKey": false, 786 + "notNull": true, 787 + "autoincrement": false, 788 + "default": "'{}'" 789 + }, 790 + "created_at": { 791 + "name": "created_at", 792 + "type": "integer", 793 + "primaryKey": false, 794 + "notNull": false, 795 + "autoincrement": false, 796 + "default": "(strftime('%s', 'now'))" 797 + }, 798 + "updated_at": { 799 + "name": "updated_at", 800 + "type": "integer", 801 + "primaryKey": false, 802 + "notNull": false, 803 + "autoincrement": false, 804 + "default": "(strftime('%s', 'now'))" 805 + }, 806 + "dsn": { 807 + "name": "dsn", 808 + "type": "text", 809 + "primaryKey": false, 810 + "notNull": false, 811 + "autoincrement": false 812 + } 813 + }, 814 + "indexes": { 815 + "workspace_slug_unique": { 816 + "name": "workspace_slug_unique", 817 + "columns": [ 818 + "slug" 819 + ], 820 + "isUnique": true 821 + }, 822 + "workspace_stripe_id_unique": { 823 + "name": "workspace_stripe_id_unique", 824 + "columns": [ 825 + "stripe_id" 826 + ], 827 + "isUnique": true 828 + }, 829 + "workspace_id_dsn_unique": { 830 + "name": "workspace_id_dsn_unique", 831 + "columns": [ 832 + "id", 833 + "dsn" 834 + ], 835 + "isUnique": true 836 + } 837 + }, 838 + "foreignKeys": {}, 839 + "compositePrimaryKeys": {}, 840 + "uniqueConstraints": {}, 841 + "checkConstraints": {} 842 + }, 843 + "account": { 844 + "name": "account", 845 + "columns": { 846 + "user_id": { 847 + "name": "user_id", 848 + "type": "integer", 849 + "primaryKey": false, 850 + "notNull": true, 851 + "autoincrement": false 852 + }, 853 + "type": { 854 + "name": "type", 855 + "type": "text", 856 + "primaryKey": false, 857 + "notNull": true, 858 + "autoincrement": false 859 + }, 860 + "provider": { 861 + "name": "provider", 862 + "type": "text", 863 + "primaryKey": false, 864 + "notNull": true, 865 + "autoincrement": false 866 + }, 867 + "provider_account_id": { 868 + "name": "provider_account_id", 869 + "type": "text", 870 + "primaryKey": false, 871 + "notNull": true, 872 + "autoincrement": false 873 + }, 874 + "refresh_token": { 875 + "name": "refresh_token", 876 + "type": "text", 877 + "primaryKey": false, 878 + "notNull": false, 879 + "autoincrement": false 880 + }, 881 + "access_token": { 882 + "name": "access_token", 883 + "type": "text", 884 + "primaryKey": false, 885 + "notNull": false, 886 + "autoincrement": false 887 + }, 888 + "expires_at": { 889 + "name": "expires_at", 890 + "type": "integer", 891 + "primaryKey": false, 892 + "notNull": false, 893 + "autoincrement": false 894 + }, 895 + "token_type": { 896 + "name": "token_type", 897 + "type": "text", 898 + "primaryKey": false, 899 + "notNull": false, 900 + "autoincrement": false 901 + }, 902 + "scope": { 903 + "name": "scope", 904 + "type": "text", 905 + "primaryKey": false, 906 + "notNull": false, 907 + "autoincrement": false 908 + }, 909 + "id_token": { 910 + "name": "id_token", 911 + "type": "text", 912 + "primaryKey": false, 913 + "notNull": false, 914 + "autoincrement": false 915 + }, 916 + "session_state": { 917 + "name": "session_state", 918 + "type": "text", 919 + "primaryKey": false, 920 + "notNull": false, 921 + "autoincrement": false 922 + } 923 + }, 924 + "indexes": {}, 925 + "foreignKeys": { 926 + "account_user_id_user_id_fk": { 927 + "name": "account_user_id_user_id_fk", 928 + "tableFrom": "account", 929 + "tableTo": "user", 930 + "columnsFrom": [ 931 + "user_id" 932 + ], 933 + "columnsTo": [ 934 + "id" 935 + ], 936 + "onDelete": "cascade", 937 + "onUpdate": "no action" 938 + } 939 + }, 940 + "compositePrimaryKeys": { 941 + "account_provider_provider_account_id_pk": { 942 + "columns": [ 943 + "provider", 944 + "provider_account_id" 945 + ], 946 + "name": "account_provider_provider_account_id_pk" 947 + } 948 + }, 949 + "uniqueConstraints": {}, 950 + "checkConstraints": {} 951 + }, 952 + "session": { 953 + "name": "session", 954 + "columns": { 955 + "session_token": { 956 + "name": "session_token", 957 + "type": "text", 958 + "primaryKey": true, 959 + "notNull": true, 960 + "autoincrement": false 961 + }, 962 + "user_id": { 963 + "name": "user_id", 964 + "type": "integer", 965 + "primaryKey": false, 966 + "notNull": true, 967 + "autoincrement": false 968 + }, 969 + "expires": { 970 + "name": "expires", 971 + "type": "integer", 972 + "primaryKey": false, 973 + "notNull": true, 974 + "autoincrement": false 975 + } 976 + }, 977 + "indexes": {}, 978 + "foreignKeys": { 979 + "session_user_id_user_id_fk": { 980 + "name": "session_user_id_user_id_fk", 981 + "tableFrom": "session", 982 + "tableTo": "user", 983 + "columnsFrom": [ 984 + "user_id" 985 + ], 986 + "columnsTo": [ 987 + "id" 988 + ], 989 + "onDelete": "cascade", 990 + "onUpdate": "no action" 991 + } 992 + }, 993 + "compositePrimaryKeys": {}, 994 + "uniqueConstraints": {}, 995 + "checkConstraints": {} 996 + }, 997 + "user": { 998 + "name": "user", 999 + "columns": { 1000 + "id": { 1001 + "name": "id", 1002 + "type": "integer", 1003 + "primaryKey": true, 1004 + "notNull": true, 1005 + "autoincrement": false 1006 + }, 1007 + "tenant_id": { 1008 + "name": "tenant_id", 1009 + "type": "text(256)", 1010 + "primaryKey": false, 1011 + "notNull": false, 1012 + "autoincrement": false 1013 + }, 1014 + "first_name": { 1015 + "name": "first_name", 1016 + "type": "text", 1017 + "primaryKey": false, 1018 + "notNull": false, 1019 + "autoincrement": false, 1020 + "default": "''" 1021 + }, 1022 + "last_name": { 1023 + "name": "last_name", 1024 + "type": "text", 1025 + "primaryKey": false, 1026 + "notNull": false, 1027 + "autoincrement": false, 1028 + "default": "''" 1029 + }, 1030 + "photo_url": { 1031 + "name": "photo_url", 1032 + "type": "text", 1033 + "primaryKey": false, 1034 + "notNull": false, 1035 + "autoincrement": false, 1036 + "default": "''" 1037 + }, 1038 + "name": { 1039 + "name": "name", 1040 + "type": "text", 1041 + "primaryKey": false, 1042 + "notNull": false, 1043 + "autoincrement": false 1044 + }, 1045 + "email": { 1046 + "name": "email", 1047 + "type": "text", 1048 + "primaryKey": false, 1049 + "notNull": false, 1050 + "autoincrement": false, 1051 + "default": "''" 1052 + }, 1053 + "emailVerified": { 1054 + "name": "emailVerified", 1055 + "type": "integer", 1056 + "primaryKey": false, 1057 + "notNull": false, 1058 + "autoincrement": false 1059 + }, 1060 + "created_at": { 1061 + "name": "created_at", 1062 + "type": "integer", 1063 + "primaryKey": false, 1064 + "notNull": false, 1065 + "autoincrement": false, 1066 + "default": "(strftime('%s', 'now'))" 1067 + }, 1068 + "updated_at": { 1069 + "name": "updated_at", 1070 + "type": "integer", 1071 + "primaryKey": false, 1072 + "notNull": false, 1073 + "autoincrement": false, 1074 + "default": "(strftime('%s', 'now'))" 1075 + } 1076 + }, 1077 + "indexes": { 1078 + "user_tenant_id_unique": { 1079 + "name": "user_tenant_id_unique", 1080 + "columns": [ 1081 + "tenant_id" 1082 + ], 1083 + "isUnique": true 1084 + } 1085 + }, 1086 + "foreignKeys": {}, 1087 + "compositePrimaryKeys": {}, 1088 + "uniqueConstraints": {}, 1089 + "checkConstraints": {} 1090 + }, 1091 + "users_to_workspaces": { 1092 + "name": "users_to_workspaces", 1093 + "columns": { 1094 + "user_id": { 1095 + "name": "user_id", 1096 + "type": "integer", 1097 + "primaryKey": false, 1098 + "notNull": true, 1099 + "autoincrement": false 1100 + }, 1101 + "workspace_id": { 1102 + "name": "workspace_id", 1103 + "type": "integer", 1104 + "primaryKey": false, 1105 + "notNull": true, 1106 + "autoincrement": false 1107 + }, 1108 + "role": { 1109 + "name": "role", 1110 + "type": "text", 1111 + "primaryKey": false, 1112 + "notNull": true, 1113 + "autoincrement": false, 1114 + "default": "'member'" 1115 + }, 1116 + "created_at": { 1117 + "name": "created_at", 1118 + "type": "integer", 1119 + "primaryKey": false, 1120 + "notNull": false, 1121 + "autoincrement": false, 1122 + "default": "(strftime('%s', 'now'))" 1123 + } 1124 + }, 1125 + "indexes": {}, 1126 + "foreignKeys": { 1127 + "users_to_workspaces_user_id_user_id_fk": { 1128 + "name": "users_to_workspaces_user_id_user_id_fk", 1129 + "tableFrom": "users_to_workspaces", 1130 + "tableTo": "user", 1131 + "columnsFrom": [ 1132 + "user_id" 1133 + ], 1134 + "columnsTo": [ 1135 + "id" 1136 + ], 1137 + "onDelete": "no action", 1138 + "onUpdate": "no action" 1139 + }, 1140 + "users_to_workspaces_workspace_id_workspace_id_fk": { 1141 + "name": "users_to_workspaces_workspace_id_workspace_id_fk", 1142 + "tableFrom": "users_to_workspaces", 1143 + "tableTo": "workspace", 1144 + "columnsFrom": [ 1145 + "workspace_id" 1146 + ], 1147 + "columnsTo": [ 1148 + "id" 1149 + ], 1150 + "onDelete": "no action", 1151 + "onUpdate": "no action" 1152 + } 1153 + }, 1154 + "compositePrimaryKeys": { 1155 + "users_to_workspaces_user_id_workspace_id_pk": { 1156 + "columns": [ 1157 + "user_id", 1158 + "workspace_id" 1159 + ], 1160 + "name": "users_to_workspaces_user_id_workspace_id_pk" 1161 + } 1162 + }, 1163 + "uniqueConstraints": {}, 1164 + "checkConstraints": {} 1165 + }, 1166 + "verification_token": { 1167 + "name": "verification_token", 1168 + "columns": { 1169 + "identifier": { 1170 + "name": "identifier", 1171 + "type": "text", 1172 + "primaryKey": false, 1173 + "notNull": true, 1174 + "autoincrement": false 1175 + }, 1176 + "token": { 1177 + "name": "token", 1178 + "type": "text", 1179 + "primaryKey": false, 1180 + "notNull": true, 1181 + "autoincrement": false 1182 + }, 1183 + "expires": { 1184 + "name": "expires", 1185 + "type": "integer", 1186 + "primaryKey": false, 1187 + "notNull": true, 1188 + "autoincrement": false 1189 + } 1190 + }, 1191 + "indexes": {}, 1192 + "foreignKeys": {}, 1193 + "compositePrimaryKeys": { 1194 + "verification_token_identifier_token_pk": { 1195 + "columns": [ 1196 + "identifier", 1197 + "token" 1198 + ], 1199 + "name": "verification_token_identifier_token_pk" 1200 + } 1201 + }, 1202 + "uniqueConstraints": {}, 1203 + "checkConstraints": {} 1204 + }, 1205 + "page_subscriber": { 1206 + "name": "page_subscriber", 1207 + "columns": { 1208 + "id": { 1209 + "name": "id", 1210 + "type": "integer", 1211 + "primaryKey": true, 1212 + "notNull": true, 1213 + "autoincrement": false 1214 + }, 1215 + "email": { 1216 + "name": "email", 1217 + "type": "text", 1218 + "primaryKey": false, 1219 + "notNull": true, 1220 + "autoincrement": false 1221 + }, 1222 + "page_id": { 1223 + "name": "page_id", 1224 + "type": "integer", 1225 + "primaryKey": false, 1226 + "notNull": true, 1227 + "autoincrement": false 1228 + }, 1229 + "token": { 1230 + "name": "token", 1231 + "type": "text", 1232 + "primaryKey": false, 1233 + "notNull": false, 1234 + "autoincrement": false 1235 + }, 1236 + "accepted_at": { 1237 + "name": "accepted_at", 1238 + "type": "integer", 1239 + "primaryKey": false, 1240 + "notNull": false, 1241 + "autoincrement": false 1242 + }, 1243 + "expires_at": { 1244 + "name": "expires_at", 1245 + "type": "integer", 1246 + "primaryKey": false, 1247 + "notNull": false, 1248 + "autoincrement": false 1249 + }, 1250 + "created_at": { 1251 + "name": "created_at", 1252 + "type": "integer", 1253 + "primaryKey": false, 1254 + "notNull": false, 1255 + "autoincrement": false, 1256 + "default": "(strftime('%s', 'now'))" 1257 + }, 1258 + "updated_at": { 1259 + "name": "updated_at", 1260 + "type": "integer", 1261 + "primaryKey": false, 1262 + "notNull": false, 1263 + "autoincrement": false, 1264 + "default": "(strftime('%s', 'now'))" 1265 + } 1266 + }, 1267 + "indexes": {}, 1268 + "foreignKeys": { 1269 + "page_subscriber_page_id_page_id_fk": { 1270 + "name": "page_subscriber_page_id_page_id_fk", 1271 + "tableFrom": "page_subscriber", 1272 + "tableTo": "page", 1273 + "columnsFrom": [ 1274 + "page_id" 1275 + ], 1276 + "columnsTo": [ 1277 + "id" 1278 + ], 1279 + "onDelete": "cascade", 1280 + "onUpdate": "no action" 1281 + } 1282 + }, 1283 + "compositePrimaryKeys": {}, 1284 + "uniqueConstraints": {}, 1285 + "checkConstraints": {} 1286 + }, 1287 + "notification": { 1288 + "name": "notification", 1289 + "columns": { 1290 + "id": { 1291 + "name": "id", 1292 + "type": "integer", 1293 + "primaryKey": true, 1294 + "notNull": true, 1295 + "autoincrement": false 1296 + }, 1297 + "name": { 1298 + "name": "name", 1299 + "type": "text", 1300 + "primaryKey": false, 1301 + "notNull": true, 1302 + "autoincrement": false 1303 + }, 1304 + "provider": { 1305 + "name": "provider", 1306 + "type": "text", 1307 + "primaryKey": false, 1308 + "notNull": true, 1309 + "autoincrement": false 1310 + }, 1311 + "data": { 1312 + "name": "data", 1313 + "type": "text", 1314 + "primaryKey": false, 1315 + "notNull": false, 1316 + "autoincrement": false, 1317 + "default": "'{}'" 1318 + }, 1319 + "workspace_id": { 1320 + "name": "workspace_id", 1321 + "type": "integer", 1322 + "primaryKey": false, 1323 + "notNull": false, 1324 + "autoincrement": false 1325 + }, 1326 + "created_at": { 1327 + "name": "created_at", 1328 + "type": "integer", 1329 + "primaryKey": false, 1330 + "notNull": false, 1331 + "autoincrement": false, 1332 + "default": "(strftime('%s', 'now'))" 1333 + }, 1334 + "updated_at": { 1335 + "name": "updated_at", 1336 + "type": "integer", 1337 + "primaryKey": false, 1338 + "notNull": false, 1339 + "autoincrement": false, 1340 + "default": "(strftime('%s', 'now'))" 1341 + } 1342 + }, 1343 + "indexes": {}, 1344 + "foreignKeys": { 1345 + "notification_workspace_id_workspace_id_fk": { 1346 + "name": "notification_workspace_id_workspace_id_fk", 1347 + "tableFrom": "notification", 1348 + "tableTo": "workspace", 1349 + "columnsFrom": [ 1350 + "workspace_id" 1351 + ], 1352 + "columnsTo": [ 1353 + "id" 1354 + ], 1355 + "onDelete": "no action", 1356 + "onUpdate": "no action" 1357 + } 1358 + }, 1359 + "compositePrimaryKeys": {}, 1360 + "uniqueConstraints": {}, 1361 + "checkConstraints": {} 1362 + }, 1363 + "notification_trigger": { 1364 + "name": "notification_trigger", 1365 + "columns": { 1366 + "id": { 1367 + "name": "id", 1368 + "type": "integer", 1369 + "primaryKey": true, 1370 + "notNull": true, 1371 + "autoincrement": false 1372 + }, 1373 + "monitor_id": { 1374 + "name": "monitor_id", 1375 + "type": "integer", 1376 + "primaryKey": false, 1377 + "notNull": false, 1378 + "autoincrement": false 1379 + }, 1380 + "notification_id": { 1381 + "name": "notification_id", 1382 + "type": "integer", 1383 + "primaryKey": false, 1384 + "notNull": false, 1385 + "autoincrement": false 1386 + }, 1387 + "cron_timestamp": { 1388 + "name": "cron_timestamp", 1389 + "type": "integer", 1390 + "primaryKey": false, 1391 + "notNull": true, 1392 + "autoincrement": false 1393 + } 1394 + }, 1395 + "indexes": { 1396 + "notification_id_monitor_id_crontimestampe": { 1397 + "name": "notification_id_monitor_id_crontimestampe", 1398 + "columns": [ 1399 + "notification_id", 1400 + "monitor_id", 1401 + "cron_timestamp" 1402 + ], 1403 + "isUnique": true 1404 + } 1405 + }, 1406 + "foreignKeys": { 1407 + "notification_trigger_monitor_id_monitor_id_fk": { 1408 + "name": "notification_trigger_monitor_id_monitor_id_fk", 1409 + "tableFrom": "notification_trigger", 1410 + "tableTo": "monitor", 1411 + "columnsFrom": [ 1412 + "monitor_id" 1413 + ], 1414 + "columnsTo": [ 1415 + "id" 1416 + ], 1417 + "onDelete": "cascade", 1418 + "onUpdate": "no action" 1419 + }, 1420 + "notification_trigger_notification_id_notification_id_fk": { 1421 + "name": "notification_trigger_notification_id_notification_id_fk", 1422 + "tableFrom": "notification_trigger", 1423 + "tableTo": "notification", 1424 + "columnsFrom": [ 1425 + "notification_id" 1426 + ], 1427 + "columnsTo": [ 1428 + "id" 1429 + ], 1430 + "onDelete": "cascade", 1431 + "onUpdate": "no action" 1432 + } 1433 + }, 1434 + "compositePrimaryKeys": {}, 1435 + "uniqueConstraints": {}, 1436 + "checkConstraints": {} 1437 + }, 1438 + "notifications_to_monitors": { 1439 + "name": "notifications_to_monitors", 1440 + "columns": { 1441 + "monitor_id": { 1442 + "name": "monitor_id", 1443 + "type": "integer", 1444 + "primaryKey": false, 1445 + "notNull": true, 1446 + "autoincrement": false 1447 + }, 1448 + "notification_id": { 1449 + "name": "notification_id", 1450 + "type": "integer", 1451 + "primaryKey": false, 1452 + "notNull": true, 1453 + "autoincrement": false 1454 + }, 1455 + "created_at": { 1456 + "name": "created_at", 1457 + "type": "integer", 1458 + "primaryKey": false, 1459 + "notNull": false, 1460 + "autoincrement": false, 1461 + "default": "(strftime('%s', 'now'))" 1462 + } 1463 + }, 1464 + "indexes": {}, 1465 + "foreignKeys": { 1466 + "notifications_to_monitors_monitor_id_monitor_id_fk": { 1467 + "name": "notifications_to_monitors_monitor_id_monitor_id_fk", 1468 + "tableFrom": "notifications_to_monitors", 1469 + "tableTo": "monitor", 1470 + "columnsFrom": [ 1471 + "monitor_id" 1472 + ], 1473 + "columnsTo": [ 1474 + "id" 1475 + ], 1476 + "onDelete": "cascade", 1477 + "onUpdate": "no action" 1478 + }, 1479 + "notifications_to_monitors_notification_id_notification_id_fk": { 1480 + "name": "notifications_to_monitors_notification_id_notification_id_fk", 1481 + "tableFrom": "notifications_to_monitors", 1482 + "tableTo": "notification", 1483 + "columnsFrom": [ 1484 + "notification_id" 1485 + ], 1486 + "columnsTo": [ 1487 + "id" 1488 + ], 1489 + "onDelete": "cascade", 1490 + "onUpdate": "no action" 1491 + } 1492 + }, 1493 + "compositePrimaryKeys": { 1494 + "notifications_to_monitors_monitor_id_notification_id_pk": { 1495 + "columns": [ 1496 + "monitor_id", 1497 + "notification_id" 1498 + ], 1499 + "name": "notifications_to_monitors_monitor_id_notification_id_pk" 1500 + } 1501 + }, 1502 + "uniqueConstraints": {}, 1503 + "checkConstraints": {} 1504 + }, 1505 + "monitor_status": { 1506 + "name": "monitor_status", 1507 + "columns": { 1508 + "monitor_id": { 1509 + "name": "monitor_id", 1510 + "type": "integer", 1511 + "primaryKey": false, 1512 + "notNull": true, 1513 + "autoincrement": false 1514 + }, 1515 + "region": { 1516 + "name": "region", 1517 + "type": "text", 1518 + "primaryKey": false, 1519 + "notNull": true, 1520 + "autoincrement": false, 1521 + "default": "''" 1522 + }, 1523 + "status": { 1524 + "name": "status", 1525 + "type": "text", 1526 + "primaryKey": false, 1527 + "notNull": true, 1528 + "autoincrement": false, 1529 + "default": "'active'" 1530 + }, 1531 + "created_at": { 1532 + "name": "created_at", 1533 + "type": "integer", 1534 + "primaryKey": false, 1535 + "notNull": false, 1536 + "autoincrement": false, 1537 + "default": "(strftime('%s', 'now'))" 1538 + }, 1539 + "updated_at": { 1540 + "name": "updated_at", 1541 + "type": "integer", 1542 + "primaryKey": false, 1543 + "notNull": false, 1544 + "autoincrement": false, 1545 + "default": "(strftime('%s', 'now'))" 1546 + } 1547 + }, 1548 + "indexes": { 1549 + "monitor_status_idx": { 1550 + "name": "monitor_status_idx", 1551 + "columns": [ 1552 + "monitor_id", 1553 + "region" 1554 + ], 1555 + "isUnique": false 1556 + } 1557 + }, 1558 + "foreignKeys": { 1559 + "monitor_status_monitor_id_monitor_id_fk": { 1560 + "name": "monitor_status_monitor_id_monitor_id_fk", 1561 + "tableFrom": "monitor_status", 1562 + "tableTo": "monitor", 1563 + "columnsFrom": [ 1564 + "monitor_id" 1565 + ], 1566 + "columnsTo": [ 1567 + "id" 1568 + ], 1569 + "onDelete": "cascade", 1570 + "onUpdate": "no action" 1571 + } 1572 + }, 1573 + "compositePrimaryKeys": { 1574 + "monitor_status_monitor_id_region_pk": { 1575 + "columns": [ 1576 + "monitor_id", 1577 + "region" 1578 + ], 1579 + "name": "monitor_status_monitor_id_region_pk" 1580 + } 1581 + }, 1582 + "uniqueConstraints": {}, 1583 + "checkConstraints": {} 1584 + }, 1585 + "invitation": { 1586 + "name": "invitation", 1587 + "columns": { 1588 + "id": { 1589 + "name": "id", 1590 + "type": "integer", 1591 + "primaryKey": true, 1592 + "notNull": true, 1593 + "autoincrement": false 1594 + }, 1595 + "email": { 1596 + "name": "email", 1597 + "type": "text", 1598 + "primaryKey": false, 1599 + "notNull": true, 1600 + "autoincrement": false 1601 + }, 1602 + "role": { 1603 + "name": "role", 1604 + "type": "text", 1605 + "primaryKey": false, 1606 + "notNull": true, 1607 + "autoincrement": false, 1608 + "default": "'member'" 1609 + }, 1610 + "workspace_id": { 1611 + "name": "workspace_id", 1612 + "type": "integer", 1613 + "primaryKey": false, 1614 + "notNull": true, 1615 + "autoincrement": false 1616 + }, 1617 + "token": { 1618 + "name": "token", 1619 + "type": "text", 1620 + "primaryKey": false, 1621 + "notNull": true, 1622 + "autoincrement": false 1623 + }, 1624 + "expires_at": { 1625 + "name": "expires_at", 1626 + "type": "integer", 1627 + "primaryKey": false, 1628 + "notNull": true, 1629 + "autoincrement": false 1630 + }, 1631 + "created_at": { 1632 + "name": "created_at", 1633 + "type": "integer", 1634 + "primaryKey": false, 1635 + "notNull": false, 1636 + "autoincrement": false, 1637 + "default": "(strftime('%s', 'now'))" 1638 + }, 1639 + "accepted_at": { 1640 + "name": "accepted_at", 1641 + "type": "integer", 1642 + "primaryKey": false, 1643 + "notNull": false, 1644 + "autoincrement": false 1645 + } 1646 + }, 1647 + "indexes": {}, 1648 + "foreignKeys": {}, 1649 + "compositePrimaryKeys": {}, 1650 + "uniqueConstraints": {}, 1651 + "checkConstraints": {} 1652 + }, 1653 + "incident": { 1654 + "name": "incident", 1655 + "columns": { 1656 + "id": { 1657 + "name": "id", 1658 + "type": "integer", 1659 + "primaryKey": true, 1660 + "notNull": true, 1661 + "autoincrement": false 1662 + }, 1663 + "title": { 1664 + "name": "title", 1665 + "type": "text", 1666 + "primaryKey": false, 1667 + "notNull": true, 1668 + "autoincrement": false, 1669 + "default": "''" 1670 + }, 1671 + "summary": { 1672 + "name": "summary", 1673 + "type": "text", 1674 + "primaryKey": false, 1675 + "notNull": true, 1676 + "autoincrement": false, 1677 + "default": "''" 1678 + }, 1679 + "status": { 1680 + "name": "status", 1681 + "type": "text", 1682 + "primaryKey": false, 1683 + "notNull": true, 1684 + "autoincrement": false, 1685 + "default": "'triage'" 1686 + }, 1687 + "monitor_id": { 1688 + "name": "monitor_id", 1689 + "type": "integer", 1690 + "primaryKey": false, 1691 + "notNull": false, 1692 + "autoincrement": false 1693 + }, 1694 + "workspace_id": { 1695 + "name": "workspace_id", 1696 + "type": "integer", 1697 + "primaryKey": false, 1698 + "notNull": false, 1699 + "autoincrement": false 1700 + }, 1701 + "started_at": { 1702 + "name": "started_at", 1703 + "type": "integer", 1704 + "primaryKey": false, 1705 + "notNull": true, 1706 + "autoincrement": false, 1707 + "default": "(strftime('%s', 'now'))" 1708 + }, 1709 + "acknowledged_at": { 1710 + "name": "acknowledged_at", 1711 + "type": "integer", 1712 + "primaryKey": false, 1713 + "notNull": false, 1714 + "autoincrement": false 1715 + }, 1716 + "acknowledged_by": { 1717 + "name": "acknowledged_by", 1718 + "type": "integer", 1719 + "primaryKey": false, 1720 + "notNull": false, 1721 + "autoincrement": false 1722 + }, 1723 + "resolved_at": { 1724 + "name": "resolved_at", 1725 + "type": "integer", 1726 + "primaryKey": false, 1727 + "notNull": false, 1728 + "autoincrement": false 1729 + }, 1730 + "resolved_by": { 1731 + "name": "resolved_by", 1732 + "type": "integer", 1733 + "primaryKey": false, 1734 + "notNull": false, 1735 + "autoincrement": false 1736 + }, 1737 + "incident_screenshot_url": { 1738 + "name": "incident_screenshot_url", 1739 + "type": "text", 1740 + "primaryKey": false, 1741 + "notNull": false, 1742 + "autoincrement": false 1743 + }, 1744 + "recovery_screenshot_url": { 1745 + "name": "recovery_screenshot_url", 1746 + "type": "text", 1747 + "primaryKey": false, 1748 + "notNull": false, 1749 + "autoincrement": false 1750 + }, 1751 + "auto_resolved": { 1752 + "name": "auto_resolved", 1753 + "type": "integer", 1754 + "primaryKey": false, 1755 + "notNull": false, 1756 + "autoincrement": false, 1757 + "default": false 1758 + }, 1759 + "created_at": { 1760 + "name": "created_at", 1761 + "type": "integer", 1762 + "primaryKey": false, 1763 + "notNull": false, 1764 + "autoincrement": false, 1765 + "default": "(strftime('%s', 'now'))" 1766 + }, 1767 + "updated_at": { 1768 + "name": "updated_at", 1769 + "type": "integer", 1770 + "primaryKey": false, 1771 + "notNull": false, 1772 + "autoincrement": false, 1773 + "default": "(strftime('%s', 'now'))" 1774 + } 1775 + }, 1776 + "indexes": { 1777 + "incident_monitor_id_started_at_unique": { 1778 + "name": "incident_monitor_id_started_at_unique", 1779 + "columns": [ 1780 + "monitor_id", 1781 + "started_at" 1782 + ], 1783 + "isUnique": true 1784 + } 1785 + }, 1786 + "foreignKeys": { 1787 + "incident_monitor_id_monitor_id_fk": { 1788 + "name": "incident_monitor_id_monitor_id_fk", 1789 + "tableFrom": "incident", 1790 + "tableTo": "monitor", 1791 + "columnsFrom": [ 1792 + "monitor_id" 1793 + ], 1794 + "columnsTo": [ 1795 + "id" 1796 + ], 1797 + "onDelete": "set default", 1798 + "onUpdate": "no action" 1799 + }, 1800 + "incident_workspace_id_workspace_id_fk": { 1801 + "name": "incident_workspace_id_workspace_id_fk", 1802 + "tableFrom": "incident", 1803 + "tableTo": "workspace", 1804 + "columnsFrom": [ 1805 + "workspace_id" 1806 + ], 1807 + "columnsTo": [ 1808 + "id" 1809 + ], 1810 + "onDelete": "no action", 1811 + "onUpdate": "no action" 1812 + }, 1813 + "incident_acknowledged_by_user_id_fk": { 1814 + "name": "incident_acknowledged_by_user_id_fk", 1815 + "tableFrom": "incident", 1816 + "tableTo": "user", 1817 + "columnsFrom": [ 1818 + "acknowledged_by" 1819 + ], 1820 + "columnsTo": [ 1821 + "id" 1822 + ], 1823 + "onDelete": "no action", 1824 + "onUpdate": "no action" 1825 + }, 1826 + "incident_resolved_by_user_id_fk": { 1827 + "name": "incident_resolved_by_user_id_fk", 1828 + "tableFrom": "incident", 1829 + "tableTo": "user", 1830 + "columnsFrom": [ 1831 + "resolved_by" 1832 + ], 1833 + "columnsTo": [ 1834 + "id" 1835 + ], 1836 + "onDelete": "no action", 1837 + "onUpdate": "no action" 1838 + } 1839 + }, 1840 + "compositePrimaryKeys": {}, 1841 + "uniqueConstraints": {}, 1842 + "checkConstraints": {} 1843 + }, 1844 + "monitor_tag": { 1845 + "name": "monitor_tag", 1846 + "columns": { 1847 + "id": { 1848 + "name": "id", 1849 + "type": "integer", 1850 + "primaryKey": true, 1851 + "notNull": true, 1852 + "autoincrement": false 1853 + }, 1854 + "workspace_id": { 1855 + "name": "workspace_id", 1856 + "type": "integer", 1857 + "primaryKey": false, 1858 + "notNull": true, 1859 + "autoincrement": false 1860 + }, 1861 + "name": { 1862 + "name": "name", 1863 + "type": "text", 1864 + "primaryKey": false, 1865 + "notNull": true, 1866 + "autoincrement": false 1867 + }, 1868 + "color": { 1869 + "name": "color", 1870 + "type": "text", 1871 + "primaryKey": false, 1872 + "notNull": true, 1873 + "autoincrement": false 1874 + }, 1875 + "created_at": { 1876 + "name": "created_at", 1877 + "type": "integer", 1878 + "primaryKey": false, 1879 + "notNull": false, 1880 + "autoincrement": false, 1881 + "default": "(strftime('%s', 'now'))" 1882 + }, 1883 + "updated_at": { 1884 + "name": "updated_at", 1885 + "type": "integer", 1886 + "primaryKey": false, 1887 + "notNull": false, 1888 + "autoincrement": false, 1889 + "default": "(strftime('%s', 'now'))" 1890 + } 1891 + }, 1892 + "indexes": {}, 1893 + "foreignKeys": { 1894 + "monitor_tag_workspace_id_workspace_id_fk": { 1895 + "name": "monitor_tag_workspace_id_workspace_id_fk", 1896 + "tableFrom": "monitor_tag", 1897 + "tableTo": "workspace", 1898 + "columnsFrom": [ 1899 + "workspace_id" 1900 + ], 1901 + "columnsTo": [ 1902 + "id" 1903 + ], 1904 + "onDelete": "cascade", 1905 + "onUpdate": "no action" 1906 + } 1907 + }, 1908 + "compositePrimaryKeys": {}, 1909 + "uniqueConstraints": {}, 1910 + "checkConstraints": {} 1911 + }, 1912 + "monitor_tag_to_monitor": { 1913 + "name": "monitor_tag_to_monitor", 1914 + "columns": { 1915 + "monitor_id": { 1916 + "name": "monitor_id", 1917 + "type": "integer", 1918 + "primaryKey": false, 1919 + "notNull": true, 1920 + "autoincrement": false 1921 + }, 1922 + "monitor_tag_id": { 1923 + "name": "monitor_tag_id", 1924 + "type": "integer", 1925 + "primaryKey": false, 1926 + "notNull": true, 1927 + "autoincrement": false 1928 + }, 1929 + "created_at": { 1930 + "name": "created_at", 1931 + "type": "integer", 1932 + "primaryKey": false, 1933 + "notNull": false, 1934 + "autoincrement": false, 1935 + "default": "(strftime('%s', 'now'))" 1936 + } 1937 + }, 1938 + "indexes": {}, 1939 + "foreignKeys": { 1940 + "monitor_tag_to_monitor_monitor_id_monitor_id_fk": { 1941 + "name": "monitor_tag_to_monitor_monitor_id_monitor_id_fk", 1942 + "tableFrom": "monitor_tag_to_monitor", 1943 + "tableTo": "monitor", 1944 + "columnsFrom": [ 1945 + "monitor_id" 1946 + ], 1947 + "columnsTo": [ 1948 + "id" 1949 + ], 1950 + "onDelete": "cascade", 1951 + "onUpdate": "no action" 1952 + }, 1953 + "monitor_tag_to_monitor_monitor_tag_id_monitor_tag_id_fk": { 1954 + "name": "monitor_tag_to_monitor_monitor_tag_id_monitor_tag_id_fk", 1955 + "tableFrom": "monitor_tag_to_monitor", 1956 + "tableTo": "monitor_tag", 1957 + "columnsFrom": [ 1958 + "monitor_tag_id" 1959 + ], 1960 + "columnsTo": [ 1961 + "id" 1962 + ], 1963 + "onDelete": "cascade", 1964 + "onUpdate": "no action" 1965 + } 1966 + }, 1967 + "compositePrimaryKeys": { 1968 + "monitor_tag_to_monitor_monitor_id_monitor_tag_id_pk": { 1969 + "columns": [ 1970 + "monitor_id", 1971 + "monitor_tag_id" 1972 + ], 1973 + "name": "monitor_tag_to_monitor_monitor_id_monitor_tag_id_pk" 1974 + } 1975 + }, 1976 + "uniqueConstraints": {}, 1977 + "checkConstraints": {} 1978 + }, 1979 + "application": { 1980 + "name": "application", 1981 + "columns": { 1982 + "id": { 1983 + "name": "id", 1984 + "type": "integer", 1985 + "primaryKey": true, 1986 + "notNull": true, 1987 + "autoincrement": false 1988 + }, 1989 + "name": { 1990 + "name": "name", 1991 + "type": "text", 1992 + "primaryKey": false, 1993 + "notNull": false, 1994 + "autoincrement": false 1995 + }, 1996 + "dsn": { 1997 + "name": "dsn", 1998 + "type": "text", 1999 + "primaryKey": false, 2000 + "notNull": false, 2001 + "autoincrement": false 2002 + }, 2003 + "workspace_id": { 2004 + "name": "workspace_id", 2005 + "type": "integer", 2006 + "primaryKey": false, 2007 + "notNull": false, 2008 + "autoincrement": false 2009 + }, 2010 + "created_at": { 2011 + "name": "created_at", 2012 + "type": "integer", 2013 + "primaryKey": false, 2014 + "notNull": false, 2015 + "autoincrement": false, 2016 + "default": "(strftime('%s', 'now'))" 2017 + }, 2018 + "updated_at": { 2019 + "name": "updated_at", 2020 + "type": "integer", 2021 + "primaryKey": false, 2022 + "notNull": false, 2023 + "autoincrement": false, 2024 + "default": "(strftime('%s', 'now'))" 2025 + } 2026 + }, 2027 + "indexes": { 2028 + "application_dsn_unique": { 2029 + "name": "application_dsn_unique", 2030 + "columns": [ 2031 + "dsn" 2032 + ], 2033 + "isUnique": true 2034 + } 2035 + }, 2036 + "foreignKeys": { 2037 + "application_workspace_id_workspace_id_fk": { 2038 + "name": "application_workspace_id_workspace_id_fk", 2039 + "tableFrom": "application", 2040 + "tableTo": "workspace", 2041 + "columnsFrom": [ 2042 + "workspace_id" 2043 + ], 2044 + "columnsTo": [ 2045 + "id" 2046 + ], 2047 + "onDelete": "no action", 2048 + "onUpdate": "no action" 2049 + } 2050 + }, 2051 + "compositePrimaryKeys": {}, 2052 + "uniqueConstraints": {}, 2053 + "checkConstraints": {} 2054 + }, 2055 + "maintenance": { 2056 + "name": "maintenance", 2057 + "columns": { 2058 + "id": { 2059 + "name": "id", 2060 + "type": "integer", 2061 + "primaryKey": true, 2062 + "notNull": true, 2063 + "autoincrement": false 2064 + }, 2065 + "title": { 2066 + "name": "title", 2067 + "type": "text(256)", 2068 + "primaryKey": false, 2069 + "notNull": true, 2070 + "autoincrement": false 2071 + }, 2072 + "message": { 2073 + "name": "message", 2074 + "type": "text", 2075 + "primaryKey": false, 2076 + "notNull": true, 2077 + "autoincrement": false 2078 + }, 2079 + "from": { 2080 + "name": "from", 2081 + "type": "integer", 2082 + "primaryKey": false, 2083 + "notNull": true, 2084 + "autoincrement": false 2085 + }, 2086 + "to": { 2087 + "name": "to", 2088 + "type": "integer", 2089 + "primaryKey": false, 2090 + "notNull": true, 2091 + "autoincrement": false 2092 + }, 2093 + "workspace_id": { 2094 + "name": "workspace_id", 2095 + "type": "integer", 2096 + "primaryKey": false, 2097 + "notNull": false, 2098 + "autoincrement": false 2099 + }, 2100 + "page_id": { 2101 + "name": "page_id", 2102 + "type": "integer", 2103 + "primaryKey": false, 2104 + "notNull": false, 2105 + "autoincrement": false 2106 + }, 2107 + "created_at": { 2108 + "name": "created_at", 2109 + "type": "integer", 2110 + "primaryKey": false, 2111 + "notNull": false, 2112 + "autoincrement": false, 2113 + "default": "(strftime('%s', 'now'))" 2114 + }, 2115 + "updated_at": { 2116 + "name": "updated_at", 2117 + "type": "integer", 2118 + "primaryKey": false, 2119 + "notNull": false, 2120 + "autoincrement": false, 2121 + "default": "(strftime('%s', 'now'))" 2122 + } 2123 + }, 2124 + "indexes": {}, 2125 + "foreignKeys": { 2126 + "maintenance_workspace_id_workspace_id_fk": { 2127 + "name": "maintenance_workspace_id_workspace_id_fk", 2128 + "tableFrom": "maintenance", 2129 + "tableTo": "workspace", 2130 + "columnsFrom": [ 2131 + "workspace_id" 2132 + ], 2133 + "columnsTo": [ 2134 + "id" 2135 + ], 2136 + "onDelete": "no action", 2137 + "onUpdate": "no action" 2138 + }, 2139 + "maintenance_page_id_page_id_fk": { 2140 + "name": "maintenance_page_id_page_id_fk", 2141 + "tableFrom": "maintenance", 2142 + "tableTo": "page", 2143 + "columnsFrom": [ 2144 + "page_id" 2145 + ], 2146 + "columnsTo": [ 2147 + "id" 2148 + ], 2149 + "onDelete": "cascade", 2150 + "onUpdate": "no action" 2151 + } 2152 + }, 2153 + "compositePrimaryKeys": {}, 2154 + "uniqueConstraints": {}, 2155 + "checkConstraints": {} 2156 + }, 2157 + "maintenance_to_monitor": { 2158 + "name": "maintenance_to_monitor", 2159 + "columns": { 2160 + "maintenance_id": { 2161 + "name": "maintenance_id", 2162 + "type": "integer", 2163 + "primaryKey": false, 2164 + "notNull": true, 2165 + "autoincrement": false 2166 + }, 2167 + "monitor_id": { 2168 + "name": "monitor_id", 2169 + "type": "integer", 2170 + "primaryKey": false, 2171 + "notNull": true, 2172 + "autoincrement": false 2173 + }, 2174 + "created_at": { 2175 + "name": "created_at", 2176 + "type": "integer", 2177 + "primaryKey": false, 2178 + "notNull": false, 2179 + "autoincrement": false, 2180 + "default": "(strftime('%s', 'now'))" 2181 + } 2182 + }, 2183 + "indexes": {}, 2184 + "foreignKeys": { 2185 + "maintenance_to_monitor_maintenance_id_maintenance_id_fk": { 2186 + "name": "maintenance_to_monitor_maintenance_id_maintenance_id_fk", 2187 + "tableFrom": "maintenance_to_monitor", 2188 + "tableTo": "maintenance", 2189 + "columnsFrom": [ 2190 + "maintenance_id" 2191 + ], 2192 + "columnsTo": [ 2193 + "id" 2194 + ], 2195 + "onDelete": "cascade", 2196 + "onUpdate": "no action" 2197 + }, 2198 + "maintenance_to_monitor_monitor_id_monitor_id_fk": { 2199 + "name": "maintenance_to_monitor_monitor_id_monitor_id_fk", 2200 + "tableFrom": "maintenance_to_monitor", 2201 + "tableTo": "monitor", 2202 + "columnsFrom": [ 2203 + "monitor_id" 2204 + ], 2205 + "columnsTo": [ 2206 + "id" 2207 + ], 2208 + "onDelete": "cascade", 2209 + "onUpdate": "no action" 2210 + } 2211 + }, 2212 + "compositePrimaryKeys": { 2213 + "maintenance_to_monitor_maintenance_id_monitor_id_pk": { 2214 + "columns": [ 2215 + "maintenance_id", 2216 + "monitor_id" 2217 + ], 2218 + "name": "maintenance_to_monitor_maintenance_id_monitor_id_pk" 2219 + } 2220 + }, 2221 + "uniqueConstraints": {}, 2222 + "checkConstraints": {} 2223 + }, 2224 + "check": { 2225 + "name": "check", 2226 + "columns": { 2227 + "id": { 2228 + "name": "id", 2229 + "type": "integer", 2230 + "primaryKey": true, 2231 + "notNull": true, 2232 + "autoincrement": true 2233 + }, 2234 + "regions": { 2235 + "name": "regions", 2236 + "type": "text", 2237 + "primaryKey": false, 2238 + "notNull": true, 2239 + "autoincrement": false, 2240 + "default": "''" 2241 + }, 2242 + "url": { 2243 + "name": "url", 2244 + "type": "text(4096)", 2245 + "primaryKey": false, 2246 + "notNull": true, 2247 + "autoincrement": false 2248 + }, 2249 + "headers": { 2250 + "name": "headers", 2251 + "type": "text", 2252 + "primaryKey": false, 2253 + "notNull": false, 2254 + "autoincrement": false, 2255 + "default": "''" 2256 + }, 2257 + "body": { 2258 + "name": "body", 2259 + "type": "text", 2260 + "primaryKey": false, 2261 + "notNull": false, 2262 + "autoincrement": false, 2263 + "default": "''" 2264 + }, 2265 + "method": { 2266 + "name": "method", 2267 + "type": "text", 2268 + "primaryKey": false, 2269 + "notNull": false, 2270 + "autoincrement": false, 2271 + "default": "'GET'" 2272 + }, 2273 + "count_requests": { 2274 + "name": "count_requests", 2275 + "type": "integer", 2276 + "primaryKey": false, 2277 + "notNull": false, 2278 + "autoincrement": false, 2279 + "default": 1 2280 + }, 2281 + "workspace_id": { 2282 + "name": "workspace_id", 2283 + "type": "integer", 2284 + "primaryKey": false, 2285 + "notNull": false, 2286 + "autoincrement": false 2287 + }, 2288 + "created_at": { 2289 + "name": "created_at", 2290 + "type": "integer", 2291 + "primaryKey": false, 2292 + "notNull": false, 2293 + "autoincrement": false, 2294 + "default": "(strftime('%s', 'now'))" 2295 + } 2296 + }, 2297 + "indexes": {}, 2298 + "foreignKeys": { 2299 + "check_workspace_id_workspace_id_fk": { 2300 + "name": "check_workspace_id_workspace_id_fk", 2301 + "tableFrom": "check", 2302 + "tableTo": "workspace", 2303 + "columnsFrom": [ 2304 + "workspace_id" 2305 + ], 2306 + "columnsTo": [ 2307 + "id" 2308 + ], 2309 + "onDelete": "no action", 2310 + "onUpdate": "no action" 2311 + } 2312 + }, 2313 + "compositePrimaryKeys": {}, 2314 + "uniqueConstraints": {}, 2315 + "checkConstraints": {} 2316 + }, 2317 + "monitor_run": { 2318 + "name": "monitor_run", 2319 + "columns": { 2320 + "id": { 2321 + "name": "id", 2322 + "type": "integer", 2323 + "primaryKey": true, 2324 + "notNull": true, 2325 + "autoincrement": false 2326 + }, 2327 + "workspace_id": { 2328 + "name": "workspace_id", 2329 + "type": "integer", 2330 + "primaryKey": false, 2331 + "notNull": false, 2332 + "autoincrement": false 2333 + }, 2334 + "monitor_id": { 2335 + "name": "monitor_id", 2336 + "type": "integer", 2337 + "primaryKey": false, 2338 + "notNull": false, 2339 + "autoincrement": false 2340 + }, 2341 + "runned_at": { 2342 + "name": "runned_at", 2343 + "type": "integer", 2344 + "primaryKey": false, 2345 + "notNull": false, 2346 + "autoincrement": false 2347 + }, 2348 + "created_at": { 2349 + "name": "created_at", 2350 + "type": "integer", 2351 + "primaryKey": false, 2352 + "notNull": false, 2353 + "autoincrement": false, 2354 + "default": "(strftime('%s', 'now'))" 2355 + } 2356 + }, 2357 + "indexes": {}, 2358 + "foreignKeys": { 2359 + "monitor_run_workspace_id_workspace_id_fk": { 2360 + "name": "monitor_run_workspace_id_workspace_id_fk", 2361 + "tableFrom": "monitor_run", 2362 + "tableTo": "workspace", 2363 + "columnsFrom": [ 2364 + "workspace_id" 2365 + ], 2366 + "columnsTo": [ 2367 + "id" 2368 + ], 2369 + "onDelete": "no action", 2370 + "onUpdate": "no action" 2371 + }, 2372 + "monitor_run_monitor_id_monitor_id_fk": { 2373 + "name": "monitor_run_monitor_id_monitor_id_fk", 2374 + "tableFrom": "monitor_run", 2375 + "tableTo": "monitor", 2376 + "columnsFrom": [ 2377 + "monitor_id" 2378 + ], 2379 + "columnsTo": [ 2380 + "id" 2381 + ], 2382 + "onDelete": "no action", 2383 + "onUpdate": "no action" 2384 + } 2385 + }, 2386 + "compositePrimaryKeys": {}, 2387 + "uniqueConstraints": {}, 2388 + "checkConstraints": {} 2389 + } 2390 + }, 2391 + "views": {}, 2392 + "enums": {}, 2393 + "_meta": { 2394 + "schemas": {}, 2395 + "tables": {}, 2396 + "columns": {} 2397 + }, 2398 + "internal": { 2399 + "indexes": {} 2400 + } 2401 + }
+7
packages/db/drizzle/meta/_journal.json
··· 302 302 "when": 1747410497521, 303 303 "tag": "0042_great_epoch", 304 304 "breakpoints": true 305 + }, 306 + { 307 + "idx": 43, 308 + "version": "6", 309 + "when": 1747908803707, 310 + "tag": "0043_low_lily_hollister", 311 + "breakpoints": true 305 312 } 306 313 ] 307 314 }
+2 -2
packages/db/src/schema/monitors/constants.ts
··· 3 3 "POST", 4 4 "HEAD", 5 5 "PUT", 6 + "PATCH", 6 7 "DELETE", 8 + "TRACE", 7 9 "CONNECT", 8 10 "OPTIONS", 9 - "TRACE", 10 - "PATCH", 11 11 ] as const; 12 12 export const monitorStatus = ["active", "error", "degraded"] as const; 13 13
+2
packages/db/src/schema/monitors/monitor.ts
··· 52 52 53 53 public: integer("public", { mode: "boolean" }).default(false), 54 54 55 + retry: integer("retry").default(3), 56 + 55 57 createdAt: integer("created_at", { mode: "timestamp" }).default( 56 58 sql`(strftime('%s', 'now'))`, 57 59 ),
+1
packages/db/src/schema/monitors/validation.ts
··· 45 45 status: monitorStatusSchema.default("active"), 46 46 jobType: monitorJobTypesSchema.default("http"), 47 47 timeout: z.number().default(45), 48 + retry: z.number().default(3), 48 49 regions: regionsToArraySchema.default([]), 49 50 }).extend({ 50 51 headers: headersToArraySchema.default([]),
+2
packages/utils/index.ts
··· 452 452 headers: z.record(z.string()), 453 453 }) 454 454 .optional(), 455 + retry: z.number().default(3), 455 456 }); 456 457 457 458 export type HttpPayload = z.infer<typeof httpPayloadSchema>; ··· 472 473 headers: z.record(z.string()), 473 474 }) 474 475 .optional(), 476 + retry: z.number().default(3), 475 477 }); 476 478 477 479 export type TcpPayload = z.infer<typeof tpcPayloadSchema>;