AT-based link agregator. Mirror of https://github.com/likeandscribe/frontpage

Track auth session scopes (#272)

* Track auth session scopes

* Remove scope

authored by tom.sherman.is and committed by

GitHub 431ad52c 1bfc45a1

+1171 -3
+3 -2
packages/frontpage-oauth/src/index.ts
··· 6 6 appUrl: string; 7 7 }; 8 8 9 + export const AUTH_SCOPES = "atproto transition:generic"; 10 + 9 11 export function getClientMetadata({ 10 12 redirectUri, 11 13 appUrl, ··· 20 22 subject_type: "public", 21 23 grant_types: ["authorization_code", "refresh_token"], 22 24 response_types: ["code"], // TODO: "code id_token"? 23 - // TODO: Tweak these? 24 - scope: "atproto transition:generic", 25 + scope: AUTH_SCOPES, 25 26 client_name: "Frontpage", 26 27 token_endpoint_auth_method: "private_key_jwt", 27 28 token_endpoint_auth_signing_alg: "ES256",
+1
packages/frontpage/drizzle/0007_silent_franklin_storm.sql
··· 1 + ALTER TABLE `oauth_sessions` ADD `scope` text DEFAULT 'atproto transition:generic' NOT NULL;
+1159
packages/frontpage/drizzle/meta/0007_snapshot.json
··· 1 + { 2 + "version": "6", 3 + "dialect": "sqlite", 4 + "id": "313ce997-54c0-48dd-b9cd-dd4038931f34", 5 + "prevId": "e428846a-761a-4c51-86c2-b064a994370e", 6 + "tables": { 7 + "admin_users": { 8 + "name": "admin_users", 9 + "columns": { 10 + "id": { 11 + "name": "id", 12 + "type": "integer", 13 + "primaryKey": true, 14 + "notNull": true, 15 + "autoincrement": false 16 + }, 17 + "created_at": { 18 + "name": "created_at", 19 + "type": "text", 20 + "primaryKey": false, 21 + "notNull": true, 22 + "autoincrement": false, 23 + "default": "(current_timestamp)" 24 + }, 25 + "did": { 26 + "name": "did", 27 + "type": "text", 28 + "primaryKey": false, 29 + "notNull": true, 30 + "autoincrement": false 31 + } 32 + }, 33 + "indexes": { 34 + "admin_users_did_unique": { 35 + "name": "admin_users_did_unique", 36 + "columns": [ 37 + "did" 38 + ], 39 + "isUnique": true 40 + } 41 + }, 42 + "foreignKeys": {}, 43 + "compositePrimaryKeys": {}, 44 + "uniqueConstraints": {}, 45 + "checkConstraints": {} 46 + }, 47 + "beta_users": { 48 + "name": "beta_users", 49 + "columns": { 50 + "id": { 51 + "name": "id", 52 + "type": "integer", 53 + "primaryKey": true, 54 + "notNull": true, 55 + "autoincrement": false 56 + }, 57 + "created_at": { 58 + "name": "created_at", 59 + "type": "text", 60 + "primaryKey": false, 61 + "notNull": true, 62 + "autoincrement": false 63 + }, 64 + "did": { 65 + "name": "did", 66 + "type": "text", 67 + "primaryKey": false, 68 + "notNull": true, 69 + "autoincrement": false 70 + } 71 + }, 72 + "indexes": { 73 + "beta_users_did_unique": { 74 + "name": "beta_users_did_unique", 75 + "columns": [ 76 + "did" 77 + ], 78 + "isUnique": true 79 + } 80 + }, 81 + "foreignKeys": {}, 82 + "compositePrimaryKeys": {}, 83 + "uniqueConstraints": {}, 84 + "checkConstraints": {} 85 + }, 86 + "comments": { 87 + "name": "comments", 88 + "columns": { 89 + "id": { 90 + "name": "id", 91 + "type": "integer", 92 + "primaryKey": true, 93 + "notNull": true, 94 + "autoincrement": false 95 + }, 96 + "rkey": { 97 + "name": "rkey", 98 + "type": "text", 99 + "primaryKey": false, 100 + "notNull": true, 101 + "autoincrement": false 102 + }, 103 + "cid": { 104 + "name": "cid", 105 + "type": "text", 106 + "primaryKey": false, 107 + "notNull": true, 108 + "autoincrement": false, 109 + "default": "''" 110 + }, 111 + "post_id": { 112 + "name": "post_id", 113 + "type": "integer", 114 + "primaryKey": false, 115 + "notNull": true, 116 + "autoincrement": false 117 + }, 118 + "body": { 119 + "name": "body", 120 + "type": "text(10000)", 121 + "primaryKey": false, 122 + "notNull": true, 123 + "autoincrement": false 124 + }, 125 + "created_at": { 126 + "name": "created_at", 127 + "type": "text", 128 + "primaryKey": false, 129 + "notNull": true, 130 + "autoincrement": false 131 + }, 132 + "author_did": { 133 + "name": "author_did", 134 + "type": "text", 135 + "primaryKey": false, 136 + "notNull": true, 137 + "autoincrement": false 138 + }, 139 + "status": { 140 + "name": "status", 141 + "type": "text", 142 + "primaryKey": false, 143 + "notNull": false, 144 + "autoincrement": false, 145 + "default": "'live'" 146 + }, 147 + "parent_comment_id": { 148 + "name": "parent_comment_id", 149 + "type": "integer", 150 + "primaryKey": false, 151 + "notNull": false, 152 + "autoincrement": false 153 + } 154 + }, 155 + "indexes": { 156 + "comments_author_did_rkey_unique": { 157 + "name": "comments_author_did_rkey_unique", 158 + "columns": [ 159 + "author_did", 160 + "rkey" 161 + ], 162 + "isUnique": true 163 + } 164 + }, 165 + "foreignKeys": { 166 + "comments_post_id_posts_id_fk": { 167 + "name": "comments_post_id_posts_id_fk", 168 + "tableFrom": "comments", 169 + "tableTo": "posts", 170 + "columnsFrom": [ 171 + "post_id" 172 + ], 173 + "columnsTo": [ 174 + "id" 175 + ], 176 + "onDelete": "no action", 177 + "onUpdate": "no action" 178 + }, 179 + "parent_comment_id_fkey": { 180 + "name": "parent_comment_id_fkey", 181 + "tableFrom": "comments", 182 + "tableTo": "comments", 183 + "columnsFrom": [ 184 + "parent_comment_id" 185 + ], 186 + "columnsTo": [ 187 + "id" 188 + ], 189 + "onDelete": "no action", 190 + "onUpdate": "no action" 191 + } 192 + }, 193 + "compositePrimaryKeys": {}, 194 + "uniqueConstraints": {}, 195 + "checkConstraints": {} 196 + }, 197 + "comment_aggregates": { 198 + "name": "comment_aggregates", 199 + "columns": { 200 + "id": { 201 + "name": "id", 202 + "type": "integer", 203 + "primaryKey": true, 204 + "notNull": true, 205 + "autoincrement": false 206 + }, 207 + "comment_id": { 208 + "name": "comment_id", 209 + "type": "integer", 210 + "primaryKey": false, 211 + "notNull": true, 212 + "autoincrement": false 213 + }, 214 + "vote_count": { 215 + "name": "vote_count", 216 + "type": "integer", 217 + "primaryKey": false, 218 + "notNull": true, 219 + "autoincrement": false, 220 + "default": 0 221 + }, 222 + "rank": { 223 + "name": "rank", 224 + "type": "integer", 225 + "primaryKey": false, 226 + "notNull": true, 227 + "autoincrement": false, 228 + "default": "(CAST(1 AS REAL) / (pow(2,1.8)))" 229 + }, 230 + "created_at": { 231 + "name": "created_at", 232 + "type": "text", 233 + "primaryKey": false, 234 + "notNull": true, 235 + "autoincrement": false, 236 + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" 237 + } 238 + }, 239 + "indexes": { 240 + "comment_aggregates_comment_id_unique": { 241 + "name": "comment_aggregates_comment_id_unique", 242 + "columns": [ 243 + "comment_id" 244 + ], 245 + "isUnique": true 246 + }, 247 + "comment_id_idx": { 248 + "name": "comment_id_idx", 249 + "columns": [ 250 + "comment_id" 251 + ], 252 + "isUnique": false 253 + } 254 + }, 255 + "foreignKeys": { 256 + "comment_aggregates_comment_id_comments_id_fk": { 257 + "name": "comment_aggregates_comment_id_comments_id_fk", 258 + "tableFrom": "comment_aggregates", 259 + "tableTo": "comments", 260 + "columnsFrom": [ 261 + "comment_id" 262 + ], 263 + "columnsTo": [ 264 + "id" 265 + ], 266 + "onDelete": "no action", 267 + "onUpdate": "no action" 268 + } 269 + }, 270 + "compositePrimaryKeys": {}, 271 + "uniqueConstraints": {}, 272 + "checkConstraints": {} 273 + }, 274 + "comment_votes": { 275 + "name": "comment_votes", 276 + "columns": { 277 + "id": { 278 + "name": "id", 279 + "type": "integer", 280 + "primaryKey": true, 281 + "notNull": true, 282 + "autoincrement": false 283 + }, 284 + "comment_id": { 285 + "name": "comment_id", 286 + "type": "integer", 287 + "primaryKey": false, 288 + "notNull": true, 289 + "autoincrement": false 290 + }, 291 + "created_at": { 292 + "name": "created_at", 293 + "type": "text", 294 + "primaryKey": false, 295 + "notNull": true, 296 + "autoincrement": false 297 + }, 298 + "author_did": { 299 + "name": "author_did", 300 + "type": "text", 301 + "primaryKey": false, 302 + "notNull": true, 303 + "autoincrement": false 304 + }, 305 + "cid": { 306 + "name": "cid", 307 + "type": "text", 308 + "primaryKey": false, 309 + "notNull": true, 310 + "autoincrement": false, 311 + "default": "''" 312 + }, 313 + "rkey": { 314 + "name": "rkey", 315 + "type": "text", 316 + "primaryKey": false, 317 + "notNull": true, 318 + "autoincrement": false 319 + }, 320 + "status": { 321 + "name": "status", 322 + "type": "text", 323 + "primaryKey": false, 324 + "notNull": false, 325 + "autoincrement": false, 326 + "default": "'live'" 327 + } 328 + }, 329 + "indexes": { 330 + "comment_votes_author_did_rkey_unique": { 331 + "name": "comment_votes_author_did_rkey_unique", 332 + "columns": [ 333 + "author_did", 334 + "rkey" 335 + ], 336 + "isUnique": true 337 + }, 338 + "comment_votes_author_did_comment_id_unique": { 339 + "name": "comment_votes_author_did_comment_id_unique", 340 + "columns": [ 341 + "author_did", 342 + "comment_id" 343 + ], 344 + "isUnique": true 345 + } 346 + }, 347 + "foreignKeys": { 348 + "comment_votes_comment_id_comments_id_fk": { 349 + "name": "comment_votes_comment_id_comments_id_fk", 350 + "tableFrom": "comment_votes", 351 + "tableTo": "comments", 352 + "columnsFrom": [ 353 + "comment_id" 354 + ], 355 + "columnsTo": [ 356 + "id" 357 + ], 358 + "onDelete": "no action", 359 + "onUpdate": "no action" 360 + } 361 + }, 362 + "compositePrimaryKeys": {}, 363 + "uniqueConstraints": {}, 364 + "checkConstraints": {} 365 + }, 366 + "consumed_offsets": { 367 + "name": "consumed_offsets", 368 + "columns": { 369 + "offset": { 370 + "name": "offset", 371 + "type": "integer", 372 + "primaryKey": true, 373 + "notNull": true, 374 + "autoincrement": false 375 + } 376 + }, 377 + "indexes": {}, 378 + "foreignKeys": {}, 379 + "compositePrimaryKeys": {}, 380 + "uniqueConstraints": {}, 381 + "checkConstraints": {} 382 + }, 383 + "labelled_profiles": { 384 + "name": "labelled_profiles", 385 + "columns": { 386 + "id": { 387 + "name": "id", 388 + "type": "integer", 389 + "primaryKey": true, 390 + "notNull": true, 391 + "autoincrement": false 392 + }, 393 + "did": { 394 + "name": "did", 395 + "type": "text", 396 + "primaryKey": false, 397 + "notNull": true, 398 + "autoincrement": false 399 + }, 400 + "is_hidden": { 401 + "name": "is_hidden", 402 + "type": "integer", 403 + "primaryKey": false, 404 + "notNull": true, 405 + "autoincrement": false, 406 + "default": false 407 + }, 408 + "labels": { 409 + "name": "labels", 410 + "type": "text", 411 + "primaryKey": false, 412 + "notNull": false, 413 + "autoincrement": false 414 + }, 415 + "created_at": { 416 + "name": "created_at", 417 + "type": "text", 418 + "primaryKey": false, 419 + "notNull": true, 420 + "autoincrement": false, 421 + "default": "(current_timestamp)" 422 + }, 423 + "updated_at": { 424 + "name": "updated_at", 425 + "type": "text", 426 + "primaryKey": false, 427 + "notNull": true, 428 + "autoincrement": false, 429 + "default": "(current_timestamp)" 430 + } 431 + }, 432 + "indexes": { 433 + "labelled_profiles_did_unique": { 434 + "name": "labelled_profiles_did_unique", 435 + "columns": [ 436 + "did" 437 + ], 438 + "isUnique": true 439 + } 440 + }, 441 + "foreignKeys": {}, 442 + "compositePrimaryKeys": {}, 443 + "uniqueConstraints": {}, 444 + "checkConstraints": {} 445 + }, 446 + "moderation_events": { 447 + "name": "moderation_events", 448 + "columns": { 449 + "id": { 450 + "name": "id", 451 + "type": "integer", 452 + "primaryKey": true, 453 + "notNull": true, 454 + "autoincrement": false 455 + }, 456 + "subject_uri": { 457 + "name": "subject_uri", 458 + "type": "text", 459 + "primaryKey": false, 460 + "notNull": true, 461 + "autoincrement": false 462 + }, 463 + "subject_did": { 464 + "name": "subject_did", 465 + "type": "text", 466 + "primaryKey": false, 467 + "notNull": true, 468 + "autoincrement": false 469 + }, 470 + "subject_collection": { 471 + "name": "subject_collection", 472 + "type": "text", 473 + "primaryKey": false, 474 + "notNull": false, 475 + "autoincrement": false 476 + }, 477 + "subject_rkey": { 478 + "name": "subject_rkey", 479 + "type": "text", 480 + "primaryKey": false, 481 + "notNull": false, 482 + "autoincrement": false 483 + }, 484 + "subject_cid": { 485 + "name": "subject_cid", 486 + "type": "text", 487 + "primaryKey": false, 488 + "notNull": false, 489 + "autoincrement": false 490 + }, 491 + "created_by": { 492 + "name": "created_by", 493 + "type": "text", 494 + "primaryKey": false, 495 + "notNull": true, 496 + "autoincrement": false 497 + }, 498 + "created_at": { 499 + "name": "created_at", 500 + "type": "text", 501 + "primaryKey": false, 502 + "notNull": true, 503 + "autoincrement": false, 504 + "default": "(current_timestamp)" 505 + }, 506 + "labels_added": { 507 + "name": "labels_added", 508 + "type": "text", 509 + "primaryKey": false, 510 + "notNull": false, 511 + "autoincrement": false 512 + }, 513 + "labels_removed": { 514 + "name": "labels_removed", 515 + "type": "text", 516 + "primaryKey": false, 517 + "notNull": false, 518 + "autoincrement": false 519 + }, 520 + "report_type": { 521 + "name": "report_type", 522 + "type": "text", 523 + "primaryKey": false, 524 + "notNull": false, 525 + "autoincrement": false 526 + } 527 + }, 528 + "indexes": {}, 529 + "foreignKeys": {}, 530 + "compositePrimaryKeys": {}, 531 + "uniqueConstraints": {}, 532 + "checkConstraints": {} 533 + }, 534 + "notifications": { 535 + "name": "notifications", 536 + "columns": { 537 + "id": { 538 + "name": "id", 539 + "type": "integer", 540 + "primaryKey": true, 541 + "notNull": true, 542 + "autoincrement": false 543 + }, 544 + "did": { 545 + "name": "did", 546 + "type": "text", 547 + "primaryKey": false, 548 + "notNull": true, 549 + "autoincrement": false 550 + }, 551 + "created_at": { 552 + "name": "created_at", 553 + "type": "text", 554 + "primaryKey": false, 555 + "notNull": true, 556 + "autoincrement": false, 557 + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" 558 + }, 559 + "read_at": { 560 + "name": "read_at", 561 + "type": "text", 562 + "primaryKey": false, 563 + "notNull": false, 564 + "autoincrement": false 565 + }, 566 + "reason": { 567 + "name": "reason", 568 + "type": "text", 569 + "primaryKey": false, 570 + "notNull": true, 571 + "autoincrement": false 572 + }, 573 + "comment_id": { 574 + "name": "comment_id", 575 + "type": "integer", 576 + "primaryKey": false, 577 + "notNull": false, 578 + "autoincrement": false 579 + } 580 + }, 581 + "indexes": {}, 582 + "foreignKeys": { 583 + "notifications_comment_id_comments_id_fk": { 584 + "name": "notifications_comment_id_comments_id_fk", 585 + "tableFrom": "notifications", 586 + "tableTo": "comments", 587 + "columnsFrom": [ 588 + "comment_id" 589 + ], 590 + "columnsTo": [ 591 + "id" 592 + ], 593 + "onDelete": "no action", 594 + "onUpdate": "no action" 595 + } 596 + }, 597 + "compositePrimaryKeys": {}, 598 + "uniqueConstraints": {}, 599 + "checkConstraints": {} 600 + }, 601 + "oauth_auth_requests": { 602 + "name": "oauth_auth_requests", 603 + "columns": { 604 + "state": { 605 + "name": "state", 606 + "type": "text", 607 + "primaryKey": false, 608 + "notNull": true, 609 + "autoincrement": false 610 + }, 611 + "iss": { 612 + "name": "iss", 613 + "type": "text", 614 + "primaryKey": false, 615 + "notNull": true, 616 + "autoincrement": false 617 + }, 618 + "did": { 619 + "name": "did", 620 + "type": "text", 621 + "primaryKey": false, 622 + "notNull": true, 623 + "autoincrement": false 624 + }, 625 + "username": { 626 + "name": "username", 627 + "type": "text", 628 + "primaryKey": false, 629 + "notNull": true, 630 + "autoincrement": false 631 + }, 632 + "nonce": { 633 + "name": "nonce", 634 + "type": "text", 635 + "primaryKey": false, 636 + "notNull": true, 637 + "autoincrement": false 638 + }, 639 + "pkce_verifier": { 640 + "name": "pkce_verifier", 641 + "type": "text", 642 + "primaryKey": false, 643 + "notNull": true, 644 + "autoincrement": false 645 + }, 646 + "dpop_private_jwk": { 647 + "name": "dpop_private_jwk", 648 + "type": "text", 649 + "primaryKey": false, 650 + "notNull": true, 651 + "autoincrement": false 652 + }, 653 + "dpop_public_jwk": { 654 + "name": "dpop_public_jwk", 655 + "type": "text", 656 + "primaryKey": false, 657 + "notNull": true, 658 + "autoincrement": false 659 + }, 660 + "expires_at": { 661 + "name": "expires_at", 662 + "type": "text", 663 + "primaryKey": false, 664 + "notNull": true, 665 + "autoincrement": false 666 + }, 667 + "created_at": { 668 + "name": "created_at", 669 + "type": "text", 670 + "primaryKey": false, 671 + "notNull": true, 672 + "autoincrement": false 673 + } 674 + }, 675 + "indexes": { 676 + "oauth_auth_requests_state_unique": { 677 + "name": "oauth_auth_requests_state_unique", 678 + "columns": [ 679 + "state" 680 + ], 681 + "isUnique": true 682 + } 683 + }, 684 + "foreignKeys": {}, 685 + "compositePrimaryKeys": {}, 686 + "uniqueConstraints": {}, 687 + "checkConstraints": {} 688 + }, 689 + "oauth_sessions": { 690 + "name": "oauth_sessions", 691 + "columns": { 692 + "id": { 693 + "name": "id", 694 + "type": "integer", 695 + "primaryKey": true, 696 + "notNull": true, 697 + "autoincrement": false 698 + }, 699 + "did": { 700 + "name": "did", 701 + "type": "text", 702 + "primaryKey": false, 703 + "notNull": true, 704 + "autoincrement": false 705 + }, 706 + "username": { 707 + "name": "username", 708 + "type": "text", 709 + "primaryKey": false, 710 + "notNull": true, 711 + "autoincrement": false 712 + }, 713 + "iss": { 714 + "name": "iss", 715 + "type": "text", 716 + "primaryKey": false, 717 + "notNull": true, 718 + "autoincrement": false 719 + }, 720 + "access_token": { 721 + "name": "access_token", 722 + "type": "text", 723 + "primaryKey": false, 724 + "notNull": true, 725 + "autoincrement": false 726 + }, 727 + "refresh_token": { 728 + "name": "refresh_token", 729 + "type": "text", 730 + "primaryKey": false, 731 + "notNull": true, 732 + "autoincrement": false 733 + }, 734 + "dpop_nonce": { 735 + "name": "dpop_nonce", 736 + "type": "text", 737 + "primaryKey": false, 738 + "notNull": true, 739 + "autoincrement": false 740 + }, 741 + "dpop_private_jwk": { 742 + "name": "dpop_private_jwk", 743 + "type": "text", 744 + "primaryKey": false, 745 + "notNull": true, 746 + "autoincrement": false 747 + }, 748 + "dpop_public_jwk": { 749 + "name": "dpop_public_jwk", 750 + "type": "text", 751 + "primaryKey": false, 752 + "notNull": true, 753 + "autoincrement": false 754 + }, 755 + "expires_at": { 756 + "name": "expires_at", 757 + "type": "text", 758 + "primaryKey": false, 759 + "notNull": true, 760 + "autoincrement": false 761 + }, 762 + "created_at": { 763 + "name": "created_at", 764 + "type": "text", 765 + "primaryKey": false, 766 + "notNull": true, 767 + "autoincrement": false 768 + }, 769 + "scope": { 770 + "name": "scope", 771 + "type": "text", 772 + "primaryKey": false, 773 + "notNull": true, 774 + "autoincrement": false, 775 + "default": "'atproto transition:generic'" 776 + } 777 + }, 778 + "indexes": {}, 779 + "foreignKeys": {}, 780 + "compositePrimaryKeys": {}, 781 + "uniqueConstraints": {}, 782 + "checkConstraints": {} 783 + }, 784 + "posts": { 785 + "name": "posts", 786 + "columns": { 787 + "id": { 788 + "name": "id", 789 + "type": "integer", 790 + "primaryKey": true, 791 + "notNull": true, 792 + "autoincrement": false 793 + }, 794 + "rkey": { 795 + "name": "rkey", 796 + "type": "text", 797 + "primaryKey": false, 798 + "notNull": true, 799 + "autoincrement": false 800 + }, 801 + "cid": { 802 + "name": "cid", 803 + "type": "text", 804 + "primaryKey": false, 805 + "notNull": true, 806 + "autoincrement": false, 807 + "default": "''" 808 + }, 809 + "title": { 810 + "name": "title", 811 + "type": "text(300)", 812 + "primaryKey": false, 813 + "notNull": true, 814 + "autoincrement": false 815 + }, 816 + "url": { 817 + "name": "url", 818 + "type": "text(255)", 819 + "primaryKey": false, 820 + "notNull": true, 821 + "autoincrement": false 822 + }, 823 + "created_at": { 824 + "name": "created_at", 825 + "type": "text", 826 + "primaryKey": false, 827 + "notNull": true, 828 + "autoincrement": false 829 + }, 830 + "author_did": { 831 + "name": "author_did", 832 + "type": "text", 833 + "primaryKey": false, 834 + "notNull": true, 835 + "autoincrement": false 836 + }, 837 + "status": { 838 + "name": "status", 839 + "type": "text", 840 + "primaryKey": false, 841 + "notNull": false, 842 + "autoincrement": false, 843 + "default": "'live'" 844 + } 845 + }, 846 + "indexes": { 847 + "posts_author_did_rkey_unique": { 848 + "name": "posts_author_did_rkey_unique", 849 + "columns": [ 850 + "author_did", 851 + "rkey" 852 + ], 853 + "isUnique": true 854 + } 855 + }, 856 + "foreignKeys": {}, 857 + "compositePrimaryKeys": {}, 858 + "uniqueConstraints": {}, 859 + "checkConstraints": {} 860 + }, 861 + "post_aggregates": { 862 + "name": "post_aggregates", 863 + "columns": { 864 + "id": { 865 + "name": "id", 866 + "type": "integer", 867 + "primaryKey": true, 868 + "notNull": true, 869 + "autoincrement": false 870 + }, 871 + "post_id": { 872 + "name": "post_id", 873 + "type": "integer", 874 + "primaryKey": false, 875 + "notNull": true, 876 + "autoincrement": false 877 + }, 878 + "comment_count": { 879 + "name": "comment_count", 880 + "type": "integer", 881 + "primaryKey": false, 882 + "notNull": true, 883 + "autoincrement": false, 884 + "default": 0 885 + }, 886 + "vote_count": { 887 + "name": "vote_count", 888 + "type": "integer", 889 + "primaryKey": false, 890 + "notNull": true, 891 + "autoincrement": false, 892 + "default": 0 893 + }, 894 + "rank": { 895 + "name": "rank", 896 + "type": "integer", 897 + "primaryKey": false, 898 + "notNull": true, 899 + "autoincrement": false, 900 + "default": "(CAST(1 AS REAL) / (pow(2,1.8)))" 901 + }, 902 + "created_at": { 903 + "name": "created_at", 904 + "type": "text", 905 + "primaryKey": false, 906 + "notNull": true, 907 + "autoincrement": false, 908 + "default": "(strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))" 909 + } 910 + }, 911 + "indexes": { 912 + "post_id_idx": { 913 + "name": "post_id_idx", 914 + "columns": [ 915 + "post_id" 916 + ], 917 + "isUnique": false 918 + }, 919 + "rank_idx": { 920 + "name": "rank_idx", 921 + "columns": [ 922 + "rank" 923 + ], 924 + "isUnique": false 925 + }, 926 + "post_aggregates_post_id_unique": { 927 + "name": "post_aggregates_post_id_unique", 928 + "columns": [ 929 + "post_id" 930 + ], 931 + "isUnique": true 932 + } 933 + }, 934 + "foreignKeys": { 935 + "post_aggregates_post_id_posts_id_fk": { 936 + "name": "post_aggregates_post_id_posts_id_fk", 937 + "tableFrom": "post_aggregates", 938 + "tableTo": "posts", 939 + "columnsFrom": [ 940 + "post_id" 941 + ], 942 + "columnsTo": [ 943 + "id" 944 + ], 945 + "onDelete": "no action", 946 + "onUpdate": "no action" 947 + } 948 + }, 949 + "compositePrimaryKeys": {}, 950 + "uniqueConstraints": {}, 951 + "checkConstraints": {} 952 + }, 953 + "post_votes": { 954 + "name": "post_votes", 955 + "columns": { 956 + "id": { 957 + "name": "id", 958 + "type": "integer", 959 + "primaryKey": true, 960 + "notNull": true, 961 + "autoincrement": false 962 + }, 963 + "post_id": { 964 + "name": "post_id", 965 + "type": "integer", 966 + "primaryKey": false, 967 + "notNull": true, 968 + "autoincrement": false 969 + }, 970 + "created_at": { 971 + "name": "created_at", 972 + "type": "text", 973 + "primaryKey": false, 974 + "notNull": true, 975 + "autoincrement": false 976 + }, 977 + "author_did": { 978 + "name": "author_did", 979 + "type": "text", 980 + "primaryKey": false, 981 + "notNull": true, 982 + "autoincrement": false 983 + }, 984 + "cid": { 985 + "name": "cid", 986 + "type": "text", 987 + "primaryKey": false, 988 + "notNull": true, 989 + "autoincrement": false, 990 + "default": "''" 991 + }, 992 + "rkey": { 993 + "name": "rkey", 994 + "type": "text", 995 + "primaryKey": false, 996 + "notNull": true, 997 + "autoincrement": false 998 + }, 999 + "status": { 1000 + "name": "status", 1001 + "type": "text", 1002 + "primaryKey": false, 1003 + "notNull": false, 1004 + "autoincrement": false, 1005 + "default": "'live'" 1006 + } 1007 + }, 1008 + "indexes": { 1009 + "post_votes_author_did_rkey_unique": { 1010 + "name": "post_votes_author_did_rkey_unique", 1011 + "columns": [ 1012 + "author_did", 1013 + "rkey" 1014 + ], 1015 + "isUnique": true 1016 + }, 1017 + "post_votes_author_did_post_id_unique": { 1018 + "name": "post_votes_author_did_post_id_unique", 1019 + "columns": [ 1020 + "author_did", 1021 + "post_id" 1022 + ], 1023 + "isUnique": true 1024 + } 1025 + }, 1026 + "foreignKeys": { 1027 + "post_votes_post_id_posts_id_fk": { 1028 + "name": "post_votes_post_id_posts_id_fk", 1029 + "tableFrom": "post_votes", 1030 + "tableTo": "posts", 1031 + "columnsFrom": [ 1032 + "post_id" 1033 + ], 1034 + "columnsTo": [ 1035 + "id" 1036 + ], 1037 + "onDelete": "no action", 1038 + "onUpdate": "no action" 1039 + } 1040 + }, 1041 + "compositePrimaryKeys": {}, 1042 + "uniqueConstraints": {}, 1043 + "checkConstraints": {} 1044 + }, 1045 + "reports": { 1046 + "name": "reports", 1047 + "columns": { 1048 + "id": { 1049 + "name": "id", 1050 + "type": "integer", 1051 + "primaryKey": true, 1052 + "notNull": true, 1053 + "autoincrement": false 1054 + }, 1055 + "actioned_at": { 1056 + "name": "actioned_at", 1057 + "type": "text", 1058 + "primaryKey": false, 1059 + "notNull": false, 1060 + "autoincrement": false 1061 + }, 1062 + "actioned_by": { 1063 + "name": "actioned_by", 1064 + "type": "text", 1065 + "primaryKey": false, 1066 + "notNull": false, 1067 + "autoincrement": false 1068 + }, 1069 + "subject_uri": { 1070 + "name": "subject_uri", 1071 + "type": "text", 1072 + "primaryKey": false, 1073 + "notNull": true, 1074 + "autoincrement": false 1075 + }, 1076 + "subject_did": { 1077 + "name": "subject_did", 1078 + "type": "text", 1079 + "primaryKey": false, 1080 + "notNull": true, 1081 + "autoincrement": false 1082 + }, 1083 + "subject_collection": { 1084 + "name": "subject_collection", 1085 + "type": "text", 1086 + "primaryKey": false, 1087 + "notNull": false, 1088 + "autoincrement": false 1089 + }, 1090 + "subject_rkey": { 1091 + "name": "subject_rkey", 1092 + "type": "text", 1093 + "primaryKey": false, 1094 + "notNull": false, 1095 + "autoincrement": false 1096 + }, 1097 + "subject_cid": { 1098 + "name": "subject_cid", 1099 + "type": "text", 1100 + "primaryKey": false, 1101 + "notNull": false, 1102 + "autoincrement": false 1103 + }, 1104 + "created_by": { 1105 + "name": "created_by", 1106 + "type": "text", 1107 + "primaryKey": false, 1108 + "notNull": true, 1109 + "autoincrement": false 1110 + }, 1111 + "created_at": { 1112 + "name": "created_at", 1113 + "type": "text", 1114 + "primaryKey": false, 1115 + "notNull": true, 1116 + "autoincrement": false, 1117 + "default": "(current_timestamp)" 1118 + }, 1119 + "creator_comment": { 1120 + "name": "creator_comment", 1121 + "type": "text", 1122 + "primaryKey": false, 1123 + "notNull": false, 1124 + "autoincrement": false 1125 + }, 1126 + "report_reason": { 1127 + "name": "report_reason", 1128 + "type": "text", 1129 + "primaryKey": false, 1130 + "notNull": false, 1131 + "autoincrement": false 1132 + }, 1133 + "status": { 1134 + "name": "status", 1135 + "type": "text", 1136 + "primaryKey": false, 1137 + "notNull": false, 1138 + "autoincrement": false, 1139 + "default": "'pending'" 1140 + } 1141 + }, 1142 + "indexes": {}, 1143 + "foreignKeys": {}, 1144 + "compositePrimaryKeys": {}, 1145 + "uniqueConstraints": {}, 1146 + "checkConstraints": {} 1147 + } 1148 + }, 1149 + "views": {}, 1150 + "enums": {}, 1151 + "_meta": { 1152 + "schemas": {}, 1153 + "tables": {}, 1154 + "columns": {} 1155 + }, 1156 + "internal": { 1157 + "indexes": {} 1158 + } 1159 + }
+8 -1
packages/frontpage/drizzle/meta/_journal.json
··· 50 50 "when": 1744475828986, 51 51 "tag": "0006_thankful_namorita", 52 52 "breakpoints": true 53 + }, 54 + { 55 + "idx": 7, 56 + "version": "6", 57 + "when": 1759526589132, 58 + "tag": "0007_silent_franklin_storm", 59 + "breakpoints": true 53 60 } 54 61 ] 55 - } 62 + }