A social knowledge tool for researchers built on ATProto

update migration file to include new table

+761 -1
+7
src/shared/infrastructure/database/migrations/0002_hesitant_caretaker.sql
··· 1 + CREATE TABLE "feed_activities" ( 2 + "id" uuid PRIMARY KEY NOT NULL, 3 + "actor_id" text NOT NULL, 4 + "type" text NOT NULL, 5 + "metadata" jsonb NOT NULL, 6 + "created_at" timestamp DEFAULT now() NOT NULL 7 + );
+746
src/shared/infrastructure/database/migrations/meta/0002_snapshot.json
··· 1 + { 2 + "id": "91872a6a-78f5-4bf2-a7ec-691199cdf62b", 3 + "prevId": "fd192c99-7519-4ff1-bfd5-470453bbf299", 4 + "version": "7", 5 + "dialect": "postgresql", 6 + "tables": { 7 + "public.app_password_sessions": { 8 + "name": "app_password_sessions", 9 + "schema": "", 10 + "columns": { 11 + "did": { 12 + "name": "did", 13 + "type": "text", 14 + "primaryKey": true, 15 + "notNull": true 16 + }, 17 + "session_data": { 18 + "name": "session_data", 19 + "type": "jsonb", 20 + "primaryKey": false, 21 + "notNull": true 22 + }, 23 + "app_password": { 24 + "name": "app_password", 25 + "type": "text", 26 + "primaryKey": false, 27 + "notNull": true 28 + }, 29 + "created_at": { 30 + "name": "created_at", 31 + "type": "timestamp", 32 + "primaryKey": false, 33 + "notNull": false, 34 + "default": "now()" 35 + }, 36 + "updated_at": { 37 + "name": "updated_at", 38 + "type": "timestamp", 39 + "primaryKey": false, 40 + "notNull": false, 41 + "default": "now()" 42 + } 43 + }, 44 + "indexes": {}, 45 + "foreignKeys": {}, 46 + "compositePrimaryKeys": {}, 47 + "uniqueConstraints": {}, 48 + "policies": {}, 49 + "checkConstraints": {}, 50 + "isRLSEnabled": false 51 + }, 52 + "public.cards": { 53 + "name": "cards", 54 + "schema": "", 55 + "columns": { 56 + "id": { 57 + "name": "id", 58 + "type": "uuid", 59 + "primaryKey": true, 60 + "notNull": true 61 + }, 62 + "type": { 63 + "name": "type", 64 + "type": "text", 65 + "primaryKey": false, 66 + "notNull": true 67 + }, 68 + "content_data": { 69 + "name": "content_data", 70 + "type": "jsonb", 71 + "primaryKey": false, 72 + "notNull": true 73 + }, 74 + "url": { 75 + "name": "url", 76 + "type": "text", 77 + "primaryKey": false, 78 + "notNull": false 79 + }, 80 + "parent_card_id": { 81 + "name": "parent_card_id", 82 + "type": "uuid", 83 + "primaryKey": false, 84 + "notNull": false 85 + }, 86 + "original_published_record_id": { 87 + "name": "original_published_record_id", 88 + "type": "uuid", 89 + "primaryKey": false, 90 + "notNull": false 91 + }, 92 + "library_count": { 93 + "name": "library_count", 94 + "type": "integer", 95 + "primaryKey": false, 96 + "notNull": true, 97 + "default": 0 98 + }, 99 + "created_at": { 100 + "name": "created_at", 101 + "type": "timestamp", 102 + "primaryKey": false, 103 + "notNull": true, 104 + "default": "now()" 105 + }, 106 + "updated_at": { 107 + "name": "updated_at", 108 + "type": "timestamp", 109 + "primaryKey": false, 110 + "notNull": true, 111 + "default": "now()" 112 + } 113 + }, 114 + "indexes": {}, 115 + "foreignKeys": { 116 + "cards_parent_card_id_cards_id_fk": { 117 + "name": "cards_parent_card_id_cards_id_fk", 118 + "tableFrom": "cards", 119 + "tableTo": "cards", 120 + "columnsFrom": [ 121 + "parent_card_id" 122 + ], 123 + "columnsTo": [ 124 + "id" 125 + ], 126 + "onDelete": "no action", 127 + "onUpdate": "no action" 128 + }, 129 + "cards_original_published_record_id_published_records_id_fk": { 130 + "name": "cards_original_published_record_id_published_records_id_fk", 131 + "tableFrom": "cards", 132 + "tableTo": "published_records", 133 + "columnsFrom": [ 134 + "original_published_record_id" 135 + ], 136 + "columnsTo": [ 137 + "id" 138 + ], 139 + "onDelete": "no action", 140 + "onUpdate": "no action" 141 + } 142 + }, 143 + "compositePrimaryKeys": {}, 144 + "uniqueConstraints": {}, 145 + "policies": {}, 146 + "checkConstraints": {}, 147 + "isRLSEnabled": false 148 + }, 149 + "public.collection_cards": { 150 + "name": "collection_cards", 151 + "schema": "", 152 + "columns": { 153 + "id": { 154 + "name": "id", 155 + "type": "uuid", 156 + "primaryKey": true, 157 + "notNull": true 158 + }, 159 + "collection_id": { 160 + "name": "collection_id", 161 + "type": "uuid", 162 + "primaryKey": false, 163 + "notNull": true 164 + }, 165 + "card_id": { 166 + "name": "card_id", 167 + "type": "uuid", 168 + "primaryKey": false, 169 + "notNull": true 170 + }, 171 + "added_by": { 172 + "name": "added_by", 173 + "type": "text", 174 + "primaryKey": false, 175 + "notNull": true 176 + }, 177 + "added_at": { 178 + "name": "added_at", 179 + "type": "timestamp", 180 + "primaryKey": false, 181 + "notNull": true, 182 + "default": "now()" 183 + }, 184 + "published_record_id": { 185 + "name": "published_record_id", 186 + "type": "uuid", 187 + "primaryKey": false, 188 + "notNull": false 189 + } 190 + }, 191 + "indexes": {}, 192 + "foreignKeys": { 193 + "collection_cards_collection_id_collections_id_fk": { 194 + "name": "collection_cards_collection_id_collections_id_fk", 195 + "tableFrom": "collection_cards", 196 + "tableTo": "collections", 197 + "columnsFrom": [ 198 + "collection_id" 199 + ], 200 + "columnsTo": [ 201 + "id" 202 + ], 203 + "onDelete": "cascade", 204 + "onUpdate": "no action" 205 + }, 206 + "collection_cards_card_id_cards_id_fk": { 207 + "name": "collection_cards_card_id_cards_id_fk", 208 + "tableFrom": "collection_cards", 209 + "tableTo": "cards", 210 + "columnsFrom": [ 211 + "card_id" 212 + ], 213 + "columnsTo": [ 214 + "id" 215 + ], 216 + "onDelete": "cascade", 217 + "onUpdate": "no action" 218 + }, 219 + "collection_cards_published_record_id_published_records_id_fk": { 220 + "name": "collection_cards_published_record_id_published_records_id_fk", 221 + "tableFrom": "collection_cards", 222 + "tableTo": "published_records", 223 + "columnsFrom": [ 224 + "published_record_id" 225 + ], 226 + "columnsTo": [ 227 + "id" 228 + ], 229 + "onDelete": "no action", 230 + "onUpdate": "no action" 231 + } 232 + }, 233 + "compositePrimaryKeys": {}, 234 + "uniqueConstraints": {}, 235 + "policies": {}, 236 + "checkConstraints": {}, 237 + "isRLSEnabled": false 238 + }, 239 + "public.collection_collaborators": { 240 + "name": "collection_collaborators", 241 + "schema": "", 242 + "columns": { 243 + "id": { 244 + "name": "id", 245 + "type": "uuid", 246 + "primaryKey": true, 247 + "notNull": true 248 + }, 249 + "collection_id": { 250 + "name": "collection_id", 251 + "type": "uuid", 252 + "primaryKey": false, 253 + "notNull": true 254 + }, 255 + "collaborator_id": { 256 + "name": "collaborator_id", 257 + "type": "text", 258 + "primaryKey": false, 259 + "notNull": true 260 + } 261 + }, 262 + "indexes": {}, 263 + "foreignKeys": { 264 + "collection_collaborators_collection_id_collections_id_fk": { 265 + "name": "collection_collaborators_collection_id_collections_id_fk", 266 + "tableFrom": "collection_collaborators", 267 + "tableTo": "collections", 268 + "columnsFrom": [ 269 + "collection_id" 270 + ], 271 + "columnsTo": [ 272 + "id" 273 + ], 274 + "onDelete": "cascade", 275 + "onUpdate": "no action" 276 + } 277 + }, 278 + "compositePrimaryKeys": {}, 279 + "uniqueConstraints": {}, 280 + "policies": {}, 281 + "checkConstraints": {}, 282 + "isRLSEnabled": false 283 + }, 284 + "public.collections": { 285 + "name": "collections", 286 + "schema": "", 287 + "columns": { 288 + "id": { 289 + "name": "id", 290 + "type": "uuid", 291 + "primaryKey": true, 292 + "notNull": true 293 + }, 294 + "author_id": { 295 + "name": "author_id", 296 + "type": "text", 297 + "primaryKey": false, 298 + "notNull": true 299 + }, 300 + "name": { 301 + "name": "name", 302 + "type": "text", 303 + "primaryKey": false, 304 + "notNull": true 305 + }, 306 + "description": { 307 + "name": "description", 308 + "type": "text", 309 + "primaryKey": false, 310 + "notNull": false 311 + }, 312 + "access_type": { 313 + "name": "access_type", 314 + "type": "text", 315 + "primaryKey": false, 316 + "notNull": true 317 + }, 318 + "card_count": { 319 + "name": "card_count", 320 + "type": "integer", 321 + "primaryKey": false, 322 + "notNull": true, 323 + "default": 0 324 + }, 325 + "created_at": { 326 + "name": "created_at", 327 + "type": "timestamp", 328 + "primaryKey": false, 329 + "notNull": true, 330 + "default": "now()" 331 + }, 332 + "updated_at": { 333 + "name": "updated_at", 334 + "type": "timestamp", 335 + "primaryKey": false, 336 + "notNull": true, 337 + "default": "now()" 338 + }, 339 + "published_record_id": { 340 + "name": "published_record_id", 341 + "type": "uuid", 342 + "primaryKey": false, 343 + "notNull": false 344 + } 345 + }, 346 + "indexes": {}, 347 + "foreignKeys": { 348 + "collections_published_record_id_published_records_id_fk": { 349 + "name": "collections_published_record_id_published_records_id_fk", 350 + "tableFrom": "collections", 351 + "tableTo": "published_records", 352 + "columnsFrom": [ 353 + "published_record_id" 354 + ], 355 + "columnsTo": [ 356 + "id" 357 + ], 358 + "onDelete": "no action", 359 + "onUpdate": "no action" 360 + } 361 + }, 362 + "compositePrimaryKeys": {}, 363 + "uniqueConstraints": {}, 364 + "policies": {}, 365 + "checkConstraints": {}, 366 + "isRLSEnabled": false 367 + }, 368 + "public.library_memberships": { 369 + "name": "library_memberships", 370 + "schema": "", 371 + "columns": { 372 + "card_id": { 373 + "name": "card_id", 374 + "type": "uuid", 375 + "primaryKey": false, 376 + "notNull": true 377 + }, 378 + "user_id": { 379 + "name": "user_id", 380 + "type": "text", 381 + "primaryKey": false, 382 + "notNull": true 383 + }, 384 + "added_at": { 385 + "name": "added_at", 386 + "type": "timestamp", 387 + "primaryKey": false, 388 + "notNull": true, 389 + "default": "now()" 390 + }, 391 + "published_record_id": { 392 + "name": "published_record_id", 393 + "type": "uuid", 394 + "primaryKey": false, 395 + "notNull": false 396 + } 397 + }, 398 + "indexes": { 399 + "idx_user_cards": { 400 + "name": "idx_user_cards", 401 + "columns": [ 402 + { 403 + "expression": "user_id", 404 + "isExpression": false, 405 + "asc": true, 406 + "nulls": "last" 407 + } 408 + ], 409 + "isUnique": false, 410 + "concurrently": false, 411 + "method": "btree", 412 + "with": {} 413 + }, 414 + "idx_card_users": { 415 + "name": "idx_card_users", 416 + "columns": [ 417 + { 418 + "expression": "card_id", 419 + "isExpression": false, 420 + "asc": true, 421 + "nulls": "last" 422 + } 423 + ], 424 + "isUnique": false, 425 + "concurrently": false, 426 + "method": "btree", 427 + "with": {} 428 + } 429 + }, 430 + "foreignKeys": { 431 + "library_memberships_card_id_cards_id_fk": { 432 + "name": "library_memberships_card_id_cards_id_fk", 433 + "tableFrom": "library_memberships", 434 + "tableTo": "cards", 435 + "columnsFrom": [ 436 + "card_id" 437 + ], 438 + "columnsTo": [ 439 + "id" 440 + ], 441 + "onDelete": "cascade", 442 + "onUpdate": "no action" 443 + }, 444 + "library_memberships_published_record_id_published_records_id_fk": { 445 + "name": "library_memberships_published_record_id_published_records_id_fk", 446 + "tableFrom": "library_memberships", 447 + "tableTo": "published_records", 448 + "columnsFrom": [ 449 + "published_record_id" 450 + ], 451 + "columnsTo": [ 452 + "id" 453 + ], 454 + "onDelete": "no action", 455 + "onUpdate": "no action" 456 + } 457 + }, 458 + "compositePrimaryKeys": { 459 + "library_memberships_card_id_user_id_pk": { 460 + "name": "library_memberships_card_id_user_id_pk", 461 + "columns": [ 462 + "card_id", 463 + "user_id" 464 + ] 465 + } 466 + }, 467 + "uniqueConstraints": {}, 468 + "policies": {}, 469 + "checkConstraints": {}, 470 + "isRLSEnabled": false 471 + }, 472 + "public.published_records": { 473 + "name": "published_records", 474 + "schema": "", 475 + "columns": { 476 + "id": { 477 + "name": "id", 478 + "type": "uuid", 479 + "primaryKey": true, 480 + "notNull": true 481 + }, 482 + "uri": { 483 + "name": "uri", 484 + "type": "text", 485 + "primaryKey": false, 486 + "notNull": true 487 + }, 488 + "cid": { 489 + "name": "cid", 490 + "type": "text", 491 + "primaryKey": false, 492 + "notNull": true 493 + }, 494 + "recorded_at": { 495 + "name": "recorded_at", 496 + "type": "timestamp", 497 + "primaryKey": false, 498 + "notNull": true, 499 + "default": "now()" 500 + } 501 + }, 502 + "indexes": { 503 + "uri_cid_unique_idx": { 504 + "name": "uri_cid_unique_idx", 505 + "columns": [ 506 + { 507 + "expression": "uri", 508 + "isExpression": false, 509 + "asc": true, 510 + "nulls": "last" 511 + }, 512 + { 513 + "expression": "cid", 514 + "isExpression": false, 515 + "asc": true, 516 + "nulls": "last" 517 + } 518 + ], 519 + "isUnique": true, 520 + "concurrently": false, 521 + "method": "btree", 522 + "with": {} 523 + } 524 + }, 525 + "foreignKeys": {}, 526 + "compositePrimaryKeys": {}, 527 + "uniqueConstraints": {}, 528 + "policies": {}, 529 + "checkConstraints": {}, 530 + "isRLSEnabled": false 531 + }, 532 + "public.feed_activities": { 533 + "name": "feed_activities", 534 + "schema": "", 535 + "columns": { 536 + "id": { 537 + "name": "id", 538 + "type": "uuid", 539 + "primaryKey": true, 540 + "notNull": true 541 + }, 542 + "actor_id": { 543 + "name": "actor_id", 544 + "type": "text", 545 + "primaryKey": false, 546 + "notNull": true 547 + }, 548 + "type": { 549 + "name": "type", 550 + "type": "text", 551 + "primaryKey": false, 552 + "notNull": true 553 + }, 554 + "metadata": { 555 + "name": "metadata", 556 + "type": "jsonb", 557 + "primaryKey": false, 558 + "notNull": true 559 + }, 560 + "created_at": { 561 + "name": "created_at", 562 + "type": "timestamp", 563 + "primaryKey": false, 564 + "notNull": true, 565 + "default": "now()" 566 + } 567 + }, 568 + "indexes": {}, 569 + "foreignKeys": {}, 570 + "compositePrimaryKeys": {}, 571 + "uniqueConstraints": {}, 572 + "policies": {}, 573 + "checkConstraints": {}, 574 + "isRLSEnabled": false 575 + }, 576 + "public.auth_session": { 577 + "name": "auth_session", 578 + "schema": "", 579 + "columns": { 580 + "key": { 581 + "name": "key", 582 + "type": "text", 583 + "primaryKey": true, 584 + "notNull": true 585 + }, 586 + "session": { 587 + "name": "session", 588 + "type": "text", 589 + "primaryKey": false, 590 + "notNull": true 591 + } 592 + }, 593 + "indexes": {}, 594 + "foreignKeys": {}, 595 + "compositePrimaryKeys": {}, 596 + "uniqueConstraints": {}, 597 + "policies": {}, 598 + "checkConstraints": {}, 599 + "isRLSEnabled": false 600 + }, 601 + "public.auth_state": { 602 + "name": "auth_state", 603 + "schema": "", 604 + "columns": { 605 + "key": { 606 + "name": "key", 607 + "type": "text", 608 + "primaryKey": true, 609 + "notNull": true 610 + }, 611 + "state": { 612 + "name": "state", 613 + "type": "text", 614 + "primaryKey": false, 615 + "notNull": true 616 + }, 617 + "created_at": { 618 + "name": "created_at", 619 + "type": "timestamp", 620 + "primaryKey": false, 621 + "notNull": false, 622 + "default": "now()" 623 + } 624 + }, 625 + "indexes": {}, 626 + "foreignKeys": {}, 627 + "compositePrimaryKeys": {}, 628 + "uniqueConstraints": {}, 629 + "policies": {}, 630 + "checkConstraints": {}, 631 + "isRLSEnabled": false 632 + }, 633 + "public.auth_refresh_tokens": { 634 + "name": "auth_refresh_tokens", 635 + "schema": "", 636 + "columns": { 637 + "token_id": { 638 + "name": "token_id", 639 + "type": "text", 640 + "primaryKey": true, 641 + "notNull": true 642 + }, 643 + "user_did": { 644 + "name": "user_did", 645 + "type": "text", 646 + "primaryKey": false, 647 + "notNull": true 648 + }, 649 + "refresh_token": { 650 + "name": "refresh_token", 651 + "type": "text", 652 + "primaryKey": false, 653 + "notNull": true 654 + }, 655 + "issued_at": { 656 + "name": "issued_at", 657 + "type": "timestamp", 658 + "primaryKey": false, 659 + "notNull": true 660 + }, 661 + "expires_at": { 662 + "name": "expires_at", 663 + "type": "timestamp", 664 + "primaryKey": false, 665 + "notNull": true 666 + }, 667 + "revoked": { 668 + "name": "revoked", 669 + "type": "boolean", 670 + "primaryKey": false, 671 + "notNull": false, 672 + "default": false 673 + } 674 + }, 675 + "indexes": {}, 676 + "foreignKeys": { 677 + "auth_refresh_tokens_user_did_users_id_fk": { 678 + "name": "auth_refresh_tokens_user_did_users_id_fk", 679 + "tableFrom": "auth_refresh_tokens", 680 + "tableTo": "users", 681 + "columnsFrom": [ 682 + "user_did" 683 + ], 684 + "columnsTo": [ 685 + "id" 686 + ], 687 + "onDelete": "no action", 688 + "onUpdate": "no action" 689 + } 690 + }, 691 + "compositePrimaryKeys": {}, 692 + "uniqueConstraints": {}, 693 + "policies": {}, 694 + "checkConstraints": {}, 695 + "isRLSEnabled": false 696 + }, 697 + "public.users": { 698 + "name": "users", 699 + "schema": "", 700 + "columns": { 701 + "id": { 702 + "name": "id", 703 + "type": "text", 704 + "primaryKey": true, 705 + "notNull": true 706 + }, 707 + "handle": { 708 + "name": "handle", 709 + "type": "text", 710 + "primaryKey": false, 711 + "notNull": false 712 + }, 713 + "linked_at": { 714 + "name": "linked_at", 715 + "type": "timestamp", 716 + "primaryKey": false, 717 + "notNull": true 718 + }, 719 + "last_login_at": { 720 + "name": "last_login_at", 721 + "type": "timestamp", 722 + "primaryKey": false, 723 + "notNull": true 724 + } 725 + }, 726 + "indexes": {}, 727 + "foreignKeys": {}, 728 + "compositePrimaryKeys": {}, 729 + "uniqueConstraints": {}, 730 + "policies": {}, 731 + "checkConstraints": {}, 732 + "isRLSEnabled": false 733 + } 734 + }, 735 + "enums": {}, 736 + "schemas": {}, 737 + "sequences": {}, 738 + "roles": {}, 739 + "policies": {}, 740 + "views": {}, 741 + "_meta": { 742 + "columns": {}, 743 + "schemas": {}, 744 + "tables": {} 745 + } 746 + }
+8 -1
src/shared/infrastructure/database/migrations/meta/_journal.json
··· 15 15 "when": 1751653094026, 16 16 "tag": "0001_lying_hairball", 17 17 "breakpoints": true 18 + }, 19 + { 20 + "idx": 2, 21 + "version": "7", 22 + "when": 1754082459527, 23 + "tag": "0002_hesitant_caretaker", 24 + "breakpoints": true 18 25 } 19 26 ] 20 - } 27 + }