Openstatus www.openstatus.dev

๐Ÿ› add created at (#173)

* ๐Ÿ› add created at

* ๐Ÿ—‘๏ธ

* ๐Ÿš€

* fix migration

authored by

Thibault Le Ouay and committed by
GitHub
fa7bb88c 59f850da

+750 -10
-1
packages/api/src/router/incident.ts
··· 7 7 insertIncidentSchema, 8 8 insertIncidentSchemaWithMonitors, 9 9 insertIncidentUpdateSchema, 10 - monitor, 11 10 monitorsToIncidents, 12 11 selectIncidentSchema, 13 12 selectIncidentUpdateSchema,
+7 -4
packages/api/src/router/monitor.ts
··· 191 191 const { regions, ...data } = opts.input; 192 192 await opts.ctx.db 193 193 .update(monitor) 194 - .set({ ...data, regions: regions?.join(",") }) 194 + .set({ ...data, regions: regions?.join(","), updatedAt: new Date() }) 195 195 .where(eq(monitor.id, opts.input.id)) 196 196 .returning() 197 197 .get(); 198 198 }), 199 - updateMonitorStatus: protectedProcedure 199 + updateMonitorPeriodicity: protectedProcedure 200 200 .input( 201 201 z.object({ 202 202 id: z.number(), 203 - status: insertMonitorSchema.pick({ periodicity: true }), 203 + data: insertMonitorSchema.pick({ periodicity: true }), 204 204 }), 205 205 ) 206 206 .mutation(async (opts) => { ··· 227 227 228 228 await opts.ctx.db 229 229 .update(monitor) 230 - .set(opts.input.status) 230 + .set({ 231 + periodicity: opts.input.data.periodicity, 232 + updatedAt: new Date(), 233 + }) 231 234 .where(eq(monitor.id, opts.input.id)) 232 235 .run(); 233 236 }),
+28 -1
packages/api/src/router/page.ts
··· 123 123 updatePage: protectedProcedure 124 124 .input(insertPageSchemaWithMonitors) 125 125 .mutation(async (opts) => { 126 + if (!opts.input.id) return; 127 + 128 + const currentUser = await opts.ctx.db 129 + .select() 130 + .from(user) 131 + .where(eq(user.tenantId, opts.ctx.auth.userId)) 132 + .get(); 133 + 134 + const result = await opts.ctx.db 135 + .select() 136 + .from(usersToWorkspaces) 137 + .where(eq(usersToWorkspaces.userId, currentUser.id)) 138 + .all(); 139 + const workspaceIds = result.map((workspace) => workspace.workspaceId); 140 + 141 + const pageToUpdate = await opts.ctx.db 142 + .select() 143 + .from(page) 144 + .where( 145 + and( 146 + eq(page.id, opts.input.id), 147 + inArray(page.workspaceId, workspaceIds), 148 + ), 149 + ) 150 + .get(); 151 + if (!pageToUpdate) return; 152 + 126 153 const { monitors, workspaceSlug, ...pageInput } = opts.input; 127 154 if (!pageInput.id) return; 128 155 const currentPage = await opts.ctx.db 129 156 .update(page) 130 - .set(pageInput) 157 + .set({ ...pageInput, updatedAt: new Date() }) 131 158 .where(eq(page.id, pageInput.id)) 132 159 .returning() 133 160 .get();
+11
packages/db/drizzle/0004_fixed_dakota_north.sql
··· 1 + ALTER TABLE page RENAME COLUMN `updated_at` to `created_at` ;--> statement-breakpoint 2 + ALTER TABLE page ADD `updated_at` integer;--> statement-breakpoint 3 + 4 + ALTER TABLE monitor RENAME COLUMN `updated_at` to `created_at` ;--> statement-breakpoint 5 + ALTER TABLE monitor ADD `updated_at` integer;--> statement-breakpoint 6 + 7 + ALTER TABLE user RENAME COLUMN `updated_at` to `created_at` ;--> statement-breakpoint 8 + ALTER TABLE user ADD `updated_at` integer;--> statement-breakpoint 9 + 10 + ALTER TABLE workspace RENAME COLUMN `updated_at` to `created_at` ;--> statement-breakpoint 11 + ALTER TABLE workspace ADD `updated_at` integer;
+693
packages/db/drizzle/meta/0004_snapshot.json
··· 1 + { 2 + "version": "5", 3 + "dialect": "sqlite", 4 + "id": "c7088c9f-2521-43af-884e-b7b0b81b0cb9", 5 + "prevId": "f68fee05-786b-45d6-9e08-f793e7591577", 6 + "tables": { 7 + "incident": { 8 + "name": "incident", 9 + "columns": { 10 + "id": { 11 + "name": "id", 12 + "type": "integer", 13 + "primaryKey": true, 14 + "notNull": true, 15 + "autoincrement": false 16 + }, 17 + "status": { 18 + "name": "status", 19 + "type": "text(4)", 20 + "primaryKey": false, 21 + "notNull": true, 22 + "autoincrement": false 23 + }, 24 + "title": { 25 + "name": "title", 26 + "type": "text(256)", 27 + "primaryKey": false, 28 + "notNull": true, 29 + "autoincrement": false 30 + }, 31 + "workspace_id": { 32 + "name": "workspace_id", 33 + "type": "integer", 34 + "primaryKey": false, 35 + "notNull": false, 36 + "autoincrement": false 37 + }, 38 + "created_at": { 39 + "name": "created_at", 40 + "type": "integer", 41 + "primaryKey": false, 42 + "notNull": false, 43 + "autoincrement": false, 44 + "default": "(strftime('%s', 'now'))" 45 + }, 46 + "updated_at": { 47 + "name": "updated_at", 48 + "type": "integer", 49 + "primaryKey": false, 50 + "notNull": false, 51 + "autoincrement": false, 52 + "default": "(strftime('%s', 'now'))" 53 + } 54 + }, 55 + "indexes": {}, 56 + "foreignKeys": { 57 + "incident_workspace_id_workspace_id_fk": { 58 + "name": "incident_workspace_id_workspace_id_fk", 59 + "tableFrom": "incident", 60 + "tableTo": "workspace", 61 + "columnsFrom": [ 62 + "workspace_id" 63 + ], 64 + "columnsTo": [ 65 + "id" 66 + ], 67 + "onDelete": "no action", 68 + "onUpdate": "no action" 69 + } 70 + }, 71 + "compositePrimaryKeys": {}, 72 + "uniqueConstraints": {} 73 + }, 74 + "incident_update": { 75 + "name": "incident_update", 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(4)", 87 + "primaryKey": false, 88 + "notNull": true, 89 + "autoincrement": false 90 + }, 91 + "date": { 92 + "name": "date", 93 + "type": "integer", 94 + "primaryKey": false, 95 + "notNull": true, 96 + "autoincrement": false 97 + }, 98 + "message": { 99 + "name": "message", 100 + "type": "text", 101 + "primaryKey": false, 102 + "notNull": true, 103 + "autoincrement": false 104 + }, 105 + "incident_id": { 106 + "name": "incident_id", 107 + "type": "integer", 108 + "primaryKey": false, 109 + "notNull": true, 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 + "incident_update_incident_id_incident_id_fk": { 132 + "name": "incident_update_incident_id_incident_id_fk", 133 + "tableFrom": "incident_update", 134 + "tableTo": "incident", 135 + "columnsFrom": [ 136 + "incident_id" 137 + ], 138 + "columnsTo": [ 139 + "id" 140 + ], 141 + "onDelete": "cascade", 142 + "onUpdate": "no action" 143 + } 144 + }, 145 + "compositePrimaryKeys": {}, 146 + "uniqueConstraints": {} 147 + }, 148 + "incidents_to_monitors": { 149 + "name": "incidents_to_monitors", 150 + "columns": { 151 + "monitor_id": { 152 + "name": "monitor_id", 153 + "type": "integer", 154 + "primaryKey": false, 155 + "notNull": true, 156 + "autoincrement": false 157 + }, 158 + "incident_id": { 159 + "name": "incident_id", 160 + "type": "integer", 161 + "primaryKey": false, 162 + "notNull": true, 163 + "autoincrement": false 164 + } 165 + }, 166 + "indexes": {}, 167 + "foreignKeys": { 168 + "incidents_to_monitors_monitor_id_monitor_id_fk": { 169 + "name": "incidents_to_monitors_monitor_id_monitor_id_fk", 170 + "tableFrom": "incidents_to_monitors", 171 + "tableTo": "monitor", 172 + "columnsFrom": [ 173 + "monitor_id" 174 + ], 175 + "columnsTo": [ 176 + "id" 177 + ], 178 + "onDelete": "cascade", 179 + "onUpdate": "no action" 180 + }, 181 + "incidents_to_monitors_incident_id_incident_id_fk": { 182 + "name": "incidents_to_monitors_incident_id_incident_id_fk", 183 + "tableFrom": "incidents_to_monitors", 184 + "tableTo": "incident", 185 + "columnsFrom": [ 186 + "incident_id" 187 + ], 188 + "columnsTo": [ 189 + "id" 190 + ], 191 + "onDelete": "cascade", 192 + "onUpdate": "no action" 193 + } 194 + }, 195 + "compositePrimaryKeys": { 196 + "incidents_to_monitors_monitor_id_incident_id_pk": { 197 + "columns": [ 198 + "incident_id", 199 + "monitor_id" 200 + ] 201 + } 202 + }, 203 + "uniqueConstraints": {} 204 + }, 205 + "page": { 206 + "name": "page", 207 + "columns": { 208 + "id": { 209 + "name": "id", 210 + "type": "integer", 211 + "primaryKey": true, 212 + "notNull": true, 213 + "autoincrement": false 214 + }, 215 + "workspace_id": { 216 + "name": "workspace_id", 217 + "type": "integer", 218 + "primaryKey": false, 219 + "notNull": true, 220 + "autoincrement": false 221 + }, 222 + "title": { 223 + "name": "title", 224 + "type": "text", 225 + "primaryKey": false, 226 + "notNull": true, 227 + "autoincrement": false 228 + }, 229 + "description": { 230 + "name": "description", 231 + "type": "text", 232 + "primaryKey": false, 233 + "notNull": true, 234 + "autoincrement": false 235 + }, 236 + "icon": { 237 + "name": "icon", 238 + "type": "text(256)", 239 + "primaryKey": false, 240 + "notNull": false, 241 + "autoincrement": false 242 + }, 243 + "slug": { 244 + "name": "slug", 245 + "type": "text(256)", 246 + "primaryKey": false, 247 + "notNull": true, 248 + "autoincrement": false 249 + }, 250 + "custom_domain": { 251 + "name": "custom_domain", 252 + "type": "text(256)", 253 + "primaryKey": false, 254 + "notNull": true, 255 + "autoincrement": false 256 + }, 257 + "published": { 258 + "name": "published", 259 + "type": "integer", 260 + "primaryKey": false, 261 + "notNull": false, 262 + "autoincrement": false, 263 + "default": false 264 + }, 265 + "created_at": { 266 + "name": "created_at", 267 + "type": "integer", 268 + "primaryKey": false, 269 + "notNull": false, 270 + "autoincrement": false, 271 + "default": "(strftime('%s', 'now'))" 272 + }, 273 + "updated_at": { 274 + "name": "updated_at", 275 + "type": "integer", 276 + "primaryKey": false, 277 + "notNull": false, 278 + "autoincrement": false, 279 + "default": "(strftime('%s', 'now'))" 280 + } 281 + }, 282 + "indexes": { 283 + "page_slug_unique": { 284 + "name": "page_slug_unique", 285 + "columns": [ 286 + "slug" 287 + ], 288 + "isUnique": true 289 + } 290 + }, 291 + "foreignKeys": { 292 + "page_workspace_id_workspace_id_fk": { 293 + "name": "page_workspace_id_workspace_id_fk", 294 + "tableFrom": "page", 295 + "tableTo": "workspace", 296 + "columnsFrom": [ 297 + "workspace_id" 298 + ], 299 + "columnsTo": [ 300 + "id" 301 + ], 302 + "onDelete": "cascade", 303 + "onUpdate": "no action" 304 + } 305 + }, 306 + "compositePrimaryKeys": {}, 307 + "uniqueConstraints": {} 308 + }, 309 + "monitor": { 310 + "name": "monitor", 311 + "columns": { 312 + "id": { 313 + "name": "id", 314 + "type": "integer", 315 + "primaryKey": true, 316 + "notNull": true, 317 + "autoincrement": false 318 + }, 319 + "job_type": { 320 + "name": "job_type", 321 + "type": "text(3)", 322 + "primaryKey": false, 323 + "notNull": true, 324 + "autoincrement": false, 325 + "default": "'other'" 326 + }, 327 + "periodicity": { 328 + "name": "periodicity", 329 + "type": "text(6)", 330 + "primaryKey": false, 331 + "notNull": true, 332 + "autoincrement": false, 333 + "default": "'other'" 334 + }, 335 + "status": { 336 + "name": "status", 337 + "type": "text(2)", 338 + "primaryKey": false, 339 + "notNull": true, 340 + "autoincrement": false, 341 + "default": "'inactive'" 342 + }, 343 + "active": { 344 + "name": "active", 345 + "type": "integer", 346 + "primaryKey": false, 347 + "notNull": false, 348 + "autoincrement": false, 349 + "default": false 350 + }, 351 + "regions": { 352 + "name": "regions", 353 + "type": "text", 354 + "primaryKey": false, 355 + "notNull": true, 356 + "autoincrement": false, 357 + "default": "''" 358 + }, 359 + "url": { 360 + "name": "url", 361 + "type": "text(512)", 362 + "primaryKey": false, 363 + "notNull": true, 364 + "autoincrement": false 365 + }, 366 + "name": { 367 + "name": "name", 368 + "type": "text(256)", 369 + "primaryKey": false, 370 + "notNull": true, 371 + "autoincrement": false, 372 + "default": "''" 373 + }, 374 + "description": { 375 + "name": "description", 376 + "type": "text", 377 + "primaryKey": false, 378 + "notNull": true, 379 + "autoincrement": false, 380 + "default": "''" 381 + }, 382 + "workspace_id": { 383 + "name": "workspace_id", 384 + "type": "integer", 385 + "primaryKey": false, 386 + "notNull": false, 387 + "autoincrement": false 388 + }, 389 + "created_at": { 390 + "name": "created_at", 391 + "type": "integer", 392 + "primaryKey": false, 393 + "notNull": false, 394 + "autoincrement": false, 395 + "default": "(strftime('%s', 'now'))" 396 + }, 397 + "updated_at": { 398 + "name": "updated_at", 399 + "type": "integer", 400 + "primaryKey": false, 401 + "notNull": false, 402 + "autoincrement": false, 403 + "default": "(strftime('%s', 'now'))" 404 + } 405 + }, 406 + "indexes": {}, 407 + "foreignKeys": { 408 + "monitor_workspace_id_workspace_id_fk": { 409 + "name": "monitor_workspace_id_workspace_id_fk", 410 + "tableFrom": "monitor", 411 + "tableTo": "workspace", 412 + "columnsFrom": [ 413 + "workspace_id" 414 + ], 415 + "columnsTo": [ 416 + "id" 417 + ], 418 + "onDelete": "no action", 419 + "onUpdate": "no action" 420 + } 421 + }, 422 + "compositePrimaryKeys": {}, 423 + "uniqueConstraints": {} 424 + }, 425 + "monitors_to_pages": { 426 + "name": "monitors_to_pages", 427 + "columns": { 428 + "monitor_id": { 429 + "name": "monitor_id", 430 + "type": "integer", 431 + "primaryKey": false, 432 + "notNull": true, 433 + "autoincrement": false 434 + }, 435 + "page_id": { 436 + "name": "page_id", 437 + "type": "integer", 438 + "primaryKey": false, 439 + "notNull": true, 440 + "autoincrement": false 441 + } 442 + }, 443 + "indexes": {}, 444 + "foreignKeys": { 445 + "monitors_to_pages_monitor_id_monitor_id_fk": { 446 + "name": "monitors_to_pages_monitor_id_monitor_id_fk", 447 + "tableFrom": "monitors_to_pages", 448 + "tableTo": "monitor", 449 + "columnsFrom": [ 450 + "monitor_id" 451 + ], 452 + "columnsTo": [ 453 + "id" 454 + ], 455 + "onDelete": "cascade", 456 + "onUpdate": "no action" 457 + }, 458 + "monitors_to_pages_page_id_page_id_fk": { 459 + "name": "monitors_to_pages_page_id_page_id_fk", 460 + "tableFrom": "monitors_to_pages", 461 + "tableTo": "page", 462 + "columnsFrom": [ 463 + "page_id" 464 + ], 465 + "columnsTo": [ 466 + "id" 467 + ], 468 + "onDelete": "cascade", 469 + "onUpdate": "no action" 470 + } 471 + }, 472 + "compositePrimaryKeys": { 473 + "monitors_to_pages_monitor_id_page_id_pk": { 474 + "columns": [ 475 + "monitor_id", 476 + "page_id" 477 + ] 478 + } 479 + }, 480 + "uniqueConstraints": {} 481 + }, 482 + "user": { 483 + "name": "user", 484 + "columns": { 485 + "id": { 486 + "name": "id", 487 + "type": "integer", 488 + "primaryKey": true, 489 + "notNull": true, 490 + "autoincrement": false 491 + }, 492 + "tenant_id": { 493 + "name": "tenant_id", 494 + "type": "text(256)", 495 + "primaryKey": false, 496 + "notNull": false, 497 + "autoincrement": false 498 + }, 499 + "first_name": { 500 + "name": "first_name", 501 + "type": "text", 502 + "primaryKey": false, 503 + "notNull": false, 504 + "autoincrement": false, 505 + "default": "''" 506 + }, 507 + "last_name": { 508 + "name": "last_name", 509 + "type": "text", 510 + "primaryKey": false, 511 + "notNull": false, 512 + "autoincrement": false, 513 + "default": "''" 514 + }, 515 + "email": { 516 + "name": "email", 517 + "type": "text", 518 + "primaryKey": false, 519 + "notNull": false, 520 + "autoincrement": false, 521 + "default": "''" 522 + }, 523 + "photo_url": { 524 + "name": "photo_url", 525 + "type": "text", 526 + "primaryKey": false, 527 + "notNull": false, 528 + "autoincrement": false, 529 + "default": "''" 530 + }, 531 + "created_at": { 532 + "name": "created_at", 533 + "type": "integer", 534 + "primaryKey": false, 535 + "notNull": false, 536 + "autoincrement": false, 537 + "default": "(strftime('%s', 'now'))" 538 + }, 539 + "updated_at": { 540 + "name": "updated_at", 541 + "type": "integer", 542 + "primaryKey": false, 543 + "notNull": false, 544 + "autoincrement": false, 545 + "default": "(strftime('%s', 'now'))" 546 + } 547 + }, 548 + "indexes": { 549 + "user_tenant_id_unique": { 550 + "name": "user_tenant_id_unique", 551 + "columns": [ 552 + "tenant_id" 553 + ], 554 + "isUnique": true 555 + } 556 + }, 557 + "foreignKeys": {}, 558 + "compositePrimaryKeys": {}, 559 + "uniqueConstraints": {} 560 + }, 561 + "users_to_workspaces": { 562 + "name": "users_to_workspaces", 563 + "columns": { 564 + "user_id": { 565 + "name": "user_id", 566 + "type": "integer", 567 + "primaryKey": false, 568 + "notNull": true, 569 + "autoincrement": false 570 + }, 571 + "workspace_id": { 572 + "name": "workspace_id", 573 + "type": "integer", 574 + "primaryKey": false, 575 + "notNull": true, 576 + "autoincrement": false 577 + } 578 + }, 579 + "indexes": {}, 580 + "foreignKeys": { 581 + "users_to_workspaces_user_id_user_id_fk": { 582 + "name": "users_to_workspaces_user_id_user_id_fk", 583 + "tableFrom": "users_to_workspaces", 584 + "tableTo": "user", 585 + "columnsFrom": [ 586 + "user_id" 587 + ], 588 + "columnsTo": [ 589 + "id" 590 + ], 591 + "onDelete": "no action", 592 + "onUpdate": "no action" 593 + }, 594 + "users_to_workspaces_workspace_id_workspace_id_fk": { 595 + "name": "users_to_workspaces_workspace_id_workspace_id_fk", 596 + "tableFrom": "users_to_workspaces", 597 + "tableTo": "workspace", 598 + "columnsFrom": [ 599 + "workspace_id" 600 + ], 601 + "columnsTo": [ 602 + "id" 603 + ], 604 + "onDelete": "no action", 605 + "onUpdate": "no action" 606 + } 607 + }, 608 + "compositePrimaryKeys": { 609 + "users_to_workspaces_user_id_workspace_id_pk": { 610 + "columns": [ 611 + "user_id", 612 + "workspace_id" 613 + ] 614 + } 615 + }, 616 + "uniqueConstraints": {} 617 + }, 618 + "workspace": { 619 + "name": "workspace", 620 + "columns": { 621 + "id": { 622 + "name": "id", 623 + "type": "integer", 624 + "primaryKey": true, 625 + "notNull": true, 626 + "autoincrement": false 627 + }, 628 + "slug": { 629 + "name": "slug", 630 + "type": "text", 631 + "primaryKey": false, 632 + "notNull": true, 633 + "autoincrement": false 634 + }, 635 + "stripe_id": { 636 + "name": "stripe_id", 637 + "type": "text(256)", 638 + "primaryKey": false, 639 + "notNull": false, 640 + "autoincrement": false 641 + }, 642 + "name": { 643 + "name": "name", 644 + "type": "text", 645 + "primaryKey": false, 646 + "notNull": false, 647 + "autoincrement": false 648 + }, 649 + "created_at": { 650 + "name": "created_at", 651 + "type": "integer", 652 + "primaryKey": false, 653 + "notNull": false, 654 + "autoincrement": false, 655 + "default": "(strftime('%s', 'now'))" 656 + }, 657 + "updated_at": { 658 + "name": "updated_at", 659 + "type": "integer", 660 + "primaryKey": false, 661 + "notNull": false, 662 + "autoincrement": false, 663 + "default": "(strftime('%s', 'now'))" 664 + } 665 + }, 666 + "indexes": { 667 + "workspace_slug_unique": { 668 + "name": "workspace_slug_unique", 669 + "columns": [ 670 + "slug" 671 + ], 672 + "isUnique": true 673 + }, 674 + "workspace_stripe_id_unique": { 675 + "name": "workspace_stripe_id_unique", 676 + "columns": [ 677 + "stripe_id" 678 + ], 679 + "isUnique": true 680 + } 681 + }, 682 + "foreignKeys": {}, 683 + "compositePrimaryKeys": {}, 684 + "uniqueConstraints": {} 685 + } 686 + }, 687 + "enums": {}, 688 + "_meta": { 689 + "schemas": {}, 690 + "tables": {}, 691 + "columns": {} 692 + } 693 + }
+7
packages/db/drizzle/meta/_journal.json
··· 29 29 "when": 1691614487733, 30 30 "tag": "0003_glamorous_living_mummy", 31 31 "breakpoints": true 32 + }, 33 + { 34 + "idx": 4, 35 + "version": "5", 36 + "when": 1691850907670, 37 + "tag": "0004_fixed_dakota_north", 38 + "breakpoints": true 32 39 } 33 40 ] 34 41 }
+1 -1
packages/db/src/schema/monitor.ts
··· 56 56 57 57 workspaceId: integer("workspace_id").references(() => workspace.id), 58 58 59 - createdAt: integer("updated_at", { mode: "timestamp" }).default( 59 + createdAt: integer("created_at", { mode: "timestamp" }).default( 60 60 sql`(strftime('%s', 'now'))`, 61 61 ), 62 62 updatedAt: integer("updated_at", { mode: "timestamp" }).default(
+1 -1
packages/db/src/schema/page.ts
··· 25 25 customDomain: text("custom_domain", { length: 256 }).notNull(), 26 26 published: integer("published", { mode: "boolean" }).default(false), 27 27 28 - createdAt: integer("updated_at", { mode: "timestamp" }).default( 28 + createdAt: integer("created_at", { mode: "timestamp" }).default( 29 29 sql`(strftime('%s', 'now'))`, 30 30 ), 31 31 updatedAt: integer("updated_at", { mode: "timestamp" }).default(
+1 -1
packages/db/src/schema/user.ts
··· 17 17 email: text("email").default(""), 18 18 photoUrl: text("photo_url").default(""), 19 19 20 - createdAt: integer("updated_at", { mode: "timestamp" }).default( 20 + createdAt: integer("created_at", { mode: "timestamp" }).default( 21 21 sql`(strftime('%s', 'now'))`, 22 22 ), 23 23 updatedAt: integer("updated_at", { mode: "timestamp" }).default(
+1 -1
packages/db/src/schema/workspace.ts
··· 10 10 stripeId: text("stripe_id", { length: 256 }).unique(), 11 11 name: text("name"), 12 12 13 - createdAt: integer("updated_at", { mode: "timestamp" }).default( 13 + createdAt: integer("created_at", { mode: "timestamp" }).default( 14 14 sql`(strftime('%s', 'now'))`, 15 15 ), 16 16 updatedAt: integer("updated_at", { mode: "timestamp" }).default(