kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(db): add api key migration

+1671
+27
apps/api/drizzle/0008_square_silvermane.sql
··· 1 + CREATE TABLE "apikey" ( 2 + "id" text PRIMARY KEY NOT NULL, 3 + "name" text, 4 + "start" text, 5 + "prefix" text, 6 + "key" text NOT NULL, 7 + "user_id" text NOT NULL, 8 + "refill_interval" integer, 9 + "refill_amount" integer, 10 + "last_refill_at" timestamp, 11 + "enabled" boolean DEFAULT true, 12 + "rate_limit_enabled" boolean DEFAULT true, 13 + "rate_limit_time_window" integer DEFAULT 86400000, 14 + "rate_limit_max" integer DEFAULT 10, 15 + "request_count" integer DEFAULT 0, 16 + "remaining" integer, 17 + "last_request" timestamp, 18 + "expires_at" timestamp, 19 + "created_at" timestamp NOT NULL, 20 + "updated_at" timestamp NOT NULL, 21 + "permissions" text, 22 + "metadata" text 23 + ); 24 + --> statement-breakpoint 25 + ALTER TABLE "apikey" ADD CONSTRAINT "apikey_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint 26 + CREATE INDEX "apikey_key_idx" ON "apikey" USING btree ("key");--> statement-breakpoint 27 + CREATE INDEX "apikey_userId_idx" ON "apikey" USING btree ("user_id");
+1644
apps/api/drizzle/meta/0008_snapshot.json
··· 1 + { 2 + "id": "e1f2cb4b-1889-4d18-acc6-7909b3a97579", 3 + "prevId": "8e96c8e6-f2d0-4265-8207-61a6332b7b0c", 4 + "version": "7", 5 + "dialect": "postgresql", 6 + "tables": { 7 + "public.account": { 8 + "name": "account", 9 + "schema": "", 10 + "columns": { 11 + "id": { 12 + "name": "id", 13 + "type": "text", 14 + "primaryKey": true, 15 + "notNull": true 16 + }, 17 + "account_id": { 18 + "name": "account_id", 19 + "type": "text", 20 + "primaryKey": false, 21 + "notNull": true 22 + }, 23 + "provider_id": { 24 + "name": "provider_id", 25 + "type": "text", 26 + "primaryKey": false, 27 + "notNull": true 28 + }, 29 + "user_id": { 30 + "name": "user_id", 31 + "type": "text", 32 + "primaryKey": false, 33 + "notNull": true 34 + }, 35 + "access_token": { 36 + "name": "access_token", 37 + "type": "text", 38 + "primaryKey": false, 39 + "notNull": false 40 + }, 41 + "refresh_token": { 42 + "name": "refresh_token", 43 + "type": "text", 44 + "primaryKey": false, 45 + "notNull": false 46 + }, 47 + "id_token": { 48 + "name": "id_token", 49 + "type": "text", 50 + "primaryKey": false, 51 + "notNull": false 52 + }, 53 + "access_token_expires_at": { 54 + "name": "access_token_expires_at", 55 + "type": "timestamp", 56 + "primaryKey": false, 57 + "notNull": false 58 + }, 59 + "refresh_token_expires_at": { 60 + "name": "refresh_token_expires_at", 61 + "type": "timestamp", 62 + "primaryKey": false, 63 + "notNull": false 64 + }, 65 + "scope": { 66 + "name": "scope", 67 + "type": "text", 68 + "primaryKey": false, 69 + "notNull": false 70 + }, 71 + "password": { 72 + "name": "password", 73 + "type": "text", 74 + "primaryKey": false, 75 + "notNull": false 76 + }, 77 + "created_at": { 78 + "name": "created_at", 79 + "type": "timestamp", 80 + "primaryKey": false, 81 + "notNull": true, 82 + "default": "now()" 83 + }, 84 + "updated_at": { 85 + "name": "updated_at", 86 + "type": "timestamp", 87 + "primaryKey": false, 88 + "notNull": true 89 + } 90 + }, 91 + "indexes": { 92 + "account_userId_idx": { 93 + "name": "account_userId_idx", 94 + "columns": [ 95 + { 96 + "expression": "user_id", 97 + "isExpression": false, 98 + "asc": true, 99 + "nulls": "last" 100 + } 101 + ], 102 + "isUnique": false, 103 + "concurrently": false, 104 + "method": "btree", 105 + "with": {} 106 + } 107 + }, 108 + "foreignKeys": { 109 + "account_user_id_user_id_fk": { 110 + "name": "account_user_id_user_id_fk", 111 + "tableFrom": "account", 112 + "tableTo": "user", 113 + "columnsFrom": [ 114 + "user_id" 115 + ], 116 + "columnsTo": [ 117 + "id" 118 + ], 119 + "onDelete": "cascade", 120 + "onUpdate": "no action" 121 + } 122 + }, 123 + "compositePrimaryKeys": {}, 124 + "uniqueConstraints": {}, 125 + "policies": {}, 126 + "checkConstraints": {}, 127 + "isRLSEnabled": false 128 + }, 129 + "public.activity": { 130 + "name": "activity", 131 + "schema": "", 132 + "columns": { 133 + "id": { 134 + "name": "id", 135 + "type": "text", 136 + "primaryKey": true, 137 + "notNull": true 138 + }, 139 + "task_id": { 140 + "name": "task_id", 141 + "type": "text", 142 + "primaryKey": false, 143 + "notNull": true 144 + }, 145 + "type": { 146 + "name": "type", 147 + "type": "text", 148 + "primaryKey": false, 149 + "notNull": true 150 + }, 151 + "created_at": { 152 + "name": "created_at", 153 + "type": "timestamp", 154 + "primaryKey": false, 155 + "notNull": true, 156 + "default": "now()" 157 + }, 158 + "user_id": { 159 + "name": "user_id", 160 + "type": "text", 161 + "primaryKey": false, 162 + "notNull": true 163 + }, 164 + "content": { 165 + "name": "content", 166 + "type": "text", 167 + "primaryKey": false, 168 + "notNull": false 169 + } 170 + }, 171 + "indexes": {}, 172 + "foreignKeys": { 173 + "activity_task_id_task_id_fk": { 174 + "name": "activity_task_id_task_id_fk", 175 + "tableFrom": "activity", 176 + "tableTo": "task", 177 + "columnsFrom": [ 178 + "task_id" 179 + ], 180 + "columnsTo": [ 181 + "id" 182 + ], 183 + "onDelete": "cascade", 184 + "onUpdate": "cascade" 185 + }, 186 + "activity_user_id_user_id_fk": { 187 + "name": "activity_user_id_user_id_fk", 188 + "tableFrom": "activity", 189 + "tableTo": "user", 190 + "columnsFrom": [ 191 + "user_id" 192 + ], 193 + "columnsTo": [ 194 + "id" 195 + ], 196 + "onDelete": "cascade", 197 + "onUpdate": "cascade" 198 + } 199 + }, 200 + "compositePrimaryKeys": {}, 201 + "uniqueConstraints": {}, 202 + "policies": {}, 203 + "checkConstraints": {}, 204 + "isRLSEnabled": false 205 + }, 206 + "public.apikey": { 207 + "name": "apikey", 208 + "schema": "", 209 + "columns": { 210 + "id": { 211 + "name": "id", 212 + "type": "text", 213 + "primaryKey": true, 214 + "notNull": true 215 + }, 216 + "name": { 217 + "name": "name", 218 + "type": "text", 219 + "primaryKey": false, 220 + "notNull": false 221 + }, 222 + "start": { 223 + "name": "start", 224 + "type": "text", 225 + "primaryKey": false, 226 + "notNull": false 227 + }, 228 + "prefix": { 229 + "name": "prefix", 230 + "type": "text", 231 + "primaryKey": false, 232 + "notNull": false 233 + }, 234 + "key": { 235 + "name": "key", 236 + "type": "text", 237 + "primaryKey": false, 238 + "notNull": true 239 + }, 240 + "user_id": { 241 + "name": "user_id", 242 + "type": "text", 243 + "primaryKey": false, 244 + "notNull": true 245 + }, 246 + "refill_interval": { 247 + "name": "refill_interval", 248 + "type": "integer", 249 + "primaryKey": false, 250 + "notNull": false 251 + }, 252 + "refill_amount": { 253 + "name": "refill_amount", 254 + "type": "integer", 255 + "primaryKey": false, 256 + "notNull": false 257 + }, 258 + "last_refill_at": { 259 + "name": "last_refill_at", 260 + "type": "timestamp", 261 + "primaryKey": false, 262 + "notNull": false 263 + }, 264 + "enabled": { 265 + "name": "enabled", 266 + "type": "boolean", 267 + "primaryKey": false, 268 + "notNull": false, 269 + "default": true 270 + }, 271 + "rate_limit_enabled": { 272 + "name": "rate_limit_enabled", 273 + "type": "boolean", 274 + "primaryKey": false, 275 + "notNull": false, 276 + "default": true 277 + }, 278 + "rate_limit_time_window": { 279 + "name": "rate_limit_time_window", 280 + "type": "integer", 281 + "primaryKey": false, 282 + "notNull": false, 283 + "default": 86400000 284 + }, 285 + "rate_limit_max": { 286 + "name": "rate_limit_max", 287 + "type": "integer", 288 + "primaryKey": false, 289 + "notNull": false, 290 + "default": 10 291 + }, 292 + "request_count": { 293 + "name": "request_count", 294 + "type": "integer", 295 + "primaryKey": false, 296 + "notNull": false, 297 + "default": 0 298 + }, 299 + "remaining": { 300 + "name": "remaining", 301 + "type": "integer", 302 + "primaryKey": false, 303 + "notNull": false 304 + }, 305 + "last_request": { 306 + "name": "last_request", 307 + "type": "timestamp", 308 + "primaryKey": false, 309 + "notNull": false 310 + }, 311 + "expires_at": { 312 + "name": "expires_at", 313 + "type": "timestamp", 314 + "primaryKey": false, 315 + "notNull": false 316 + }, 317 + "created_at": { 318 + "name": "created_at", 319 + "type": "timestamp", 320 + "primaryKey": false, 321 + "notNull": true 322 + }, 323 + "updated_at": { 324 + "name": "updated_at", 325 + "type": "timestamp", 326 + "primaryKey": false, 327 + "notNull": true 328 + }, 329 + "permissions": { 330 + "name": "permissions", 331 + "type": "text", 332 + "primaryKey": false, 333 + "notNull": false 334 + }, 335 + "metadata": { 336 + "name": "metadata", 337 + "type": "text", 338 + "primaryKey": false, 339 + "notNull": false 340 + } 341 + }, 342 + "indexes": { 343 + "apikey_key_idx": { 344 + "name": "apikey_key_idx", 345 + "columns": [ 346 + { 347 + "expression": "key", 348 + "isExpression": false, 349 + "asc": true, 350 + "nulls": "last" 351 + } 352 + ], 353 + "isUnique": false, 354 + "concurrently": false, 355 + "method": "btree", 356 + "with": {} 357 + }, 358 + "apikey_userId_idx": { 359 + "name": "apikey_userId_idx", 360 + "columns": [ 361 + { 362 + "expression": "user_id", 363 + "isExpression": false, 364 + "asc": true, 365 + "nulls": "last" 366 + } 367 + ], 368 + "isUnique": false, 369 + "concurrently": false, 370 + "method": "btree", 371 + "with": {} 372 + } 373 + }, 374 + "foreignKeys": { 375 + "apikey_user_id_user_id_fk": { 376 + "name": "apikey_user_id_user_id_fk", 377 + "tableFrom": "apikey", 378 + "tableTo": "user", 379 + "columnsFrom": [ 380 + "user_id" 381 + ], 382 + "columnsTo": [ 383 + "id" 384 + ], 385 + "onDelete": "cascade", 386 + "onUpdate": "no action" 387 + } 388 + }, 389 + "compositePrimaryKeys": {}, 390 + "uniqueConstraints": {}, 391 + "policies": {}, 392 + "checkConstraints": {}, 393 + "isRLSEnabled": false 394 + }, 395 + "public.github_integration": { 396 + "name": "github_integration", 397 + "schema": "", 398 + "columns": { 399 + "id": { 400 + "name": "id", 401 + "type": "text", 402 + "primaryKey": true, 403 + "notNull": true 404 + }, 405 + "project_id": { 406 + "name": "project_id", 407 + "type": "text", 408 + "primaryKey": false, 409 + "notNull": true 410 + }, 411 + "repository_owner": { 412 + "name": "repository_owner", 413 + "type": "text", 414 + "primaryKey": false, 415 + "notNull": true 416 + }, 417 + "repository_name": { 418 + "name": "repository_name", 419 + "type": "text", 420 + "primaryKey": false, 421 + "notNull": true 422 + }, 423 + "installation_id": { 424 + "name": "installation_id", 425 + "type": "integer", 426 + "primaryKey": false, 427 + "notNull": false 428 + }, 429 + "is_active": { 430 + "name": "is_active", 431 + "type": "boolean", 432 + "primaryKey": false, 433 + "notNull": false, 434 + "default": true 435 + }, 436 + "created_at": { 437 + "name": "created_at", 438 + "type": "timestamp", 439 + "primaryKey": false, 440 + "notNull": true, 441 + "default": "now()" 442 + }, 443 + "updated_at": { 444 + "name": "updated_at", 445 + "type": "timestamp", 446 + "primaryKey": false, 447 + "notNull": true, 448 + "default": "now()" 449 + } 450 + }, 451 + "indexes": {}, 452 + "foreignKeys": { 453 + "github_integration_project_id_project_id_fk": { 454 + "name": "github_integration_project_id_project_id_fk", 455 + "tableFrom": "github_integration", 456 + "tableTo": "project", 457 + "columnsFrom": [ 458 + "project_id" 459 + ], 460 + "columnsTo": [ 461 + "id" 462 + ], 463 + "onDelete": "cascade", 464 + "onUpdate": "cascade" 465 + } 466 + }, 467 + "compositePrimaryKeys": {}, 468 + "uniqueConstraints": { 469 + "github_integration_project_id_unique": { 470 + "name": "github_integration_project_id_unique", 471 + "nullsNotDistinct": false, 472 + "columns": [ 473 + "project_id" 474 + ] 475 + } 476 + }, 477 + "policies": {}, 478 + "checkConstraints": {}, 479 + "isRLSEnabled": false 480 + }, 481 + "public.invitation": { 482 + "name": "invitation", 483 + "schema": "", 484 + "columns": { 485 + "id": { 486 + "name": "id", 487 + "type": "text", 488 + "primaryKey": true, 489 + "notNull": true 490 + }, 491 + "workspace_id": { 492 + "name": "workspace_id", 493 + "type": "text", 494 + "primaryKey": false, 495 + "notNull": true 496 + }, 497 + "email": { 498 + "name": "email", 499 + "type": "text", 500 + "primaryKey": false, 501 + "notNull": true 502 + }, 503 + "role": { 504 + "name": "role", 505 + "type": "text", 506 + "primaryKey": false, 507 + "notNull": false 508 + }, 509 + "team_id": { 510 + "name": "team_id", 511 + "type": "text", 512 + "primaryKey": false, 513 + "notNull": false 514 + }, 515 + "status": { 516 + "name": "status", 517 + "type": "text", 518 + "primaryKey": false, 519 + "notNull": true, 520 + "default": "'pending'" 521 + }, 522 + "expires_at": { 523 + "name": "expires_at", 524 + "type": "timestamp", 525 + "primaryKey": false, 526 + "notNull": true 527 + }, 528 + "created_at": { 529 + "name": "created_at", 530 + "type": "timestamp", 531 + "primaryKey": false, 532 + "notNull": true, 533 + "default": "now()" 534 + }, 535 + "inviter_id": { 536 + "name": "inviter_id", 537 + "type": "text", 538 + "primaryKey": false, 539 + "notNull": true 540 + } 541 + }, 542 + "indexes": { 543 + "invitation_workspaceId_idx": { 544 + "name": "invitation_workspaceId_idx", 545 + "columns": [ 546 + { 547 + "expression": "workspace_id", 548 + "isExpression": false, 549 + "asc": true, 550 + "nulls": "last" 551 + } 552 + ], 553 + "isUnique": false, 554 + "concurrently": false, 555 + "method": "btree", 556 + "with": {} 557 + }, 558 + "invitation_email_idx": { 559 + "name": "invitation_email_idx", 560 + "columns": [ 561 + { 562 + "expression": "email", 563 + "isExpression": false, 564 + "asc": true, 565 + "nulls": "last" 566 + } 567 + ], 568 + "isUnique": false, 569 + "concurrently": false, 570 + "method": "btree", 571 + "with": {} 572 + } 573 + }, 574 + "foreignKeys": { 575 + "invitation_workspace_id_workspace_id_fk": { 576 + "name": "invitation_workspace_id_workspace_id_fk", 577 + "tableFrom": "invitation", 578 + "tableTo": "workspace", 579 + "columnsFrom": [ 580 + "workspace_id" 581 + ], 582 + "columnsTo": [ 583 + "id" 584 + ], 585 + "onDelete": "cascade", 586 + "onUpdate": "no action" 587 + }, 588 + "invitation_inviter_id_user_id_fk": { 589 + "name": "invitation_inviter_id_user_id_fk", 590 + "tableFrom": "invitation", 591 + "tableTo": "user", 592 + "columnsFrom": [ 593 + "inviter_id" 594 + ], 595 + "columnsTo": [ 596 + "id" 597 + ], 598 + "onDelete": "cascade", 599 + "onUpdate": "no action" 600 + } 601 + }, 602 + "compositePrimaryKeys": {}, 603 + "uniqueConstraints": {}, 604 + "policies": {}, 605 + "checkConstraints": {}, 606 + "isRLSEnabled": false 607 + }, 608 + "public.label": { 609 + "name": "label", 610 + "schema": "", 611 + "columns": { 612 + "id": { 613 + "name": "id", 614 + "type": "text", 615 + "primaryKey": true, 616 + "notNull": true 617 + }, 618 + "name": { 619 + "name": "name", 620 + "type": "text", 621 + "primaryKey": false, 622 + "notNull": true 623 + }, 624 + "color": { 625 + "name": "color", 626 + "type": "text", 627 + "primaryKey": false, 628 + "notNull": true 629 + }, 630 + "created_at": { 631 + "name": "created_at", 632 + "type": "timestamp", 633 + "primaryKey": false, 634 + "notNull": true, 635 + "default": "now()" 636 + }, 637 + "task_id": { 638 + "name": "task_id", 639 + "type": "text", 640 + "primaryKey": false, 641 + "notNull": false 642 + }, 643 + "workspace_id": { 644 + "name": "workspace_id", 645 + "type": "text", 646 + "primaryKey": false, 647 + "notNull": false 648 + } 649 + }, 650 + "indexes": {}, 651 + "foreignKeys": { 652 + "label_task_id_task_id_fk": { 653 + "name": "label_task_id_task_id_fk", 654 + "tableFrom": "label", 655 + "tableTo": "task", 656 + "columnsFrom": [ 657 + "task_id" 658 + ], 659 + "columnsTo": [ 660 + "id" 661 + ], 662 + "onDelete": "cascade", 663 + "onUpdate": "cascade" 664 + }, 665 + "label_workspace_id_workspace_id_fk": { 666 + "name": "label_workspace_id_workspace_id_fk", 667 + "tableFrom": "label", 668 + "tableTo": "workspace", 669 + "columnsFrom": [ 670 + "workspace_id" 671 + ], 672 + "columnsTo": [ 673 + "id" 674 + ], 675 + "onDelete": "cascade", 676 + "onUpdate": "cascade" 677 + } 678 + }, 679 + "compositePrimaryKeys": {}, 680 + "uniqueConstraints": {}, 681 + "policies": {}, 682 + "checkConstraints": {}, 683 + "isRLSEnabled": false 684 + }, 685 + "public.notification": { 686 + "name": "notification", 687 + "schema": "", 688 + "columns": { 689 + "id": { 690 + "name": "id", 691 + "type": "text", 692 + "primaryKey": true, 693 + "notNull": true 694 + }, 695 + "user_id": { 696 + "name": "user_id", 697 + "type": "text", 698 + "primaryKey": false, 699 + "notNull": true 700 + }, 701 + "title": { 702 + "name": "title", 703 + "type": "text", 704 + "primaryKey": false, 705 + "notNull": true 706 + }, 707 + "content": { 708 + "name": "content", 709 + "type": "text", 710 + "primaryKey": false, 711 + "notNull": false 712 + }, 713 + "type": { 714 + "name": "type", 715 + "type": "text", 716 + "primaryKey": false, 717 + "notNull": true, 718 + "default": "'info'" 719 + }, 720 + "is_read": { 721 + "name": "is_read", 722 + "type": "boolean", 723 + "primaryKey": false, 724 + "notNull": false, 725 + "default": false 726 + }, 727 + "resource_id": { 728 + "name": "resource_id", 729 + "type": "text", 730 + "primaryKey": false, 731 + "notNull": false 732 + }, 733 + "resource_type": { 734 + "name": "resource_type", 735 + "type": "text", 736 + "primaryKey": false, 737 + "notNull": false 738 + }, 739 + "created_at": { 740 + "name": "created_at", 741 + "type": "timestamp with time zone", 742 + "primaryKey": false, 743 + "notNull": true, 744 + "default": "now()" 745 + } 746 + }, 747 + "indexes": {}, 748 + "foreignKeys": { 749 + "notification_user_id_user_id_fk": { 750 + "name": "notification_user_id_user_id_fk", 751 + "tableFrom": "notification", 752 + "tableTo": "user", 753 + "columnsFrom": [ 754 + "user_id" 755 + ], 756 + "columnsTo": [ 757 + "id" 758 + ], 759 + "onDelete": "cascade", 760 + "onUpdate": "cascade" 761 + } 762 + }, 763 + "compositePrimaryKeys": {}, 764 + "uniqueConstraints": {}, 765 + "policies": {}, 766 + "checkConstraints": {}, 767 + "isRLSEnabled": false 768 + }, 769 + "public.project": { 770 + "name": "project", 771 + "schema": "", 772 + "columns": { 773 + "id": { 774 + "name": "id", 775 + "type": "text", 776 + "primaryKey": true, 777 + "notNull": true 778 + }, 779 + "workspace_id": { 780 + "name": "workspace_id", 781 + "type": "text", 782 + "primaryKey": false, 783 + "notNull": true 784 + }, 785 + "slug": { 786 + "name": "slug", 787 + "type": "text", 788 + "primaryKey": false, 789 + "notNull": true 790 + }, 791 + "icon": { 792 + "name": "icon", 793 + "type": "text", 794 + "primaryKey": false, 795 + "notNull": false, 796 + "default": "'Layout'" 797 + }, 798 + "name": { 799 + "name": "name", 800 + "type": "text", 801 + "primaryKey": false, 802 + "notNull": true 803 + }, 804 + "description": { 805 + "name": "description", 806 + "type": "text", 807 + "primaryKey": false, 808 + "notNull": false 809 + }, 810 + "created_at": { 811 + "name": "created_at", 812 + "type": "timestamp", 813 + "primaryKey": false, 814 + "notNull": true, 815 + "default": "now()" 816 + }, 817 + "is_public": { 818 + "name": "is_public", 819 + "type": "boolean", 820 + "primaryKey": false, 821 + "notNull": false, 822 + "default": false 823 + } 824 + }, 825 + "indexes": {}, 826 + "foreignKeys": { 827 + "project_workspace_id_workspace_id_fk": { 828 + "name": "project_workspace_id_workspace_id_fk", 829 + "tableFrom": "project", 830 + "tableTo": "workspace", 831 + "columnsFrom": [ 832 + "workspace_id" 833 + ], 834 + "columnsTo": [ 835 + "id" 836 + ], 837 + "onDelete": "cascade", 838 + "onUpdate": "cascade" 839 + } 840 + }, 841 + "compositePrimaryKeys": {}, 842 + "uniqueConstraints": {}, 843 + "policies": {}, 844 + "checkConstraints": {}, 845 + "isRLSEnabled": false 846 + }, 847 + "public.session": { 848 + "name": "session", 849 + "schema": "", 850 + "columns": { 851 + "id": { 852 + "name": "id", 853 + "type": "text", 854 + "primaryKey": true, 855 + "notNull": true 856 + }, 857 + "expires_at": { 858 + "name": "expires_at", 859 + "type": "timestamp", 860 + "primaryKey": false, 861 + "notNull": true 862 + }, 863 + "token": { 864 + "name": "token", 865 + "type": "text", 866 + "primaryKey": false, 867 + "notNull": true 868 + }, 869 + "created_at": { 870 + "name": "created_at", 871 + "type": "timestamp", 872 + "primaryKey": false, 873 + "notNull": true, 874 + "default": "now()" 875 + }, 876 + "updated_at": { 877 + "name": "updated_at", 878 + "type": "timestamp", 879 + "primaryKey": false, 880 + "notNull": true 881 + }, 882 + "ip_address": { 883 + "name": "ip_address", 884 + "type": "text", 885 + "primaryKey": false, 886 + "notNull": false 887 + }, 888 + "user_agent": { 889 + "name": "user_agent", 890 + "type": "text", 891 + "primaryKey": false, 892 + "notNull": false 893 + }, 894 + "user_id": { 895 + "name": "user_id", 896 + "type": "text", 897 + "primaryKey": false, 898 + "notNull": true 899 + }, 900 + "active_organization_id": { 901 + "name": "active_organization_id", 902 + "type": "text", 903 + "primaryKey": false, 904 + "notNull": false 905 + }, 906 + "active_team_id": { 907 + "name": "active_team_id", 908 + "type": "text", 909 + "primaryKey": false, 910 + "notNull": false 911 + } 912 + }, 913 + "indexes": { 914 + "session_userId_idx": { 915 + "name": "session_userId_idx", 916 + "columns": [ 917 + { 918 + "expression": "user_id", 919 + "isExpression": false, 920 + "asc": true, 921 + "nulls": "last" 922 + } 923 + ], 924 + "isUnique": false, 925 + "concurrently": false, 926 + "method": "btree", 927 + "with": {} 928 + } 929 + }, 930 + "foreignKeys": { 931 + "session_user_id_user_id_fk": { 932 + "name": "session_user_id_user_id_fk", 933 + "tableFrom": "session", 934 + "tableTo": "user", 935 + "columnsFrom": [ 936 + "user_id" 937 + ], 938 + "columnsTo": [ 939 + "id" 940 + ], 941 + "onDelete": "cascade", 942 + "onUpdate": "no action" 943 + } 944 + }, 945 + "compositePrimaryKeys": {}, 946 + "uniqueConstraints": { 947 + "session_token_unique": { 948 + "name": "session_token_unique", 949 + "nullsNotDistinct": false, 950 + "columns": [ 951 + "token" 952 + ] 953 + } 954 + }, 955 + "policies": {}, 956 + "checkConstraints": {}, 957 + "isRLSEnabled": false 958 + }, 959 + "public.task": { 960 + "name": "task", 961 + "schema": "", 962 + "columns": { 963 + "id": { 964 + "name": "id", 965 + "type": "text", 966 + "primaryKey": true, 967 + "notNull": true 968 + }, 969 + "project_id": { 970 + "name": "project_id", 971 + "type": "text", 972 + "primaryKey": false, 973 + "notNull": true 974 + }, 975 + "position": { 976 + "name": "position", 977 + "type": "integer", 978 + "primaryKey": false, 979 + "notNull": false, 980 + "default": 0 981 + }, 982 + "number": { 983 + "name": "number", 984 + "type": "integer", 985 + "primaryKey": false, 986 + "notNull": false, 987 + "default": 1 988 + }, 989 + "assignee_id": { 990 + "name": "assignee_id", 991 + "type": "text", 992 + "primaryKey": false, 993 + "notNull": false 994 + }, 995 + "title": { 996 + "name": "title", 997 + "type": "text", 998 + "primaryKey": false, 999 + "notNull": true 1000 + }, 1001 + "description": { 1002 + "name": "description", 1003 + "type": "text", 1004 + "primaryKey": false, 1005 + "notNull": false 1006 + }, 1007 + "status": { 1008 + "name": "status", 1009 + "type": "text", 1010 + "primaryKey": false, 1011 + "notNull": true, 1012 + "default": "'to-do'" 1013 + }, 1014 + "priority": { 1015 + "name": "priority", 1016 + "type": "text", 1017 + "primaryKey": false, 1018 + "notNull": false, 1019 + "default": "'low'" 1020 + }, 1021 + "due_date": { 1022 + "name": "due_date", 1023 + "type": "timestamp", 1024 + "primaryKey": false, 1025 + "notNull": false 1026 + }, 1027 + "created_at": { 1028 + "name": "created_at", 1029 + "type": "timestamp", 1030 + "primaryKey": false, 1031 + "notNull": true, 1032 + "default": "now()" 1033 + } 1034 + }, 1035 + "indexes": {}, 1036 + "foreignKeys": { 1037 + "task_project_id_project_id_fk": { 1038 + "name": "task_project_id_project_id_fk", 1039 + "tableFrom": "task", 1040 + "tableTo": "project", 1041 + "columnsFrom": [ 1042 + "project_id" 1043 + ], 1044 + "columnsTo": [ 1045 + "id" 1046 + ], 1047 + "onDelete": "cascade", 1048 + "onUpdate": "cascade" 1049 + }, 1050 + "task_assignee_id_user_id_fk": { 1051 + "name": "task_assignee_id_user_id_fk", 1052 + "tableFrom": "task", 1053 + "tableTo": "user", 1054 + "columnsFrom": [ 1055 + "assignee_id" 1056 + ], 1057 + "columnsTo": [ 1058 + "id" 1059 + ], 1060 + "onDelete": "cascade", 1061 + "onUpdate": "cascade" 1062 + } 1063 + }, 1064 + "compositePrimaryKeys": {}, 1065 + "uniqueConstraints": {}, 1066 + "policies": {}, 1067 + "checkConstraints": {}, 1068 + "isRLSEnabled": false 1069 + }, 1070 + "public.team_member": { 1071 + "name": "team_member", 1072 + "schema": "", 1073 + "columns": { 1074 + "id": { 1075 + "name": "id", 1076 + "type": "text", 1077 + "primaryKey": true, 1078 + "notNull": true 1079 + }, 1080 + "team_id": { 1081 + "name": "team_id", 1082 + "type": "text", 1083 + "primaryKey": false, 1084 + "notNull": true 1085 + }, 1086 + "user_id": { 1087 + "name": "user_id", 1088 + "type": "text", 1089 + "primaryKey": false, 1090 + "notNull": true 1091 + }, 1092 + "created_at": { 1093 + "name": "created_at", 1094 + "type": "timestamp", 1095 + "primaryKey": false, 1096 + "notNull": false 1097 + } 1098 + }, 1099 + "indexes": { 1100 + "teamMember_teamId_idx": { 1101 + "name": "teamMember_teamId_idx", 1102 + "columns": [ 1103 + { 1104 + "expression": "team_id", 1105 + "isExpression": false, 1106 + "asc": true, 1107 + "nulls": "last" 1108 + } 1109 + ], 1110 + "isUnique": false, 1111 + "concurrently": false, 1112 + "method": "btree", 1113 + "with": {} 1114 + }, 1115 + "teamMember_userId_idx": { 1116 + "name": "teamMember_userId_idx", 1117 + "columns": [ 1118 + { 1119 + "expression": "user_id", 1120 + "isExpression": false, 1121 + "asc": true, 1122 + "nulls": "last" 1123 + } 1124 + ], 1125 + "isUnique": false, 1126 + "concurrently": false, 1127 + "method": "btree", 1128 + "with": {} 1129 + } 1130 + }, 1131 + "foreignKeys": { 1132 + "team_member_team_id_team_id_fk": { 1133 + "name": "team_member_team_id_team_id_fk", 1134 + "tableFrom": "team_member", 1135 + "tableTo": "team", 1136 + "columnsFrom": [ 1137 + "team_id" 1138 + ], 1139 + "columnsTo": [ 1140 + "id" 1141 + ], 1142 + "onDelete": "cascade", 1143 + "onUpdate": "no action" 1144 + }, 1145 + "team_member_user_id_user_id_fk": { 1146 + "name": "team_member_user_id_user_id_fk", 1147 + "tableFrom": "team_member", 1148 + "tableTo": "user", 1149 + "columnsFrom": [ 1150 + "user_id" 1151 + ], 1152 + "columnsTo": [ 1153 + "id" 1154 + ], 1155 + "onDelete": "cascade", 1156 + "onUpdate": "no action" 1157 + } 1158 + }, 1159 + "compositePrimaryKeys": {}, 1160 + "uniqueConstraints": {}, 1161 + "policies": {}, 1162 + "checkConstraints": {}, 1163 + "isRLSEnabled": false 1164 + }, 1165 + "public.team": { 1166 + "name": "team", 1167 + "schema": "", 1168 + "columns": { 1169 + "id": { 1170 + "name": "id", 1171 + "type": "text", 1172 + "primaryKey": true, 1173 + "notNull": true 1174 + }, 1175 + "name": { 1176 + "name": "name", 1177 + "type": "text", 1178 + "primaryKey": false, 1179 + "notNull": true 1180 + }, 1181 + "workspace_id": { 1182 + "name": "workspace_id", 1183 + "type": "text", 1184 + "primaryKey": false, 1185 + "notNull": true 1186 + }, 1187 + "created_at": { 1188 + "name": "created_at", 1189 + "type": "timestamp", 1190 + "primaryKey": false, 1191 + "notNull": true 1192 + }, 1193 + "updated_at": { 1194 + "name": "updated_at", 1195 + "type": "timestamp", 1196 + "primaryKey": false, 1197 + "notNull": false 1198 + } 1199 + }, 1200 + "indexes": { 1201 + "team_workspaceId_idx": { 1202 + "name": "team_workspaceId_idx", 1203 + "columns": [ 1204 + { 1205 + "expression": "workspace_id", 1206 + "isExpression": false, 1207 + "asc": true, 1208 + "nulls": "last" 1209 + } 1210 + ], 1211 + "isUnique": false, 1212 + "concurrently": false, 1213 + "method": "btree", 1214 + "with": {} 1215 + } 1216 + }, 1217 + "foreignKeys": { 1218 + "team_workspace_id_workspace_id_fk": { 1219 + "name": "team_workspace_id_workspace_id_fk", 1220 + "tableFrom": "team", 1221 + "tableTo": "workspace", 1222 + "columnsFrom": [ 1223 + "workspace_id" 1224 + ], 1225 + "columnsTo": [ 1226 + "id" 1227 + ], 1228 + "onDelete": "cascade", 1229 + "onUpdate": "no action" 1230 + } 1231 + }, 1232 + "compositePrimaryKeys": {}, 1233 + "uniqueConstraints": {}, 1234 + "policies": {}, 1235 + "checkConstraints": {}, 1236 + "isRLSEnabled": false 1237 + }, 1238 + "public.time_entry": { 1239 + "name": "time_entry", 1240 + "schema": "", 1241 + "columns": { 1242 + "id": { 1243 + "name": "id", 1244 + "type": "text", 1245 + "primaryKey": true, 1246 + "notNull": true 1247 + }, 1248 + "task_id": { 1249 + "name": "task_id", 1250 + "type": "text", 1251 + "primaryKey": false, 1252 + "notNull": true 1253 + }, 1254 + "user_id": { 1255 + "name": "user_id", 1256 + "type": "text", 1257 + "primaryKey": false, 1258 + "notNull": false 1259 + }, 1260 + "description": { 1261 + "name": "description", 1262 + "type": "text", 1263 + "primaryKey": false, 1264 + "notNull": false 1265 + }, 1266 + "start_time": { 1267 + "name": "start_time", 1268 + "type": "timestamp", 1269 + "primaryKey": false, 1270 + "notNull": true 1271 + }, 1272 + "end_time": { 1273 + "name": "end_time", 1274 + "type": "timestamp", 1275 + "primaryKey": false, 1276 + "notNull": false 1277 + }, 1278 + "duration": { 1279 + "name": "duration", 1280 + "type": "integer", 1281 + "primaryKey": false, 1282 + "notNull": false, 1283 + "default": 0 1284 + }, 1285 + "created_at": { 1286 + "name": "created_at", 1287 + "type": "timestamp", 1288 + "primaryKey": false, 1289 + "notNull": true, 1290 + "default": "now()" 1291 + } 1292 + }, 1293 + "indexes": {}, 1294 + "foreignKeys": { 1295 + "time_entry_task_id_task_id_fk": { 1296 + "name": "time_entry_task_id_task_id_fk", 1297 + "tableFrom": "time_entry", 1298 + "tableTo": "task", 1299 + "columnsFrom": [ 1300 + "task_id" 1301 + ], 1302 + "columnsTo": [ 1303 + "id" 1304 + ], 1305 + "onDelete": "cascade", 1306 + "onUpdate": "cascade" 1307 + }, 1308 + "time_entry_user_id_user_id_fk": { 1309 + "name": "time_entry_user_id_user_id_fk", 1310 + "tableFrom": "time_entry", 1311 + "tableTo": "user", 1312 + "columnsFrom": [ 1313 + "user_id" 1314 + ], 1315 + "columnsTo": [ 1316 + "id" 1317 + ], 1318 + "onDelete": "cascade", 1319 + "onUpdate": "cascade" 1320 + } 1321 + }, 1322 + "compositePrimaryKeys": {}, 1323 + "uniqueConstraints": {}, 1324 + "policies": {}, 1325 + "checkConstraints": {}, 1326 + "isRLSEnabled": false 1327 + }, 1328 + "public.user": { 1329 + "name": "user", 1330 + "schema": "", 1331 + "columns": { 1332 + "id": { 1333 + "name": "id", 1334 + "type": "text", 1335 + "primaryKey": true, 1336 + "notNull": true 1337 + }, 1338 + "name": { 1339 + "name": "name", 1340 + "type": "text", 1341 + "primaryKey": false, 1342 + "notNull": true 1343 + }, 1344 + "email": { 1345 + "name": "email", 1346 + "type": "text", 1347 + "primaryKey": false, 1348 + "notNull": true 1349 + }, 1350 + "email_verified": { 1351 + "name": "email_verified", 1352 + "type": "boolean", 1353 + "primaryKey": false, 1354 + "notNull": true 1355 + }, 1356 + "image": { 1357 + "name": "image", 1358 + "type": "text", 1359 + "primaryKey": false, 1360 + "notNull": false 1361 + }, 1362 + "created_at": { 1363 + "name": "created_at", 1364 + "type": "timestamp", 1365 + "primaryKey": false, 1366 + "notNull": true, 1367 + "default": "now()" 1368 + }, 1369 + "updated_at": { 1370 + "name": "updated_at", 1371 + "type": "timestamp", 1372 + "primaryKey": false, 1373 + "notNull": true, 1374 + "default": "now()" 1375 + }, 1376 + "is_anonymous": { 1377 + "name": "is_anonymous", 1378 + "type": "boolean", 1379 + "primaryKey": false, 1380 + "notNull": false, 1381 + "default": false 1382 + } 1383 + }, 1384 + "indexes": {}, 1385 + "foreignKeys": {}, 1386 + "compositePrimaryKeys": {}, 1387 + "uniqueConstraints": { 1388 + "user_email_unique": { 1389 + "name": "user_email_unique", 1390 + "nullsNotDistinct": false, 1391 + "columns": [ 1392 + "email" 1393 + ] 1394 + } 1395 + }, 1396 + "policies": {}, 1397 + "checkConstraints": {}, 1398 + "isRLSEnabled": false 1399 + }, 1400 + "public.verification": { 1401 + "name": "verification", 1402 + "schema": "", 1403 + "columns": { 1404 + "id": { 1405 + "name": "id", 1406 + "type": "text", 1407 + "primaryKey": true, 1408 + "notNull": true 1409 + }, 1410 + "identifier": { 1411 + "name": "identifier", 1412 + "type": "text", 1413 + "primaryKey": false, 1414 + "notNull": true 1415 + }, 1416 + "value": { 1417 + "name": "value", 1418 + "type": "text", 1419 + "primaryKey": false, 1420 + "notNull": true 1421 + }, 1422 + "expires_at": { 1423 + "name": "expires_at", 1424 + "type": "timestamp", 1425 + "primaryKey": false, 1426 + "notNull": true 1427 + }, 1428 + "created_at": { 1429 + "name": "created_at", 1430 + "type": "timestamp", 1431 + "primaryKey": false, 1432 + "notNull": true, 1433 + "default": "now()" 1434 + }, 1435 + "updated_at": { 1436 + "name": "updated_at", 1437 + "type": "timestamp", 1438 + "primaryKey": false, 1439 + "notNull": true, 1440 + "default": "now()" 1441 + } 1442 + }, 1443 + "indexes": { 1444 + "verification_identifier_idx": { 1445 + "name": "verification_identifier_idx", 1446 + "columns": [ 1447 + { 1448 + "expression": "identifier", 1449 + "isExpression": false, 1450 + "asc": true, 1451 + "nulls": "last" 1452 + } 1453 + ], 1454 + "isUnique": false, 1455 + "concurrently": false, 1456 + "method": "btree", 1457 + "with": {} 1458 + } 1459 + }, 1460 + "foreignKeys": {}, 1461 + "compositePrimaryKeys": {}, 1462 + "uniqueConstraints": {}, 1463 + "policies": {}, 1464 + "checkConstraints": {}, 1465 + "isRLSEnabled": false 1466 + }, 1467 + "public.workspace": { 1468 + "name": "workspace", 1469 + "schema": "", 1470 + "columns": { 1471 + "id": { 1472 + "name": "id", 1473 + "type": "text", 1474 + "primaryKey": true, 1475 + "notNull": true 1476 + }, 1477 + "name": { 1478 + "name": "name", 1479 + "type": "text", 1480 + "primaryKey": false, 1481 + "notNull": true 1482 + }, 1483 + "slug": { 1484 + "name": "slug", 1485 + "type": "text", 1486 + "primaryKey": false, 1487 + "notNull": true 1488 + }, 1489 + "logo": { 1490 + "name": "logo", 1491 + "type": "text", 1492 + "primaryKey": false, 1493 + "notNull": false 1494 + }, 1495 + "metadata": { 1496 + "name": "metadata", 1497 + "type": "text", 1498 + "primaryKey": false, 1499 + "notNull": false 1500 + }, 1501 + "description": { 1502 + "name": "description", 1503 + "type": "text", 1504 + "primaryKey": false, 1505 + "notNull": false 1506 + }, 1507 + "created_at": { 1508 + "name": "created_at", 1509 + "type": "timestamp", 1510 + "primaryKey": false, 1511 + "notNull": true 1512 + } 1513 + }, 1514 + "indexes": {}, 1515 + "foreignKeys": {}, 1516 + "compositePrimaryKeys": {}, 1517 + "uniqueConstraints": { 1518 + "workspace_slug_unique": { 1519 + "name": "workspace_slug_unique", 1520 + "nullsNotDistinct": false, 1521 + "columns": [ 1522 + "slug" 1523 + ] 1524 + } 1525 + }, 1526 + "policies": {}, 1527 + "checkConstraints": {}, 1528 + "isRLSEnabled": false 1529 + }, 1530 + "public.workspace_member": { 1531 + "name": "workspace_member", 1532 + "schema": "", 1533 + "columns": { 1534 + "id": { 1535 + "name": "id", 1536 + "type": "text", 1537 + "primaryKey": true, 1538 + "notNull": true 1539 + }, 1540 + "workspace_id": { 1541 + "name": "workspace_id", 1542 + "type": "text", 1543 + "primaryKey": false, 1544 + "notNull": true 1545 + }, 1546 + "user_id": { 1547 + "name": "user_id", 1548 + "type": "text", 1549 + "primaryKey": false, 1550 + "notNull": true 1551 + }, 1552 + "role": { 1553 + "name": "role", 1554 + "type": "text", 1555 + "primaryKey": false, 1556 + "notNull": true, 1557 + "default": "'member'" 1558 + }, 1559 + "joined_at": { 1560 + "name": "joined_at", 1561 + "type": "timestamp", 1562 + "primaryKey": false, 1563 + "notNull": true 1564 + } 1565 + }, 1566 + "indexes": { 1567 + "workspace_member_workspaceId_idx": { 1568 + "name": "workspace_member_workspaceId_idx", 1569 + "columns": [ 1570 + { 1571 + "expression": "workspace_id", 1572 + "isExpression": false, 1573 + "asc": true, 1574 + "nulls": "last" 1575 + } 1576 + ], 1577 + "isUnique": false, 1578 + "concurrently": false, 1579 + "method": "btree", 1580 + "with": {} 1581 + }, 1582 + "workspace_member_userId_idx": { 1583 + "name": "workspace_member_userId_idx", 1584 + "columns": [ 1585 + { 1586 + "expression": "user_id", 1587 + "isExpression": false, 1588 + "asc": true, 1589 + "nulls": "last" 1590 + } 1591 + ], 1592 + "isUnique": false, 1593 + "concurrently": false, 1594 + "method": "btree", 1595 + "with": {} 1596 + } 1597 + }, 1598 + "foreignKeys": { 1599 + "workspace_member_workspace_id_workspace_id_fk": { 1600 + "name": "workspace_member_workspace_id_workspace_id_fk", 1601 + "tableFrom": "workspace_member", 1602 + "tableTo": "workspace", 1603 + "columnsFrom": [ 1604 + "workspace_id" 1605 + ], 1606 + "columnsTo": [ 1607 + "id" 1608 + ], 1609 + "onDelete": "cascade", 1610 + "onUpdate": "no action" 1611 + }, 1612 + "workspace_member_user_id_user_id_fk": { 1613 + "name": "workspace_member_user_id_user_id_fk", 1614 + "tableFrom": "workspace_member", 1615 + "tableTo": "user", 1616 + "columnsFrom": [ 1617 + "user_id" 1618 + ], 1619 + "columnsTo": [ 1620 + "id" 1621 + ], 1622 + "onDelete": "cascade", 1623 + "onUpdate": "no action" 1624 + } 1625 + }, 1626 + "compositePrimaryKeys": {}, 1627 + "uniqueConstraints": {}, 1628 + "policies": {}, 1629 + "checkConstraints": {}, 1630 + "isRLSEnabled": false 1631 + } 1632 + }, 1633 + "enums": {}, 1634 + "schemas": {}, 1635 + "sequences": {}, 1636 + "roles": {}, 1637 + "policies": {}, 1638 + "views": {}, 1639 + "_meta": { 1640 + "columns": {}, 1641 + "schemas": {}, 1642 + "tables": {} 1643 + } 1644 + }