A decentralized music tracking and discovery platform built on AT Protocol 🎵
0
fork

Configure Feed

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

feat: add feeds schema and related types; update package scripts

- Added a new schema for feeds in `src/schema/feeds.ts` with fields for id, displayName, description, did, uri, userId, xataVersion, createdAt, and updatedAt.
- Introduced types for selecting and inserting feeds using Drizzle ORM.
- Updated `package.json` to include a new script for feeding data: `feed`.
- Modified `_journal.json` to include a new entry for "whole greymalkin".

work in progress

work in progress

+3379 -1
+15
apps/api/drizzle/0004_whole_greymalkin.sql
··· 1 + CREATE TABLE "feeds" ( 2 + "xata_id" text PRIMARY KEY DEFAULT xata_id() NOT NULL, 3 + "display_name" text NOT NULL, 4 + "description" text, 5 + "did" text NOT NULL, 6 + "uri" text NOT NULL, 7 + "user_id" text NOT NULL, 8 + "xata_version" integer, 9 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 10 + "xata_updatedat" timestamp DEFAULT now() NOT NULL, 11 + CONSTRAINT "feeds_did_unique" UNIQUE("did"), 12 + CONSTRAINT "feeds_uri_unique" UNIQUE("uri") 13 + ); 14 + --> statement-breakpoint 15 + ALTER TABLE "feeds" ADD CONSTRAINT "feeds_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;
+3265
apps/api/drizzle/meta/0004_snapshot.json
··· 1 + { 2 + "id": "944a6989-c0aa-432f-9b42-4bf221d0c597", 3 + "prevId": "015093fe-a66e-4ec3-b5b6-5466c6266a39", 4 + "version": "7", 5 + "dialect": "postgresql", 6 + "tables": { 7 + "public.album_tracks": { 8 + "name": "album_tracks", 9 + "schema": "", 10 + "columns": { 11 + "xata_id": { 12 + "name": "xata_id", 13 + "type": "text", 14 + "primaryKey": true, 15 + "notNull": true, 16 + "default": "xata_id()" 17 + }, 18 + "album_id": { 19 + "name": "album_id", 20 + "type": "text", 21 + "primaryKey": false, 22 + "notNull": true 23 + }, 24 + "track_id": { 25 + "name": "track_id", 26 + "type": "text", 27 + "primaryKey": false, 28 + "notNull": true 29 + }, 30 + "xata_createdat": { 31 + "name": "xata_createdat", 32 + "type": "timestamp", 33 + "primaryKey": false, 34 + "notNull": true, 35 + "default": "now()" 36 + }, 37 + "xata_updatedat": { 38 + "name": "xata_updatedat", 39 + "type": "timestamp", 40 + "primaryKey": false, 41 + "notNull": true, 42 + "default": "now()" 43 + }, 44 + "xata_version": { 45 + "name": "xata_version", 46 + "type": "integer", 47 + "primaryKey": false, 48 + "notNull": false 49 + } 50 + }, 51 + "indexes": {}, 52 + "foreignKeys": { 53 + "album_tracks_album_id_albums_xata_id_fk": { 54 + "name": "album_tracks_album_id_albums_xata_id_fk", 55 + "tableFrom": "album_tracks", 56 + "tableTo": "albums", 57 + "columnsFrom": [ 58 + "album_id" 59 + ], 60 + "columnsTo": [ 61 + "xata_id" 62 + ], 63 + "onDelete": "no action", 64 + "onUpdate": "no action" 65 + }, 66 + "album_tracks_track_id_tracks_xata_id_fk": { 67 + "name": "album_tracks_track_id_tracks_xata_id_fk", 68 + "tableFrom": "album_tracks", 69 + "tableTo": "tracks", 70 + "columnsFrom": [ 71 + "track_id" 72 + ], 73 + "columnsTo": [ 74 + "xata_id" 75 + ], 76 + "onDelete": "no action", 77 + "onUpdate": "no action" 78 + } 79 + }, 80 + "compositePrimaryKeys": {}, 81 + "uniqueConstraints": {}, 82 + "policies": {}, 83 + "checkConstraints": {}, 84 + "isRLSEnabled": false 85 + }, 86 + "public.albums": { 87 + "name": "albums", 88 + "schema": "", 89 + "columns": { 90 + "xata_id": { 91 + "name": "xata_id", 92 + "type": "text", 93 + "primaryKey": true, 94 + "notNull": true, 95 + "default": "xata_id()" 96 + }, 97 + "title": { 98 + "name": "title", 99 + "type": "text", 100 + "primaryKey": false, 101 + "notNull": true 102 + }, 103 + "artist": { 104 + "name": "artist", 105 + "type": "text", 106 + "primaryKey": false, 107 + "notNull": true 108 + }, 109 + "release_date": { 110 + "name": "release_date", 111 + "type": "text", 112 + "primaryKey": false, 113 + "notNull": false 114 + }, 115 + "year": { 116 + "name": "year", 117 + "type": "integer", 118 + "primaryKey": false, 119 + "notNull": false 120 + }, 121 + "album_art": { 122 + "name": "album_art", 123 + "type": "text", 124 + "primaryKey": false, 125 + "notNull": false 126 + }, 127 + "uri": { 128 + "name": "uri", 129 + "type": "text", 130 + "primaryKey": false, 131 + "notNull": false 132 + }, 133 + "artist_uri": { 134 + "name": "artist_uri", 135 + "type": "text", 136 + "primaryKey": false, 137 + "notNull": false 138 + }, 139 + "apple_music_link": { 140 + "name": "apple_music_link", 141 + "type": "text", 142 + "primaryKey": false, 143 + "notNull": false 144 + }, 145 + "spotify_link": { 146 + "name": "spotify_link", 147 + "type": "text", 148 + "primaryKey": false, 149 + "notNull": false 150 + }, 151 + "tidal_link": { 152 + "name": "tidal_link", 153 + "type": "text", 154 + "primaryKey": false, 155 + "notNull": false 156 + }, 157 + "youtube_link": { 158 + "name": "youtube_link", 159 + "type": "text", 160 + "primaryKey": false, 161 + "notNull": false 162 + }, 163 + "sha256": { 164 + "name": "sha256", 165 + "type": "text", 166 + "primaryKey": false, 167 + "notNull": true 168 + }, 169 + "xata_createdat": { 170 + "name": "xata_createdat", 171 + "type": "timestamp", 172 + "primaryKey": false, 173 + "notNull": true, 174 + "default": "now()" 175 + }, 176 + "xata_updatedat": { 177 + "name": "xata_updatedat", 178 + "type": "timestamp", 179 + "primaryKey": false, 180 + "notNull": true, 181 + "default": "now()" 182 + }, 183 + "xata_version": { 184 + "name": "xata_version", 185 + "type": "integer", 186 + "primaryKey": false, 187 + "notNull": false 188 + } 189 + }, 190 + "indexes": {}, 191 + "foreignKeys": {}, 192 + "compositePrimaryKeys": {}, 193 + "uniqueConstraints": { 194 + "albums_uri_unique": { 195 + "name": "albums_uri_unique", 196 + "nullsNotDistinct": false, 197 + "columns": [ 198 + "uri" 199 + ] 200 + }, 201 + "albums_apple_music_link_unique": { 202 + "name": "albums_apple_music_link_unique", 203 + "nullsNotDistinct": false, 204 + "columns": [ 205 + "apple_music_link" 206 + ] 207 + }, 208 + "albums_spotify_link_unique": { 209 + "name": "albums_spotify_link_unique", 210 + "nullsNotDistinct": false, 211 + "columns": [ 212 + "spotify_link" 213 + ] 214 + }, 215 + "albums_tidal_link_unique": { 216 + "name": "albums_tidal_link_unique", 217 + "nullsNotDistinct": false, 218 + "columns": [ 219 + "tidal_link" 220 + ] 221 + }, 222 + "albums_youtube_link_unique": { 223 + "name": "albums_youtube_link_unique", 224 + "nullsNotDistinct": false, 225 + "columns": [ 226 + "youtube_link" 227 + ] 228 + }, 229 + "albums_sha256_unique": { 230 + "name": "albums_sha256_unique", 231 + "nullsNotDistinct": false, 232 + "columns": [ 233 + "sha256" 234 + ] 235 + } 236 + }, 237 + "policies": {}, 238 + "checkConstraints": {}, 239 + "isRLSEnabled": false 240 + }, 241 + "public.api_keys": { 242 + "name": "api_keys", 243 + "schema": "", 244 + "columns": { 245 + "xata_id": { 246 + "name": "xata_id", 247 + "type": "text", 248 + "primaryKey": true, 249 + "notNull": true, 250 + "default": "xata_id()" 251 + }, 252 + "name": { 253 + "name": "name", 254 + "type": "text", 255 + "primaryKey": false, 256 + "notNull": true 257 + }, 258 + "api_key": { 259 + "name": "api_key", 260 + "type": "text", 261 + "primaryKey": false, 262 + "notNull": true 263 + }, 264 + "shared_secret": { 265 + "name": "shared_secret", 266 + "type": "text", 267 + "primaryKey": false, 268 + "notNull": true 269 + }, 270 + "description": { 271 + "name": "description", 272 + "type": "text", 273 + "primaryKey": false, 274 + "notNull": false 275 + }, 276 + "enabled": { 277 + "name": "enabled", 278 + "type": "boolean", 279 + "primaryKey": false, 280 + "notNull": true, 281 + "default": true 282 + }, 283 + "user_id": { 284 + "name": "user_id", 285 + "type": "text", 286 + "primaryKey": false, 287 + "notNull": true 288 + }, 289 + "xata_createdat": { 290 + "name": "xata_createdat", 291 + "type": "timestamp", 292 + "primaryKey": false, 293 + "notNull": true, 294 + "default": "now()" 295 + }, 296 + "xata_updatedat": { 297 + "name": "xata_updatedat", 298 + "type": "timestamp", 299 + "primaryKey": false, 300 + "notNull": true, 301 + "default": "now()" 302 + } 303 + }, 304 + "indexes": {}, 305 + "foreignKeys": { 306 + "api_keys_user_id_users_xata_id_fk": { 307 + "name": "api_keys_user_id_users_xata_id_fk", 308 + "tableFrom": "api_keys", 309 + "tableTo": "users", 310 + "columnsFrom": [ 311 + "user_id" 312 + ], 313 + "columnsTo": [ 314 + "xata_id" 315 + ], 316 + "onDelete": "no action", 317 + "onUpdate": "no action" 318 + } 319 + }, 320 + "compositePrimaryKeys": {}, 321 + "uniqueConstraints": {}, 322 + "policies": {}, 323 + "checkConstraints": {}, 324 + "isRLSEnabled": false 325 + }, 326 + "public.artist_albums": { 327 + "name": "artist_albums", 328 + "schema": "", 329 + "columns": { 330 + "xata_id": { 331 + "name": "xata_id", 332 + "type": "text", 333 + "primaryKey": true, 334 + "notNull": true, 335 + "default": "xata_id()" 336 + }, 337 + "artist_id": { 338 + "name": "artist_id", 339 + "type": "text", 340 + "primaryKey": false, 341 + "notNull": true 342 + }, 343 + "album_id": { 344 + "name": "album_id", 345 + "type": "text", 346 + "primaryKey": false, 347 + "notNull": true 348 + }, 349 + "xata_createdat": { 350 + "name": "xata_createdat", 351 + "type": "timestamp", 352 + "primaryKey": false, 353 + "notNull": true, 354 + "default": "now()" 355 + }, 356 + "xata_updatedat": { 357 + "name": "xata_updatedat", 358 + "type": "timestamp", 359 + "primaryKey": false, 360 + "notNull": true, 361 + "default": "now()" 362 + }, 363 + "xata_version": { 364 + "name": "xata_version", 365 + "type": "integer", 366 + "primaryKey": false, 367 + "notNull": false 368 + } 369 + }, 370 + "indexes": {}, 371 + "foreignKeys": { 372 + "artist_albums_artist_id_artists_xata_id_fk": { 373 + "name": "artist_albums_artist_id_artists_xata_id_fk", 374 + "tableFrom": "artist_albums", 375 + "tableTo": "artists", 376 + "columnsFrom": [ 377 + "artist_id" 378 + ], 379 + "columnsTo": [ 380 + "xata_id" 381 + ], 382 + "onDelete": "no action", 383 + "onUpdate": "no action" 384 + }, 385 + "artist_albums_album_id_albums_xata_id_fk": { 386 + "name": "artist_albums_album_id_albums_xata_id_fk", 387 + "tableFrom": "artist_albums", 388 + "tableTo": "albums", 389 + "columnsFrom": [ 390 + "album_id" 391 + ], 392 + "columnsTo": [ 393 + "xata_id" 394 + ], 395 + "onDelete": "no action", 396 + "onUpdate": "no action" 397 + } 398 + }, 399 + "compositePrimaryKeys": {}, 400 + "uniqueConstraints": {}, 401 + "policies": {}, 402 + "checkConstraints": {}, 403 + "isRLSEnabled": false 404 + }, 405 + "public.artist_tracks": { 406 + "name": "artist_tracks", 407 + "schema": "", 408 + "columns": { 409 + "xata_id": { 410 + "name": "xata_id", 411 + "type": "text", 412 + "primaryKey": true, 413 + "notNull": true, 414 + "default": "xata_id()" 415 + }, 416 + "artist_id": { 417 + "name": "artist_id", 418 + "type": "text", 419 + "primaryKey": false, 420 + "notNull": true 421 + }, 422 + "track_id": { 423 + "name": "track_id", 424 + "type": "text", 425 + "primaryKey": false, 426 + "notNull": true 427 + }, 428 + "xata_createdat": { 429 + "name": "xata_createdat", 430 + "type": "timestamp", 431 + "primaryKey": false, 432 + "notNull": true, 433 + "default": "now()" 434 + }, 435 + "xata_updatedat": { 436 + "name": "xata_updatedat", 437 + "type": "timestamp", 438 + "primaryKey": false, 439 + "notNull": true, 440 + "default": "now()" 441 + }, 442 + "xata_version": { 443 + "name": "xata_version", 444 + "type": "integer", 445 + "primaryKey": false, 446 + "notNull": false 447 + } 448 + }, 449 + "indexes": {}, 450 + "foreignKeys": { 451 + "artist_tracks_artist_id_artists_xata_id_fk": { 452 + "name": "artist_tracks_artist_id_artists_xata_id_fk", 453 + "tableFrom": "artist_tracks", 454 + "tableTo": "artists", 455 + "columnsFrom": [ 456 + "artist_id" 457 + ], 458 + "columnsTo": [ 459 + "xata_id" 460 + ], 461 + "onDelete": "no action", 462 + "onUpdate": "no action" 463 + }, 464 + "artist_tracks_track_id_tracks_xata_id_fk": { 465 + "name": "artist_tracks_track_id_tracks_xata_id_fk", 466 + "tableFrom": "artist_tracks", 467 + "tableTo": "tracks", 468 + "columnsFrom": [ 469 + "track_id" 470 + ], 471 + "columnsTo": [ 472 + "xata_id" 473 + ], 474 + "onDelete": "no action", 475 + "onUpdate": "no action" 476 + } 477 + }, 478 + "compositePrimaryKeys": {}, 479 + "uniqueConstraints": {}, 480 + "policies": {}, 481 + "checkConstraints": {}, 482 + "isRLSEnabled": false 483 + }, 484 + "public.artists": { 485 + "name": "artists", 486 + "schema": "", 487 + "columns": { 488 + "xata_id": { 489 + "name": "xata_id", 490 + "type": "text", 491 + "primaryKey": true, 492 + "notNull": true, 493 + "default": "xata_id()" 494 + }, 495 + "name": { 496 + "name": "name", 497 + "type": "text", 498 + "primaryKey": false, 499 + "notNull": true 500 + }, 501 + "biography": { 502 + "name": "biography", 503 + "type": "text", 504 + "primaryKey": false, 505 + "notNull": false 506 + }, 507 + "born": { 508 + "name": "born", 509 + "type": "timestamp", 510 + "primaryKey": false, 511 + "notNull": false 512 + }, 513 + "born_in": { 514 + "name": "born_in", 515 + "type": "text", 516 + "primaryKey": false, 517 + "notNull": false 518 + }, 519 + "died": { 520 + "name": "died", 521 + "type": "timestamp", 522 + "primaryKey": false, 523 + "notNull": false 524 + }, 525 + "picture": { 526 + "name": "picture", 527 + "type": "text", 528 + "primaryKey": false, 529 + "notNull": false 530 + }, 531 + "sha256": { 532 + "name": "sha256", 533 + "type": "text", 534 + "primaryKey": false, 535 + "notNull": true 536 + }, 537 + "uri": { 538 + "name": "uri", 539 + "type": "text", 540 + "primaryKey": false, 541 + "notNull": false 542 + }, 543 + "apple_music_link": { 544 + "name": "apple_music_link", 545 + "type": "text", 546 + "primaryKey": false, 547 + "notNull": false 548 + }, 549 + "spotify_link": { 550 + "name": "spotify_link", 551 + "type": "text", 552 + "primaryKey": false, 553 + "notNull": false 554 + }, 555 + "tidal_link": { 556 + "name": "tidal_link", 557 + "type": "text", 558 + "primaryKey": false, 559 + "notNull": false 560 + }, 561 + "youtube_link": { 562 + "name": "youtube_link", 563 + "type": "text", 564 + "primaryKey": false, 565 + "notNull": false 566 + }, 567 + "genres": { 568 + "name": "genres", 569 + "type": "text[]", 570 + "primaryKey": false, 571 + "notNull": false 572 + }, 573 + "xata_createdat": { 574 + "name": "xata_createdat", 575 + "type": "timestamp", 576 + "primaryKey": false, 577 + "notNull": true, 578 + "default": "now()" 579 + }, 580 + "xata_updatedat": { 581 + "name": "xata_updatedat", 582 + "type": "timestamp", 583 + "primaryKey": false, 584 + "notNull": true, 585 + "default": "now()" 586 + }, 587 + "xata_version": { 588 + "name": "xata_version", 589 + "type": "integer", 590 + "primaryKey": false, 591 + "notNull": false 592 + } 593 + }, 594 + "indexes": {}, 595 + "foreignKeys": {}, 596 + "compositePrimaryKeys": {}, 597 + "uniqueConstraints": { 598 + "artists_sha256_unique": { 599 + "name": "artists_sha256_unique", 600 + "nullsNotDistinct": false, 601 + "columns": [ 602 + "sha256" 603 + ] 604 + }, 605 + "artists_uri_unique": { 606 + "name": "artists_uri_unique", 607 + "nullsNotDistinct": false, 608 + "columns": [ 609 + "uri" 610 + ] 611 + } 612 + }, 613 + "policies": {}, 614 + "checkConstraints": {}, 615 + "isRLSEnabled": false 616 + }, 617 + "public.dropbox_accounts": { 618 + "name": "dropbox_accounts", 619 + "schema": "", 620 + "columns": { 621 + "xata_id": { 622 + "name": "xata_id", 623 + "type": "text", 624 + "primaryKey": true, 625 + "notNull": true, 626 + "default": "xata_id()" 627 + }, 628 + "email": { 629 + "name": "email", 630 + "type": "text", 631 + "primaryKey": false, 632 + "notNull": true 633 + }, 634 + "is_beta_user": { 635 + "name": "is_beta_user", 636 + "type": "boolean", 637 + "primaryKey": false, 638 + "notNull": true, 639 + "default": false 640 + }, 641 + "user_id": { 642 + "name": "user_id", 643 + "type": "text", 644 + "primaryKey": false, 645 + "notNull": true 646 + }, 647 + "xata_version": { 648 + "name": "xata_version", 649 + "type": "text", 650 + "primaryKey": false, 651 + "notNull": false 652 + }, 653 + "xata_createdat": { 654 + "name": "xata_createdat", 655 + "type": "timestamp", 656 + "primaryKey": false, 657 + "notNull": true, 658 + "default": "now()" 659 + }, 660 + "xata_updatedat": { 661 + "name": "xata_updatedat", 662 + "type": "timestamp", 663 + "primaryKey": false, 664 + "notNull": true, 665 + "default": "now()" 666 + } 667 + }, 668 + "indexes": {}, 669 + "foreignKeys": { 670 + "dropbox_accounts_user_id_users_xata_id_fk": { 671 + "name": "dropbox_accounts_user_id_users_xata_id_fk", 672 + "tableFrom": "dropbox_accounts", 673 + "tableTo": "users", 674 + "columnsFrom": [ 675 + "user_id" 676 + ], 677 + "columnsTo": [ 678 + "xata_id" 679 + ], 680 + "onDelete": "no action", 681 + "onUpdate": "no action" 682 + } 683 + }, 684 + "compositePrimaryKeys": {}, 685 + "uniqueConstraints": { 686 + "dropbox_accounts_email_unique": { 687 + "name": "dropbox_accounts_email_unique", 688 + "nullsNotDistinct": false, 689 + "columns": [ 690 + "email" 691 + ] 692 + } 693 + }, 694 + "policies": {}, 695 + "checkConstraints": {}, 696 + "isRLSEnabled": false 697 + }, 698 + "public.dropbox_directories": { 699 + "name": "dropbox_directories", 700 + "schema": "", 701 + "columns": { 702 + "xata_id": { 703 + "name": "xata_id", 704 + "type": "text", 705 + "primaryKey": true, 706 + "notNull": true, 707 + "default": "xata_id()" 708 + }, 709 + "name": { 710 + "name": "name", 711 + "type": "text", 712 + "primaryKey": false, 713 + "notNull": true 714 + }, 715 + "path": { 716 + "name": "path", 717 + "type": "text", 718 + "primaryKey": false, 719 + "notNull": true 720 + }, 721 + "parent_id": { 722 + "name": "parent_id", 723 + "type": "text", 724 + "primaryKey": false, 725 + "notNull": false 726 + }, 727 + "dropbox_id": { 728 + "name": "dropbox_id", 729 + "type": "text", 730 + "primaryKey": false, 731 + "notNull": true 732 + }, 733 + "file_id": { 734 + "name": "file_id", 735 + "type": "text", 736 + "primaryKey": false, 737 + "notNull": true 738 + }, 739 + "xata_version": { 740 + "name": "xata_version", 741 + "type": "text", 742 + "primaryKey": false, 743 + "notNull": false 744 + }, 745 + "xata_createdat": { 746 + "name": "xata_createdat", 747 + "type": "timestamp", 748 + "primaryKey": false, 749 + "notNull": true, 750 + "default": "now()" 751 + }, 752 + "xata_updatedat": { 753 + "name": "xata_updatedat", 754 + "type": "timestamp", 755 + "primaryKey": false, 756 + "notNull": true, 757 + "default": "now()" 758 + } 759 + }, 760 + "indexes": {}, 761 + "foreignKeys": { 762 + "dropbox_directories_parent_id_dropbox_directories_xata_id_fk": { 763 + "name": "dropbox_directories_parent_id_dropbox_directories_xata_id_fk", 764 + "tableFrom": "dropbox_directories", 765 + "tableTo": "dropbox_directories", 766 + "columnsFrom": [ 767 + "parent_id" 768 + ], 769 + "columnsTo": [ 770 + "xata_id" 771 + ], 772 + "onDelete": "no action", 773 + "onUpdate": "no action" 774 + } 775 + }, 776 + "compositePrimaryKeys": {}, 777 + "uniqueConstraints": { 778 + "dropbox_directories_file_id_unique": { 779 + "name": "dropbox_directories_file_id_unique", 780 + "nullsNotDistinct": false, 781 + "columns": [ 782 + "file_id" 783 + ] 784 + } 785 + }, 786 + "policies": {}, 787 + "checkConstraints": {}, 788 + "isRLSEnabled": false 789 + }, 790 + "public.dropbox_paths": { 791 + "name": "dropbox_paths", 792 + "schema": "", 793 + "columns": { 794 + "xata_id": { 795 + "name": "xata_id", 796 + "type": "text", 797 + "primaryKey": true, 798 + "notNull": true, 799 + "default": "xata_id()" 800 + }, 801 + "path": { 802 + "name": "path", 803 + "type": "text", 804 + "primaryKey": false, 805 + "notNull": true 806 + }, 807 + "name": { 808 + "name": "name", 809 + "type": "text", 810 + "primaryKey": false, 811 + "notNull": true 812 + }, 813 + "dropbox_id": { 814 + "name": "dropbox_id", 815 + "type": "text", 816 + "primaryKey": false, 817 + "notNull": true 818 + }, 819 + "track_id": { 820 + "name": "track_id", 821 + "type": "text", 822 + "primaryKey": false, 823 + "notNull": true 824 + }, 825 + "directory_id": { 826 + "name": "directory_id", 827 + "type": "text", 828 + "primaryKey": false, 829 + "notNull": false 830 + }, 831 + "file_id": { 832 + "name": "file_id", 833 + "type": "text", 834 + "primaryKey": false, 835 + "notNull": true 836 + }, 837 + "xata_version": { 838 + "name": "xata_version", 839 + "type": "text", 840 + "primaryKey": false, 841 + "notNull": false 842 + }, 843 + "xata_createdat": { 844 + "name": "xata_createdat", 845 + "type": "timestamp", 846 + "primaryKey": false, 847 + "notNull": true, 848 + "default": "now()" 849 + }, 850 + "xata_updatedat": { 851 + "name": "xata_updatedat", 852 + "type": "timestamp", 853 + "primaryKey": false, 854 + "notNull": true, 855 + "default": "now()" 856 + } 857 + }, 858 + "indexes": {}, 859 + "foreignKeys": { 860 + "dropbox_paths_directory_id_dropbox_directories_xata_id_fk": { 861 + "name": "dropbox_paths_directory_id_dropbox_directories_xata_id_fk", 862 + "tableFrom": "dropbox_paths", 863 + "tableTo": "dropbox_directories", 864 + "columnsFrom": [ 865 + "directory_id" 866 + ], 867 + "columnsTo": [ 868 + "xata_id" 869 + ], 870 + "onDelete": "no action", 871 + "onUpdate": "no action" 872 + } 873 + }, 874 + "compositePrimaryKeys": {}, 875 + "uniqueConstraints": { 876 + "dropbox_paths_file_id_unique": { 877 + "name": "dropbox_paths_file_id_unique", 878 + "nullsNotDistinct": false, 879 + "columns": [ 880 + "file_id" 881 + ] 882 + } 883 + }, 884 + "policies": {}, 885 + "checkConstraints": {}, 886 + "isRLSEnabled": false 887 + }, 888 + "public.dropbox_tokens": { 889 + "name": "dropbox_tokens", 890 + "schema": "", 891 + "columns": { 892 + "xata_id": { 893 + "name": "xata_id", 894 + "type": "text", 895 + "primaryKey": true, 896 + "notNull": true, 897 + "default": "xata_id()" 898 + }, 899 + "refresh_token": { 900 + "name": "refresh_token", 901 + "type": "text", 902 + "primaryKey": false, 903 + "notNull": true 904 + }, 905 + "xata_createdat": { 906 + "name": "xata_createdat", 907 + "type": "timestamp", 908 + "primaryKey": false, 909 + "notNull": true, 910 + "default": "now()" 911 + }, 912 + "xata_updatedat": { 913 + "name": "xata_updatedat", 914 + "type": "timestamp", 915 + "primaryKey": false, 916 + "notNull": true, 917 + "default": "now()" 918 + } 919 + }, 920 + "indexes": {}, 921 + "foreignKeys": {}, 922 + "compositePrimaryKeys": {}, 923 + "uniqueConstraints": {}, 924 + "policies": {}, 925 + "checkConstraints": {}, 926 + "isRLSEnabled": false 927 + }, 928 + "public.dropbox": { 929 + "name": "dropbox", 930 + "schema": "", 931 + "columns": { 932 + "xata_id": { 933 + "name": "xata_id", 934 + "type": "text", 935 + "primaryKey": true, 936 + "notNull": true, 937 + "default": "xata_id()" 938 + }, 939 + "user_id": { 940 + "name": "user_id", 941 + "type": "text", 942 + "primaryKey": false, 943 + "notNull": true 944 + }, 945 + "dropbox_token_id": { 946 + "name": "dropbox_token_id", 947 + "type": "text", 948 + "primaryKey": false, 949 + "notNull": true 950 + }, 951 + "xata_version": { 952 + "name": "xata_version", 953 + "type": "text", 954 + "primaryKey": false, 955 + "notNull": false 956 + }, 957 + "xata_createdat": { 958 + "name": "xata_createdat", 959 + "type": "timestamp", 960 + "primaryKey": false, 961 + "notNull": true, 962 + "default": "now()" 963 + }, 964 + "xata_updatedat": { 965 + "name": "xata_updatedat", 966 + "type": "timestamp", 967 + "primaryKey": false, 968 + "notNull": true, 969 + "default": "now()" 970 + } 971 + }, 972 + "indexes": {}, 973 + "foreignKeys": { 974 + "dropbox_user_id_users_xata_id_fk": { 975 + "name": "dropbox_user_id_users_xata_id_fk", 976 + "tableFrom": "dropbox", 977 + "tableTo": "users", 978 + "columnsFrom": [ 979 + "user_id" 980 + ], 981 + "columnsTo": [ 982 + "xata_id" 983 + ], 984 + "onDelete": "no action", 985 + "onUpdate": "no action" 986 + }, 987 + "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk": { 988 + "name": "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk", 989 + "tableFrom": "dropbox", 990 + "tableTo": "dropbox_tokens", 991 + "columnsFrom": [ 992 + "dropbox_token_id" 993 + ], 994 + "columnsTo": [ 995 + "xata_id" 996 + ], 997 + "onDelete": "no action", 998 + "onUpdate": "no action" 999 + } 1000 + }, 1001 + "compositePrimaryKeys": {}, 1002 + "uniqueConstraints": {}, 1003 + "policies": {}, 1004 + "checkConstraints": {}, 1005 + "isRLSEnabled": false 1006 + }, 1007 + "public.feeds": { 1008 + "name": "feeds", 1009 + "schema": "", 1010 + "columns": { 1011 + "xata_id": { 1012 + "name": "xata_id", 1013 + "type": "text", 1014 + "primaryKey": true, 1015 + "notNull": true, 1016 + "default": "xata_id()" 1017 + }, 1018 + "display_name": { 1019 + "name": "display_name", 1020 + "type": "text", 1021 + "primaryKey": false, 1022 + "notNull": true 1023 + }, 1024 + "description": { 1025 + "name": "description", 1026 + "type": "text", 1027 + "primaryKey": false, 1028 + "notNull": false 1029 + }, 1030 + "did": { 1031 + "name": "did", 1032 + "type": "text", 1033 + "primaryKey": false, 1034 + "notNull": true 1035 + }, 1036 + "uri": { 1037 + "name": "uri", 1038 + "type": "text", 1039 + "primaryKey": false, 1040 + "notNull": true 1041 + }, 1042 + "user_id": { 1043 + "name": "user_id", 1044 + "type": "text", 1045 + "primaryKey": false, 1046 + "notNull": true 1047 + }, 1048 + "xata_version": { 1049 + "name": "xata_version", 1050 + "type": "integer", 1051 + "primaryKey": false, 1052 + "notNull": false 1053 + }, 1054 + "xata_createdat": { 1055 + "name": "xata_createdat", 1056 + "type": "timestamp", 1057 + "primaryKey": false, 1058 + "notNull": true, 1059 + "default": "now()" 1060 + }, 1061 + "xata_updatedat": { 1062 + "name": "xata_updatedat", 1063 + "type": "timestamp", 1064 + "primaryKey": false, 1065 + "notNull": true, 1066 + "default": "now()" 1067 + } 1068 + }, 1069 + "indexes": {}, 1070 + "foreignKeys": { 1071 + "feeds_user_id_users_xata_id_fk": { 1072 + "name": "feeds_user_id_users_xata_id_fk", 1073 + "tableFrom": "feeds", 1074 + "tableTo": "users", 1075 + "columnsFrom": [ 1076 + "user_id" 1077 + ], 1078 + "columnsTo": [ 1079 + "xata_id" 1080 + ], 1081 + "onDelete": "no action", 1082 + "onUpdate": "no action" 1083 + } 1084 + }, 1085 + "compositePrimaryKeys": {}, 1086 + "uniqueConstraints": { 1087 + "feeds_did_unique": { 1088 + "name": "feeds_did_unique", 1089 + "nullsNotDistinct": false, 1090 + "columns": [ 1091 + "did" 1092 + ] 1093 + }, 1094 + "feeds_uri_unique": { 1095 + "name": "feeds_uri_unique", 1096 + "nullsNotDistinct": false, 1097 + "columns": [ 1098 + "uri" 1099 + ] 1100 + } 1101 + }, 1102 + "policies": {}, 1103 + "checkConstraints": {}, 1104 + "isRLSEnabled": false 1105 + }, 1106 + "public.google_drive_accounts": { 1107 + "name": "google_drive_accounts", 1108 + "schema": "", 1109 + "columns": { 1110 + "xata_id": { 1111 + "name": "xata_id", 1112 + "type": "text", 1113 + "primaryKey": true, 1114 + "notNull": true, 1115 + "default": "xata_id()" 1116 + }, 1117 + "email": { 1118 + "name": "email", 1119 + "type": "text", 1120 + "primaryKey": false, 1121 + "notNull": true 1122 + }, 1123 + "is_beta_user": { 1124 + "name": "is_beta_user", 1125 + "type": "boolean", 1126 + "primaryKey": false, 1127 + "notNull": true, 1128 + "default": false 1129 + }, 1130 + "user_id": { 1131 + "name": "user_id", 1132 + "type": "text", 1133 + "primaryKey": false, 1134 + "notNull": true 1135 + }, 1136 + "xata_version": { 1137 + "name": "xata_version", 1138 + "type": "text", 1139 + "primaryKey": false, 1140 + "notNull": false 1141 + }, 1142 + "xata_createdat": { 1143 + "name": "xata_createdat", 1144 + "type": "timestamp", 1145 + "primaryKey": false, 1146 + "notNull": true, 1147 + "default": "now()" 1148 + }, 1149 + "xata_updatedat": { 1150 + "name": "xata_updatedat", 1151 + "type": "timestamp", 1152 + "primaryKey": false, 1153 + "notNull": true, 1154 + "default": "now()" 1155 + } 1156 + }, 1157 + "indexes": {}, 1158 + "foreignKeys": { 1159 + "google_drive_accounts_user_id_users_xata_id_fk": { 1160 + "name": "google_drive_accounts_user_id_users_xata_id_fk", 1161 + "tableFrom": "google_drive_accounts", 1162 + "tableTo": "users", 1163 + "columnsFrom": [ 1164 + "user_id" 1165 + ], 1166 + "columnsTo": [ 1167 + "xata_id" 1168 + ], 1169 + "onDelete": "no action", 1170 + "onUpdate": "no action" 1171 + } 1172 + }, 1173 + "compositePrimaryKeys": {}, 1174 + "uniqueConstraints": { 1175 + "google_drive_accounts_email_unique": { 1176 + "name": "google_drive_accounts_email_unique", 1177 + "nullsNotDistinct": false, 1178 + "columns": [ 1179 + "email" 1180 + ] 1181 + } 1182 + }, 1183 + "policies": {}, 1184 + "checkConstraints": {}, 1185 + "isRLSEnabled": false 1186 + }, 1187 + "public.google_drive_directories": { 1188 + "name": "google_drive_directories", 1189 + "schema": "", 1190 + "columns": { 1191 + "xata_id": { 1192 + "name": "xata_id", 1193 + "type": "text", 1194 + "primaryKey": true, 1195 + "notNull": true, 1196 + "default": "xata_id()" 1197 + }, 1198 + "name": { 1199 + "name": "name", 1200 + "type": "text", 1201 + "primaryKey": false, 1202 + "notNull": true 1203 + }, 1204 + "path": { 1205 + "name": "path", 1206 + "type": "text", 1207 + "primaryKey": false, 1208 + "notNull": true 1209 + }, 1210 + "parent_id": { 1211 + "name": "parent_id", 1212 + "type": "text", 1213 + "primaryKey": false, 1214 + "notNull": false 1215 + }, 1216 + "google_drive_id": { 1217 + "name": "google_drive_id", 1218 + "type": "text", 1219 + "primaryKey": false, 1220 + "notNull": true 1221 + }, 1222 + "file_id": { 1223 + "name": "file_id", 1224 + "type": "text", 1225 + "primaryKey": false, 1226 + "notNull": true 1227 + }, 1228 + "xata_version": { 1229 + "name": "xata_version", 1230 + "type": "text", 1231 + "primaryKey": false, 1232 + "notNull": false 1233 + }, 1234 + "xata_createdat": { 1235 + "name": "xata_createdat", 1236 + "type": "timestamp", 1237 + "primaryKey": false, 1238 + "notNull": true, 1239 + "default": "now()" 1240 + }, 1241 + "xata_updatedat": { 1242 + "name": "xata_updatedat", 1243 + "type": "timestamp", 1244 + "primaryKey": false, 1245 + "notNull": true, 1246 + "default": "now()" 1247 + } 1248 + }, 1249 + "indexes": {}, 1250 + "foreignKeys": { 1251 + "google_drive_directories_parent_id_google_drive_directories_xata_id_fk": { 1252 + "name": "google_drive_directories_parent_id_google_drive_directories_xata_id_fk", 1253 + "tableFrom": "google_drive_directories", 1254 + "tableTo": "google_drive_directories", 1255 + "columnsFrom": [ 1256 + "parent_id" 1257 + ], 1258 + "columnsTo": [ 1259 + "xata_id" 1260 + ], 1261 + "onDelete": "no action", 1262 + "onUpdate": "no action" 1263 + } 1264 + }, 1265 + "compositePrimaryKeys": {}, 1266 + "uniqueConstraints": { 1267 + "google_drive_directories_file_id_unique": { 1268 + "name": "google_drive_directories_file_id_unique", 1269 + "nullsNotDistinct": false, 1270 + "columns": [ 1271 + "file_id" 1272 + ] 1273 + } 1274 + }, 1275 + "policies": {}, 1276 + "checkConstraints": {}, 1277 + "isRLSEnabled": false 1278 + }, 1279 + "public.google_drive_paths": { 1280 + "name": "google_drive_paths", 1281 + "schema": "", 1282 + "columns": { 1283 + "xata_id": { 1284 + "name": "xata_id", 1285 + "type": "text", 1286 + "primaryKey": true, 1287 + "notNull": true, 1288 + "default": "xata_id()" 1289 + }, 1290 + "google_drive_id": { 1291 + "name": "google_drive_id", 1292 + "type": "text", 1293 + "primaryKey": false, 1294 + "notNull": true 1295 + }, 1296 + "track_id": { 1297 + "name": "track_id", 1298 + "type": "text", 1299 + "primaryKey": false, 1300 + "notNull": true 1301 + }, 1302 + "name": { 1303 + "name": "name", 1304 + "type": "text", 1305 + "primaryKey": false, 1306 + "notNull": true 1307 + }, 1308 + "directory_id": { 1309 + "name": "directory_id", 1310 + "type": "text", 1311 + "primaryKey": false, 1312 + "notNull": false 1313 + }, 1314 + "file_id": { 1315 + "name": "file_id", 1316 + "type": "text", 1317 + "primaryKey": false, 1318 + "notNull": true 1319 + }, 1320 + "xata_version": { 1321 + "name": "xata_version", 1322 + "type": "text", 1323 + "primaryKey": false, 1324 + "notNull": false 1325 + }, 1326 + "xata_createdat": { 1327 + "name": "xata_createdat", 1328 + "type": "timestamp", 1329 + "primaryKey": false, 1330 + "notNull": true, 1331 + "default": "now()" 1332 + }, 1333 + "xata_updatedat": { 1334 + "name": "xata_updatedat", 1335 + "type": "timestamp", 1336 + "primaryKey": false, 1337 + "notNull": true, 1338 + "default": "now()" 1339 + } 1340 + }, 1341 + "indexes": {}, 1342 + "foreignKeys": { 1343 + "google_drive_paths_directory_id_google_drive_directories_xata_id_fk": { 1344 + "name": "google_drive_paths_directory_id_google_drive_directories_xata_id_fk", 1345 + "tableFrom": "google_drive_paths", 1346 + "tableTo": "google_drive_directories", 1347 + "columnsFrom": [ 1348 + "directory_id" 1349 + ], 1350 + "columnsTo": [ 1351 + "xata_id" 1352 + ], 1353 + "onDelete": "no action", 1354 + "onUpdate": "no action" 1355 + } 1356 + }, 1357 + "compositePrimaryKeys": {}, 1358 + "uniqueConstraints": { 1359 + "google_drive_paths_file_id_unique": { 1360 + "name": "google_drive_paths_file_id_unique", 1361 + "nullsNotDistinct": false, 1362 + "columns": [ 1363 + "file_id" 1364 + ] 1365 + } 1366 + }, 1367 + "policies": {}, 1368 + "checkConstraints": {}, 1369 + "isRLSEnabled": false 1370 + }, 1371 + "public.google_drive_tokens": { 1372 + "name": "google_drive_tokens", 1373 + "schema": "", 1374 + "columns": { 1375 + "xata_id": { 1376 + "name": "xata_id", 1377 + "type": "text", 1378 + "primaryKey": true, 1379 + "notNull": true, 1380 + "default": "xata_id()" 1381 + }, 1382 + "refresh_token": { 1383 + "name": "refresh_token", 1384 + "type": "text", 1385 + "primaryKey": false, 1386 + "notNull": true 1387 + }, 1388 + "xata_createdat": { 1389 + "name": "xata_createdat", 1390 + "type": "timestamp", 1391 + "primaryKey": false, 1392 + "notNull": true, 1393 + "default": "now()" 1394 + }, 1395 + "xata_updatedat": { 1396 + "name": "xata_updatedat", 1397 + "type": "timestamp", 1398 + "primaryKey": false, 1399 + "notNull": true, 1400 + "default": "now()" 1401 + } 1402 + }, 1403 + "indexes": {}, 1404 + "foreignKeys": {}, 1405 + "compositePrimaryKeys": {}, 1406 + "uniqueConstraints": {}, 1407 + "policies": {}, 1408 + "checkConstraints": {}, 1409 + "isRLSEnabled": false 1410 + }, 1411 + "public.google_drive": { 1412 + "name": "google_drive", 1413 + "schema": "", 1414 + "columns": { 1415 + "xata_id": { 1416 + "name": "xata_id", 1417 + "type": "text", 1418 + "primaryKey": true, 1419 + "notNull": true, 1420 + "default": "xata_id()" 1421 + }, 1422 + "google_drive_token_id": { 1423 + "name": "google_drive_token_id", 1424 + "type": "text", 1425 + "primaryKey": false, 1426 + "notNull": true 1427 + }, 1428 + "user_id": { 1429 + "name": "user_id", 1430 + "type": "text", 1431 + "primaryKey": false, 1432 + "notNull": true 1433 + }, 1434 + "xata_version": { 1435 + "name": "xata_version", 1436 + "type": "text", 1437 + "primaryKey": false, 1438 + "notNull": false 1439 + }, 1440 + "xata_createdat": { 1441 + "name": "xata_createdat", 1442 + "type": "timestamp", 1443 + "primaryKey": false, 1444 + "notNull": true, 1445 + "default": "now()" 1446 + }, 1447 + "xata_updatedat": { 1448 + "name": "xata_updatedat", 1449 + "type": "timestamp", 1450 + "primaryKey": false, 1451 + "notNull": true, 1452 + "default": "now()" 1453 + } 1454 + }, 1455 + "indexes": {}, 1456 + "foreignKeys": { 1457 + "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk": { 1458 + "name": "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk", 1459 + "tableFrom": "google_drive", 1460 + "tableTo": "google_drive_tokens", 1461 + "columnsFrom": [ 1462 + "google_drive_token_id" 1463 + ], 1464 + "columnsTo": [ 1465 + "xata_id" 1466 + ], 1467 + "onDelete": "no action", 1468 + "onUpdate": "no action" 1469 + }, 1470 + "google_drive_user_id_users_xata_id_fk": { 1471 + "name": "google_drive_user_id_users_xata_id_fk", 1472 + "tableFrom": "google_drive", 1473 + "tableTo": "users", 1474 + "columnsFrom": [ 1475 + "user_id" 1476 + ], 1477 + "columnsTo": [ 1478 + "xata_id" 1479 + ], 1480 + "onDelete": "no action", 1481 + "onUpdate": "no action" 1482 + } 1483 + }, 1484 + "compositePrimaryKeys": {}, 1485 + "uniqueConstraints": {}, 1486 + "policies": {}, 1487 + "checkConstraints": {}, 1488 + "isRLSEnabled": false 1489 + }, 1490 + "public.loved_tracks": { 1491 + "name": "loved_tracks", 1492 + "schema": "", 1493 + "columns": { 1494 + "xata_id": { 1495 + "name": "xata_id", 1496 + "type": "text", 1497 + "primaryKey": true, 1498 + "notNull": true, 1499 + "default": "xata_id()" 1500 + }, 1501 + "user_id": { 1502 + "name": "user_id", 1503 + "type": "text", 1504 + "primaryKey": false, 1505 + "notNull": true 1506 + }, 1507 + "track_id": { 1508 + "name": "track_id", 1509 + "type": "text", 1510 + "primaryKey": false, 1511 + "notNull": true 1512 + }, 1513 + "uri": { 1514 + "name": "uri", 1515 + "type": "text", 1516 + "primaryKey": false, 1517 + "notNull": false 1518 + }, 1519 + "xata_createdat": { 1520 + "name": "xata_createdat", 1521 + "type": "timestamp", 1522 + "primaryKey": false, 1523 + "notNull": true, 1524 + "default": "now()" 1525 + } 1526 + }, 1527 + "indexes": {}, 1528 + "foreignKeys": { 1529 + "loved_tracks_user_id_users_xata_id_fk": { 1530 + "name": "loved_tracks_user_id_users_xata_id_fk", 1531 + "tableFrom": "loved_tracks", 1532 + "tableTo": "users", 1533 + "columnsFrom": [ 1534 + "user_id" 1535 + ], 1536 + "columnsTo": [ 1537 + "xata_id" 1538 + ], 1539 + "onDelete": "no action", 1540 + "onUpdate": "no action" 1541 + }, 1542 + "loved_tracks_track_id_tracks_xata_id_fk": { 1543 + "name": "loved_tracks_track_id_tracks_xata_id_fk", 1544 + "tableFrom": "loved_tracks", 1545 + "tableTo": "tracks", 1546 + "columnsFrom": [ 1547 + "track_id" 1548 + ], 1549 + "columnsTo": [ 1550 + "xata_id" 1551 + ], 1552 + "onDelete": "no action", 1553 + "onUpdate": "no action" 1554 + } 1555 + }, 1556 + "compositePrimaryKeys": {}, 1557 + "uniqueConstraints": { 1558 + "loved_tracks_uri_unique": { 1559 + "name": "loved_tracks_uri_unique", 1560 + "nullsNotDistinct": false, 1561 + "columns": [ 1562 + "uri" 1563 + ] 1564 + } 1565 + }, 1566 + "policies": {}, 1567 + "checkConstraints": {}, 1568 + "isRLSEnabled": false 1569 + }, 1570 + "public.playlist_tracks": { 1571 + "name": "playlist_tracks", 1572 + "schema": "", 1573 + "columns": { 1574 + "xata_id": { 1575 + "name": "xata_id", 1576 + "type": "text", 1577 + "primaryKey": true, 1578 + "notNull": true, 1579 + "default": "xata_id()" 1580 + }, 1581 + "playlist_id": { 1582 + "name": "playlist_id", 1583 + "type": "text", 1584 + "primaryKey": false, 1585 + "notNull": true 1586 + }, 1587 + "track_id": { 1588 + "name": "track_id", 1589 + "type": "text", 1590 + "primaryKey": false, 1591 + "notNull": true 1592 + }, 1593 + "xata_createdat": { 1594 + "name": "xata_createdat", 1595 + "type": "timestamp", 1596 + "primaryKey": false, 1597 + "notNull": true, 1598 + "default": "now()" 1599 + } 1600 + }, 1601 + "indexes": {}, 1602 + "foreignKeys": { 1603 + "playlist_tracks_playlist_id_playlists_xata_id_fk": { 1604 + "name": "playlist_tracks_playlist_id_playlists_xata_id_fk", 1605 + "tableFrom": "playlist_tracks", 1606 + "tableTo": "playlists", 1607 + "columnsFrom": [ 1608 + "playlist_id" 1609 + ], 1610 + "columnsTo": [ 1611 + "xata_id" 1612 + ], 1613 + "onDelete": "no action", 1614 + "onUpdate": "no action" 1615 + }, 1616 + "playlist_tracks_track_id_tracks_xata_id_fk": { 1617 + "name": "playlist_tracks_track_id_tracks_xata_id_fk", 1618 + "tableFrom": "playlist_tracks", 1619 + "tableTo": "tracks", 1620 + "columnsFrom": [ 1621 + "track_id" 1622 + ], 1623 + "columnsTo": [ 1624 + "xata_id" 1625 + ], 1626 + "onDelete": "no action", 1627 + "onUpdate": "no action" 1628 + } 1629 + }, 1630 + "compositePrimaryKeys": {}, 1631 + "uniqueConstraints": {}, 1632 + "policies": {}, 1633 + "checkConstraints": {}, 1634 + "isRLSEnabled": false 1635 + }, 1636 + "public.playlists": { 1637 + "name": "playlists", 1638 + "schema": "", 1639 + "columns": { 1640 + "xata_id": { 1641 + "name": "xata_id", 1642 + "type": "text", 1643 + "primaryKey": true, 1644 + "notNull": true, 1645 + "default": "xata_id()" 1646 + }, 1647 + "name": { 1648 + "name": "name", 1649 + "type": "text", 1650 + "primaryKey": false, 1651 + "notNull": true 1652 + }, 1653 + "picture": { 1654 + "name": "picture", 1655 + "type": "text", 1656 + "primaryKey": false, 1657 + "notNull": false 1658 + }, 1659 + "description": { 1660 + "name": "description", 1661 + "type": "text", 1662 + "primaryKey": false, 1663 + "notNull": false 1664 + }, 1665 + "uri": { 1666 + "name": "uri", 1667 + "type": "text", 1668 + "primaryKey": false, 1669 + "notNull": false 1670 + }, 1671 + "spotify_link": { 1672 + "name": "spotify_link", 1673 + "type": "text", 1674 + "primaryKey": false, 1675 + "notNull": false 1676 + }, 1677 + "tidal_link": { 1678 + "name": "tidal_link", 1679 + "type": "text", 1680 + "primaryKey": false, 1681 + "notNull": false 1682 + }, 1683 + "apple_music_link": { 1684 + "name": "apple_music_link", 1685 + "type": "text", 1686 + "primaryKey": false, 1687 + "notNull": false 1688 + }, 1689 + "created_by": { 1690 + "name": "created_by", 1691 + "type": "text", 1692 + "primaryKey": false, 1693 + "notNull": true 1694 + }, 1695 + "xata_createdat": { 1696 + "name": "xata_createdat", 1697 + "type": "timestamp", 1698 + "primaryKey": false, 1699 + "notNull": true, 1700 + "default": "now()" 1701 + }, 1702 + "xata_updatedat": { 1703 + "name": "xata_updatedat", 1704 + "type": "timestamp", 1705 + "primaryKey": false, 1706 + "notNull": true, 1707 + "default": "now()" 1708 + } 1709 + }, 1710 + "indexes": {}, 1711 + "foreignKeys": { 1712 + "playlists_created_by_users_xata_id_fk": { 1713 + "name": "playlists_created_by_users_xata_id_fk", 1714 + "tableFrom": "playlists", 1715 + "tableTo": "users", 1716 + "columnsFrom": [ 1717 + "created_by" 1718 + ], 1719 + "columnsTo": [ 1720 + "xata_id" 1721 + ], 1722 + "onDelete": "no action", 1723 + "onUpdate": "no action" 1724 + } 1725 + }, 1726 + "compositePrimaryKeys": {}, 1727 + "uniqueConstraints": { 1728 + "playlists_uri_unique": { 1729 + "name": "playlists_uri_unique", 1730 + "nullsNotDistinct": false, 1731 + "columns": [ 1732 + "uri" 1733 + ] 1734 + } 1735 + }, 1736 + "policies": {}, 1737 + "checkConstraints": {}, 1738 + "isRLSEnabled": false 1739 + }, 1740 + "public.profile_shouts": { 1741 + "name": "profile_shouts", 1742 + "schema": "", 1743 + "columns": { 1744 + "xata_id": { 1745 + "name": "xata_id", 1746 + "type": "text", 1747 + "primaryKey": true, 1748 + "notNull": true, 1749 + "default": "xata_id()" 1750 + }, 1751 + "user_id": { 1752 + "name": "user_id", 1753 + "type": "text", 1754 + "primaryKey": false, 1755 + "notNull": true 1756 + }, 1757 + "shout_id": { 1758 + "name": "shout_id", 1759 + "type": "text", 1760 + "primaryKey": false, 1761 + "notNull": true 1762 + }, 1763 + "xata_createdat": { 1764 + "name": "xata_createdat", 1765 + "type": "timestamp", 1766 + "primaryKey": false, 1767 + "notNull": true, 1768 + "default": "now()" 1769 + } 1770 + }, 1771 + "indexes": {}, 1772 + "foreignKeys": { 1773 + "profile_shouts_user_id_users_xata_id_fk": { 1774 + "name": "profile_shouts_user_id_users_xata_id_fk", 1775 + "tableFrom": "profile_shouts", 1776 + "tableTo": "users", 1777 + "columnsFrom": [ 1778 + "user_id" 1779 + ], 1780 + "columnsTo": [ 1781 + "xata_id" 1782 + ], 1783 + "onDelete": "no action", 1784 + "onUpdate": "no action" 1785 + }, 1786 + "profile_shouts_shout_id_shouts_xata_id_fk": { 1787 + "name": "profile_shouts_shout_id_shouts_xata_id_fk", 1788 + "tableFrom": "profile_shouts", 1789 + "tableTo": "shouts", 1790 + "columnsFrom": [ 1791 + "shout_id" 1792 + ], 1793 + "columnsTo": [ 1794 + "xata_id" 1795 + ], 1796 + "onDelete": "no action", 1797 + "onUpdate": "no action" 1798 + } 1799 + }, 1800 + "compositePrimaryKeys": {}, 1801 + "uniqueConstraints": {}, 1802 + "policies": {}, 1803 + "checkConstraints": {}, 1804 + "isRLSEnabled": false 1805 + }, 1806 + "public.queue_tracks": { 1807 + "name": "queue_tracks", 1808 + "schema": "", 1809 + "columns": { 1810 + "xata_id": { 1811 + "name": "xata_id", 1812 + "type": "text", 1813 + "primaryKey": true, 1814 + "notNull": true, 1815 + "default": "xata_id()" 1816 + }, 1817 + "user_id": { 1818 + "name": "user_id", 1819 + "type": "text", 1820 + "primaryKey": false, 1821 + "notNull": true 1822 + }, 1823 + "track_id": { 1824 + "name": "track_id", 1825 + "type": "text", 1826 + "primaryKey": false, 1827 + "notNull": true 1828 + }, 1829 + "position": { 1830 + "name": "position", 1831 + "type": "integer", 1832 + "primaryKey": false, 1833 + "notNull": true 1834 + }, 1835 + "file_uri": { 1836 + "name": "file_uri", 1837 + "type": "text", 1838 + "primaryKey": false, 1839 + "notNull": true 1840 + }, 1841 + "xata_version": { 1842 + "name": "xata_version", 1843 + "type": "integer", 1844 + "primaryKey": false, 1845 + "notNull": true, 1846 + "default": 0 1847 + }, 1848 + "xata_createdat": { 1849 + "name": "xata_createdat", 1850 + "type": "timestamp", 1851 + "primaryKey": false, 1852 + "notNull": true, 1853 + "default": "now()" 1854 + }, 1855 + "xata_updatedat": { 1856 + "name": "xata_updatedat", 1857 + "type": "timestamp", 1858 + "primaryKey": false, 1859 + "notNull": true, 1860 + "default": "now()" 1861 + } 1862 + }, 1863 + "indexes": {}, 1864 + "foreignKeys": { 1865 + "queue_tracks_user_id_users_xata_id_fk": { 1866 + "name": "queue_tracks_user_id_users_xata_id_fk", 1867 + "tableFrom": "queue_tracks", 1868 + "tableTo": "users", 1869 + "columnsFrom": [ 1870 + "user_id" 1871 + ], 1872 + "columnsTo": [ 1873 + "xata_id" 1874 + ], 1875 + "onDelete": "no action", 1876 + "onUpdate": "no action" 1877 + }, 1878 + "queue_tracks_track_id_tracks_xata_id_fk": { 1879 + "name": "queue_tracks_track_id_tracks_xata_id_fk", 1880 + "tableFrom": "queue_tracks", 1881 + "tableTo": "tracks", 1882 + "columnsFrom": [ 1883 + "track_id" 1884 + ], 1885 + "columnsTo": [ 1886 + "xata_id" 1887 + ], 1888 + "onDelete": "no action", 1889 + "onUpdate": "no action" 1890 + } 1891 + }, 1892 + "compositePrimaryKeys": {}, 1893 + "uniqueConstraints": {}, 1894 + "policies": {}, 1895 + "checkConstraints": {}, 1896 + "isRLSEnabled": false 1897 + }, 1898 + "public.scrobbles": { 1899 + "name": "scrobbles", 1900 + "schema": "", 1901 + "columns": { 1902 + "xata_id": { 1903 + "name": "xata_id", 1904 + "type": "text", 1905 + "primaryKey": true, 1906 + "notNull": true, 1907 + "default": "xata_id()" 1908 + }, 1909 + "user_id": { 1910 + "name": "user_id", 1911 + "type": "text", 1912 + "primaryKey": false, 1913 + "notNull": false 1914 + }, 1915 + "track_id": { 1916 + "name": "track_id", 1917 + "type": "text", 1918 + "primaryKey": false, 1919 + "notNull": false 1920 + }, 1921 + "album_id": { 1922 + "name": "album_id", 1923 + "type": "text", 1924 + "primaryKey": false, 1925 + "notNull": false 1926 + }, 1927 + "artist_id": { 1928 + "name": "artist_id", 1929 + "type": "text", 1930 + "primaryKey": false, 1931 + "notNull": false 1932 + }, 1933 + "uri": { 1934 + "name": "uri", 1935 + "type": "text", 1936 + "primaryKey": false, 1937 + "notNull": false 1938 + }, 1939 + "xata_createdat": { 1940 + "name": "xata_createdat", 1941 + "type": "timestamp", 1942 + "primaryKey": false, 1943 + "notNull": true, 1944 + "default": "now()" 1945 + }, 1946 + "xata_updatedat": { 1947 + "name": "xata_updatedat", 1948 + "type": "timestamp", 1949 + "primaryKey": false, 1950 + "notNull": true, 1951 + "default": "now()" 1952 + }, 1953 + "xata_version": { 1954 + "name": "xata_version", 1955 + "type": "integer", 1956 + "primaryKey": false, 1957 + "notNull": false 1958 + }, 1959 + "timestamp": { 1960 + "name": "timestamp", 1961 + "type": "timestamp", 1962 + "primaryKey": false, 1963 + "notNull": true, 1964 + "default": "now()" 1965 + } 1966 + }, 1967 + "indexes": {}, 1968 + "foreignKeys": { 1969 + "scrobbles_user_id_users_xata_id_fk": { 1970 + "name": "scrobbles_user_id_users_xata_id_fk", 1971 + "tableFrom": "scrobbles", 1972 + "tableTo": "users", 1973 + "columnsFrom": [ 1974 + "user_id" 1975 + ], 1976 + "columnsTo": [ 1977 + "xata_id" 1978 + ], 1979 + "onDelete": "no action", 1980 + "onUpdate": "no action" 1981 + }, 1982 + "scrobbles_track_id_tracks_xata_id_fk": { 1983 + "name": "scrobbles_track_id_tracks_xata_id_fk", 1984 + "tableFrom": "scrobbles", 1985 + "tableTo": "tracks", 1986 + "columnsFrom": [ 1987 + "track_id" 1988 + ], 1989 + "columnsTo": [ 1990 + "xata_id" 1991 + ], 1992 + "onDelete": "no action", 1993 + "onUpdate": "no action" 1994 + }, 1995 + "scrobbles_album_id_albums_xata_id_fk": { 1996 + "name": "scrobbles_album_id_albums_xata_id_fk", 1997 + "tableFrom": "scrobbles", 1998 + "tableTo": "albums", 1999 + "columnsFrom": [ 2000 + "album_id" 2001 + ], 2002 + "columnsTo": [ 2003 + "xata_id" 2004 + ], 2005 + "onDelete": "no action", 2006 + "onUpdate": "no action" 2007 + }, 2008 + "scrobbles_artist_id_artists_xata_id_fk": { 2009 + "name": "scrobbles_artist_id_artists_xata_id_fk", 2010 + "tableFrom": "scrobbles", 2011 + "tableTo": "artists", 2012 + "columnsFrom": [ 2013 + "artist_id" 2014 + ], 2015 + "columnsTo": [ 2016 + "xata_id" 2017 + ], 2018 + "onDelete": "no action", 2019 + "onUpdate": "no action" 2020 + } 2021 + }, 2022 + "compositePrimaryKeys": {}, 2023 + "uniqueConstraints": { 2024 + "scrobbles_uri_unique": { 2025 + "name": "scrobbles_uri_unique", 2026 + "nullsNotDistinct": false, 2027 + "columns": [ 2028 + "uri" 2029 + ] 2030 + } 2031 + }, 2032 + "policies": {}, 2033 + "checkConstraints": {}, 2034 + "isRLSEnabled": false 2035 + }, 2036 + "public.shout_likes": { 2037 + "name": "shout_likes", 2038 + "schema": "", 2039 + "columns": { 2040 + "xata_id": { 2041 + "name": "xata_id", 2042 + "type": "text", 2043 + "primaryKey": true, 2044 + "notNull": true, 2045 + "default": "xata_id()" 2046 + }, 2047 + "user_id": { 2048 + "name": "user_id", 2049 + "type": "text", 2050 + "primaryKey": false, 2051 + "notNull": true 2052 + }, 2053 + "shout_id": { 2054 + "name": "shout_id", 2055 + "type": "text", 2056 + "primaryKey": false, 2057 + "notNull": true 2058 + }, 2059 + "xata_createdat": { 2060 + "name": "xata_createdat", 2061 + "type": "timestamp", 2062 + "primaryKey": false, 2063 + "notNull": true, 2064 + "default": "now()" 2065 + }, 2066 + "uri": { 2067 + "name": "uri", 2068 + "type": "text", 2069 + "primaryKey": false, 2070 + "notNull": true 2071 + } 2072 + }, 2073 + "indexes": {}, 2074 + "foreignKeys": { 2075 + "shout_likes_user_id_users_xata_id_fk": { 2076 + "name": "shout_likes_user_id_users_xata_id_fk", 2077 + "tableFrom": "shout_likes", 2078 + "tableTo": "users", 2079 + "columnsFrom": [ 2080 + "user_id" 2081 + ], 2082 + "columnsTo": [ 2083 + "xata_id" 2084 + ], 2085 + "onDelete": "no action", 2086 + "onUpdate": "no action" 2087 + }, 2088 + "shout_likes_shout_id_shouts_xata_id_fk": { 2089 + "name": "shout_likes_shout_id_shouts_xata_id_fk", 2090 + "tableFrom": "shout_likes", 2091 + "tableTo": "shouts", 2092 + "columnsFrom": [ 2093 + "shout_id" 2094 + ], 2095 + "columnsTo": [ 2096 + "xata_id" 2097 + ], 2098 + "onDelete": "no action", 2099 + "onUpdate": "no action" 2100 + } 2101 + }, 2102 + "compositePrimaryKeys": {}, 2103 + "uniqueConstraints": { 2104 + "shout_likes_uri_unique": { 2105 + "name": "shout_likes_uri_unique", 2106 + "nullsNotDistinct": false, 2107 + "columns": [ 2108 + "uri" 2109 + ] 2110 + } 2111 + }, 2112 + "policies": {}, 2113 + "checkConstraints": {}, 2114 + "isRLSEnabled": false 2115 + }, 2116 + "public.shout_reports": { 2117 + "name": "shout_reports", 2118 + "schema": "", 2119 + "columns": { 2120 + "xata_id": { 2121 + "name": "xata_id", 2122 + "type": "text", 2123 + "primaryKey": true, 2124 + "notNull": true, 2125 + "default": "xata_id()" 2126 + }, 2127 + "user_id": { 2128 + "name": "user_id", 2129 + "type": "text", 2130 + "primaryKey": false, 2131 + "notNull": true 2132 + }, 2133 + "shout_id": { 2134 + "name": "shout_id", 2135 + "type": "text", 2136 + "primaryKey": false, 2137 + "notNull": true 2138 + }, 2139 + "xata_createdat": { 2140 + "name": "xata_createdat", 2141 + "type": "timestamp", 2142 + "primaryKey": false, 2143 + "notNull": true, 2144 + "default": "now()" 2145 + } 2146 + }, 2147 + "indexes": {}, 2148 + "foreignKeys": { 2149 + "shout_reports_user_id_users_xata_id_fk": { 2150 + "name": "shout_reports_user_id_users_xata_id_fk", 2151 + "tableFrom": "shout_reports", 2152 + "tableTo": "users", 2153 + "columnsFrom": [ 2154 + "user_id" 2155 + ], 2156 + "columnsTo": [ 2157 + "xata_id" 2158 + ], 2159 + "onDelete": "no action", 2160 + "onUpdate": "no action" 2161 + }, 2162 + "shout_reports_shout_id_shouts_xata_id_fk": { 2163 + "name": "shout_reports_shout_id_shouts_xata_id_fk", 2164 + "tableFrom": "shout_reports", 2165 + "tableTo": "shouts", 2166 + "columnsFrom": [ 2167 + "shout_id" 2168 + ], 2169 + "columnsTo": [ 2170 + "xata_id" 2171 + ], 2172 + "onDelete": "no action", 2173 + "onUpdate": "no action" 2174 + } 2175 + }, 2176 + "compositePrimaryKeys": {}, 2177 + "uniqueConstraints": {}, 2178 + "policies": {}, 2179 + "checkConstraints": {}, 2180 + "isRLSEnabled": false 2181 + }, 2182 + "public.shouts": { 2183 + "name": "shouts", 2184 + "schema": "", 2185 + "columns": { 2186 + "xata_id": { 2187 + "name": "xata_id", 2188 + "type": "text", 2189 + "primaryKey": true, 2190 + "notNull": true, 2191 + "default": "xata_id()" 2192 + }, 2193 + "content": { 2194 + "name": "content", 2195 + "type": "text", 2196 + "primaryKey": false, 2197 + "notNull": true 2198 + }, 2199 + "track_id": { 2200 + "name": "track_id", 2201 + "type": "text", 2202 + "primaryKey": false, 2203 + "notNull": false 2204 + }, 2205 + "artist_id": { 2206 + "name": "artist_id", 2207 + "type": "text", 2208 + "primaryKey": false, 2209 + "notNull": false 2210 + }, 2211 + "album_id": { 2212 + "name": "album_id", 2213 + "type": "text", 2214 + "primaryKey": false, 2215 + "notNull": false 2216 + }, 2217 + "scrobble_id": { 2218 + "name": "scrobble_id", 2219 + "type": "text", 2220 + "primaryKey": false, 2221 + "notNull": false 2222 + }, 2223 + "uri": { 2224 + "name": "uri", 2225 + "type": "text", 2226 + "primaryKey": false, 2227 + "notNull": true 2228 + }, 2229 + "author_id": { 2230 + "name": "author_id", 2231 + "type": "text", 2232 + "primaryKey": false, 2233 + "notNull": true 2234 + }, 2235 + "parent_id": { 2236 + "name": "parent_id", 2237 + "type": "text", 2238 + "primaryKey": false, 2239 + "notNull": false 2240 + }, 2241 + "xata_createdat": { 2242 + "name": "xata_createdat", 2243 + "type": "timestamp", 2244 + "primaryKey": false, 2245 + "notNull": true, 2246 + "default": "now()" 2247 + }, 2248 + "xata_updatedat": { 2249 + "name": "xata_updatedat", 2250 + "type": "timestamp", 2251 + "primaryKey": false, 2252 + "notNull": true, 2253 + "default": "now()" 2254 + } 2255 + }, 2256 + "indexes": {}, 2257 + "foreignKeys": { 2258 + "shouts_track_id_tracks_xata_id_fk": { 2259 + "name": "shouts_track_id_tracks_xata_id_fk", 2260 + "tableFrom": "shouts", 2261 + "tableTo": "tracks", 2262 + "columnsFrom": [ 2263 + "track_id" 2264 + ], 2265 + "columnsTo": [ 2266 + "xata_id" 2267 + ], 2268 + "onDelete": "no action", 2269 + "onUpdate": "no action" 2270 + }, 2271 + "shouts_artist_id_users_xata_id_fk": { 2272 + "name": "shouts_artist_id_users_xata_id_fk", 2273 + "tableFrom": "shouts", 2274 + "tableTo": "users", 2275 + "columnsFrom": [ 2276 + "artist_id" 2277 + ], 2278 + "columnsTo": [ 2279 + "xata_id" 2280 + ], 2281 + "onDelete": "no action", 2282 + "onUpdate": "no action" 2283 + }, 2284 + "shouts_album_id_albums_xata_id_fk": { 2285 + "name": "shouts_album_id_albums_xata_id_fk", 2286 + "tableFrom": "shouts", 2287 + "tableTo": "albums", 2288 + "columnsFrom": [ 2289 + "album_id" 2290 + ], 2291 + "columnsTo": [ 2292 + "xata_id" 2293 + ], 2294 + "onDelete": "no action", 2295 + "onUpdate": "no action" 2296 + }, 2297 + "shouts_scrobble_id_scrobbles_xata_id_fk": { 2298 + "name": "shouts_scrobble_id_scrobbles_xata_id_fk", 2299 + "tableFrom": "shouts", 2300 + "tableTo": "scrobbles", 2301 + "columnsFrom": [ 2302 + "scrobble_id" 2303 + ], 2304 + "columnsTo": [ 2305 + "xata_id" 2306 + ], 2307 + "onDelete": "no action", 2308 + "onUpdate": "no action" 2309 + }, 2310 + "shouts_author_id_users_xata_id_fk": { 2311 + "name": "shouts_author_id_users_xata_id_fk", 2312 + "tableFrom": "shouts", 2313 + "tableTo": "users", 2314 + "columnsFrom": [ 2315 + "author_id" 2316 + ], 2317 + "columnsTo": [ 2318 + "xata_id" 2319 + ], 2320 + "onDelete": "no action", 2321 + "onUpdate": "no action" 2322 + }, 2323 + "shouts_parent_id_shouts_xata_id_fk": { 2324 + "name": "shouts_parent_id_shouts_xata_id_fk", 2325 + "tableFrom": "shouts", 2326 + "tableTo": "shouts", 2327 + "columnsFrom": [ 2328 + "parent_id" 2329 + ], 2330 + "columnsTo": [ 2331 + "xata_id" 2332 + ], 2333 + "onDelete": "no action", 2334 + "onUpdate": "no action" 2335 + } 2336 + }, 2337 + "compositePrimaryKeys": {}, 2338 + "uniqueConstraints": { 2339 + "shouts_uri_unique": { 2340 + "name": "shouts_uri_unique", 2341 + "nullsNotDistinct": false, 2342 + "columns": [ 2343 + "uri" 2344 + ] 2345 + } 2346 + }, 2347 + "policies": {}, 2348 + "checkConstraints": {}, 2349 + "isRLSEnabled": false 2350 + }, 2351 + "public.spotify_accounts": { 2352 + "name": "spotify_accounts", 2353 + "schema": "", 2354 + "columns": { 2355 + "xata_id": { 2356 + "name": "xata_id", 2357 + "type": "text", 2358 + "primaryKey": true, 2359 + "notNull": true, 2360 + "default": "xata_id()" 2361 + }, 2362 + "xata_version": { 2363 + "name": "xata_version", 2364 + "type": "integer", 2365 + "primaryKey": false, 2366 + "notNull": false 2367 + }, 2368 + "email": { 2369 + "name": "email", 2370 + "type": "text", 2371 + "primaryKey": false, 2372 + "notNull": true 2373 + }, 2374 + "user_id": { 2375 + "name": "user_id", 2376 + "type": "text", 2377 + "primaryKey": false, 2378 + "notNull": true 2379 + }, 2380 + "is_beta_user": { 2381 + "name": "is_beta_user", 2382 + "type": "boolean", 2383 + "primaryKey": false, 2384 + "notNull": true, 2385 + "default": false 2386 + }, 2387 + "xata_createdat": { 2388 + "name": "xata_createdat", 2389 + "type": "timestamp", 2390 + "primaryKey": false, 2391 + "notNull": true, 2392 + "default": "now()" 2393 + }, 2394 + "xata_updatedat": { 2395 + "name": "xata_updatedat", 2396 + "type": "timestamp", 2397 + "primaryKey": false, 2398 + "notNull": true, 2399 + "default": "now()" 2400 + } 2401 + }, 2402 + "indexes": {}, 2403 + "foreignKeys": { 2404 + "spotify_accounts_user_id_users_xata_id_fk": { 2405 + "name": "spotify_accounts_user_id_users_xata_id_fk", 2406 + "tableFrom": "spotify_accounts", 2407 + "tableTo": "users", 2408 + "columnsFrom": [ 2409 + "user_id" 2410 + ], 2411 + "columnsTo": [ 2412 + "xata_id" 2413 + ], 2414 + "onDelete": "no action", 2415 + "onUpdate": "no action" 2416 + } 2417 + }, 2418 + "compositePrimaryKeys": {}, 2419 + "uniqueConstraints": {}, 2420 + "policies": {}, 2421 + "checkConstraints": {}, 2422 + "isRLSEnabled": false 2423 + }, 2424 + "public.spotify_tokens": { 2425 + "name": "spotify_tokens", 2426 + "schema": "", 2427 + "columns": { 2428 + "xata_id": { 2429 + "name": "xata_id", 2430 + "type": "text", 2431 + "primaryKey": true, 2432 + "notNull": true, 2433 + "default": "xata_id()" 2434 + }, 2435 + "xata_version": { 2436 + "name": "xata_version", 2437 + "type": "integer", 2438 + "primaryKey": false, 2439 + "notNull": false 2440 + }, 2441 + "access_token": { 2442 + "name": "access_token", 2443 + "type": "text", 2444 + "primaryKey": false, 2445 + "notNull": true 2446 + }, 2447 + "refresh_token": { 2448 + "name": "refresh_token", 2449 + "type": "text", 2450 + "primaryKey": false, 2451 + "notNull": true 2452 + }, 2453 + "user_id": { 2454 + "name": "user_id", 2455 + "type": "text", 2456 + "primaryKey": false, 2457 + "notNull": true 2458 + }, 2459 + "xata_createdat": { 2460 + "name": "xata_createdat", 2461 + "type": "timestamp", 2462 + "primaryKey": false, 2463 + "notNull": true, 2464 + "default": "now()" 2465 + }, 2466 + "xata_updatedat": { 2467 + "name": "xata_updatedat", 2468 + "type": "timestamp", 2469 + "primaryKey": false, 2470 + "notNull": true, 2471 + "default": "now()" 2472 + } 2473 + }, 2474 + "indexes": {}, 2475 + "foreignKeys": { 2476 + "spotify_tokens_user_id_users_xata_id_fk": { 2477 + "name": "spotify_tokens_user_id_users_xata_id_fk", 2478 + "tableFrom": "spotify_tokens", 2479 + "tableTo": "users", 2480 + "columnsFrom": [ 2481 + "user_id" 2482 + ], 2483 + "columnsTo": [ 2484 + "xata_id" 2485 + ], 2486 + "onDelete": "no action", 2487 + "onUpdate": "no action" 2488 + } 2489 + }, 2490 + "compositePrimaryKeys": {}, 2491 + "uniqueConstraints": {}, 2492 + "policies": {}, 2493 + "checkConstraints": {}, 2494 + "isRLSEnabled": false 2495 + }, 2496 + "public.tracks": { 2497 + "name": "tracks", 2498 + "schema": "", 2499 + "columns": { 2500 + "xata_id": { 2501 + "name": "xata_id", 2502 + "type": "text", 2503 + "primaryKey": true, 2504 + "notNull": true, 2505 + "default": "xata_id()" 2506 + }, 2507 + "title": { 2508 + "name": "title", 2509 + "type": "text", 2510 + "primaryKey": false, 2511 + "notNull": true 2512 + }, 2513 + "artist": { 2514 + "name": "artist", 2515 + "type": "text", 2516 + "primaryKey": false, 2517 + "notNull": true 2518 + }, 2519 + "album_artist": { 2520 + "name": "album_artist", 2521 + "type": "text", 2522 + "primaryKey": false, 2523 + "notNull": true 2524 + }, 2525 + "album_art": { 2526 + "name": "album_art", 2527 + "type": "text", 2528 + "primaryKey": false, 2529 + "notNull": false 2530 + }, 2531 + "album": { 2532 + "name": "album", 2533 + "type": "text", 2534 + "primaryKey": false, 2535 + "notNull": true 2536 + }, 2537 + "track_number": { 2538 + "name": "track_number", 2539 + "type": "integer", 2540 + "primaryKey": false, 2541 + "notNull": false 2542 + }, 2543 + "duration": { 2544 + "name": "duration", 2545 + "type": "integer", 2546 + "primaryKey": false, 2547 + "notNull": true 2548 + }, 2549 + "mb_id": { 2550 + "name": "mb_id", 2551 + "type": "text", 2552 + "primaryKey": false, 2553 + "notNull": false 2554 + }, 2555 + "youtube_link": { 2556 + "name": "youtube_link", 2557 + "type": "text", 2558 + "primaryKey": false, 2559 + "notNull": false 2560 + }, 2561 + "spotify_link": { 2562 + "name": "spotify_link", 2563 + "type": "text", 2564 + "primaryKey": false, 2565 + "notNull": false 2566 + }, 2567 + "apple_music_link": { 2568 + "name": "apple_music_link", 2569 + "type": "text", 2570 + "primaryKey": false, 2571 + "notNull": false 2572 + }, 2573 + "tidal_link": { 2574 + "name": "tidal_link", 2575 + "type": "text", 2576 + "primaryKey": false, 2577 + "notNull": false 2578 + }, 2579 + "sha256": { 2580 + "name": "sha256", 2581 + "type": "text", 2582 + "primaryKey": false, 2583 + "notNull": true 2584 + }, 2585 + "disc_number": { 2586 + "name": "disc_number", 2587 + "type": "integer", 2588 + "primaryKey": false, 2589 + "notNull": false 2590 + }, 2591 + "lyrics": { 2592 + "name": "lyrics", 2593 + "type": "text", 2594 + "primaryKey": false, 2595 + "notNull": false 2596 + }, 2597 + "composer": { 2598 + "name": "composer", 2599 + "type": "text", 2600 + "primaryKey": false, 2601 + "notNull": false 2602 + }, 2603 + "genre": { 2604 + "name": "genre", 2605 + "type": "text", 2606 + "primaryKey": false, 2607 + "notNull": false 2608 + }, 2609 + "label": { 2610 + "name": "label", 2611 + "type": "text", 2612 + "primaryKey": false, 2613 + "notNull": false 2614 + }, 2615 + "copyright_message": { 2616 + "name": "copyright_message", 2617 + "type": "text", 2618 + "primaryKey": false, 2619 + "notNull": false 2620 + }, 2621 + "uri": { 2622 + "name": "uri", 2623 + "type": "text", 2624 + "primaryKey": false, 2625 + "notNull": false 2626 + }, 2627 + "album_uri": { 2628 + "name": "album_uri", 2629 + "type": "text", 2630 + "primaryKey": false, 2631 + "notNull": false 2632 + }, 2633 + "artist_uri": { 2634 + "name": "artist_uri", 2635 + "type": "text", 2636 + "primaryKey": false, 2637 + "notNull": false 2638 + }, 2639 + "xata_createdat": { 2640 + "name": "xata_createdat", 2641 + "type": "timestamp", 2642 + "primaryKey": false, 2643 + "notNull": true, 2644 + "default": "now()" 2645 + }, 2646 + "xata_updatedat": { 2647 + "name": "xata_updatedat", 2648 + "type": "timestamp", 2649 + "primaryKey": false, 2650 + "notNull": true, 2651 + "default": "now()" 2652 + }, 2653 + "xata_version": { 2654 + "name": "xata_version", 2655 + "type": "integer", 2656 + "primaryKey": false, 2657 + "notNull": false 2658 + } 2659 + }, 2660 + "indexes": {}, 2661 + "foreignKeys": {}, 2662 + "compositePrimaryKeys": {}, 2663 + "uniqueConstraints": { 2664 + "tracks_mb_id_unique": { 2665 + "name": "tracks_mb_id_unique", 2666 + "nullsNotDistinct": false, 2667 + "columns": [ 2668 + "mb_id" 2669 + ] 2670 + }, 2671 + "tracks_youtube_link_unique": { 2672 + "name": "tracks_youtube_link_unique", 2673 + "nullsNotDistinct": false, 2674 + "columns": [ 2675 + "youtube_link" 2676 + ] 2677 + }, 2678 + "tracks_spotify_link_unique": { 2679 + "name": "tracks_spotify_link_unique", 2680 + "nullsNotDistinct": false, 2681 + "columns": [ 2682 + "spotify_link" 2683 + ] 2684 + }, 2685 + "tracks_apple_music_link_unique": { 2686 + "name": "tracks_apple_music_link_unique", 2687 + "nullsNotDistinct": false, 2688 + "columns": [ 2689 + "apple_music_link" 2690 + ] 2691 + }, 2692 + "tracks_tidal_link_unique": { 2693 + "name": "tracks_tidal_link_unique", 2694 + "nullsNotDistinct": false, 2695 + "columns": [ 2696 + "tidal_link" 2697 + ] 2698 + }, 2699 + "tracks_sha256_unique": { 2700 + "name": "tracks_sha256_unique", 2701 + "nullsNotDistinct": false, 2702 + "columns": [ 2703 + "sha256" 2704 + ] 2705 + }, 2706 + "tracks_uri_unique": { 2707 + "name": "tracks_uri_unique", 2708 + "nullsNotDistinct": false, 2709 + "columns": [ 2710 + "uri" 2711 + ] 2712 + } 2713 + }, 2714 + "policies": {}, 2715 + "checkConstraints": {}, 2716 + "isRLSEnabled": false 2717 + }, 2718 + "public.user_albums": { 2719 + "name": "user_albums", 2720 + "schema": "", 2721 + "columns": { 2722 + "xata_id": { 2723 + "name": "xata_id", 2724 + "type": "text", 2725 + "primaryKey": true, 2726 + "notNull": true, 2727 + "default": "xata_id()" 2728 + }, 2729 + "user_id": { 2730 + "name": "user_id", 2731 + "type": "text", 2732 + "primaryKey": false, 2733 + "notNull": true 2734 + }, 2735 + "album_id": { 2736 + "name": "album_id", 2737 + "type": "text", 2738 + "primaryKey": false, 2739 + "notNull": true 2740 + }, 2741 + "xata_createdat": { 2742 + "name": "xata_createdat", 2743 + "type": "timestamp", 2744 + "primaryKey": false, 2745 + "notNull": true, 2746 + "default": "now()" 2747 + }, 2748 + "xata_updatedat": { 2749 + "name": "xata_updatedat", 2750 + "type": "timestamp", 2751 + "primaryKey": false, 2752 + "notNull": true, 2753 + "default": "now()" 2754 + }, 2755 + "xata_version": { 2756 + "name": "xata_version", 2757 + "type": "integer", 2758 + "primaryKey": false, 2759 + "notNull": false 2760 + }, 2761 + "scrobbles": { 2762 + "name": "scrobbles", 2763 + "type": "integer", 2764 + "primaryKey": false, 2765 + "notNull": false 2766 + }, 2767 + "uri": { 2768 + "name": "uri", 2769 + "type": "text", 2770 + "primaryKey": false, 2771 + "notNull": true 2772 + } 2773 + }, 2774 + "indexes": {}, 2775 + "foreignKeys": { 2776 + "user_albums_user_id_users_xata_id_fk": { 2777 + "name": "user_albums_user_id_users_xata_id_fk", 2778 + "tableFrom": "user_albums", 2779 + "tableTo": "users", 2780 + "columnsFrom": [ 2781 + "user_id" 2782 + ], 2783 + "columnsTo": [ 2784 + "xata_id" 2785 + ], 2786 + "onDelete": "no action", 2787 + "onUpdate": "no action" 2788 + }, 2789 + "user_albums_album_id_albums_xata_id_fk": { 2790 + "name": "user_albums_album_id_albums_xata_id_fk", 2791 + "tableFrom": "user_albums", 2792 + "tableTo": "albums", 2793 + "columnsFrom": [ 2794 + "album_id" 2795 + ], 2796 + "columnsTo": [ 2797 + "xata_id" 2798 + ], 2799 + "onDelete": "no action", 2800 + "onUpdate": "no action" 2801 + } 2802 + }, 2803 + "compositePrimaryKeys": {}, 2804 + "uniqueConstraints": { 2805 + "user_albums_uri_unique": { 2806 + "name": "user_albums_uri_unique", 2807 + "nullsNotDistinct": false, 2808 + "columns": [ 2809 + "uri" 2810 + ] 2811 + } 2812 + }, 2813 + "policies": {}, 2814 + "checkConstraints": {}, 2815 + "isRLSEnabled": false 2816 + }, 2817 + "public.user_artists": { 2818 + "name": "user_artists", 2819 + "schema": "", 2820 + "columns": { 2821 + "xata_id": { 2822 + "name": "xata_id", 2823 + "type": "text", 2824 + "primaryKey": true, 2825 + "notNull": true, 2826 + "default": "xata_id()" 2827 + }, 2828 + "user_id": { 2829 + "name": "user_id", 2830 + "type": "text", 2831 + "primaryKey": false, 2832 + "notNull": true 2833 + }, 2834 + "artist_id": { 2835 + "name": "artist_id", 2836 + "type": "text", 2837 + "primaryKey": false, 2838 + "notNull": true 2839 + }, 2840 + "xata_createdat": { 2841 + "name": "xata_createdat", 2842 + "type": "timestamp", 2843 + "primaryKey": false, 2844 + "notNull": true, 2845 + "default": "now()" 2846 + }, 2847 + "xata_updatedat": { 2848 + "name": "xata_updatedat", 2849 + "type": "timestamp", 2850 + "primaryKey": false, 2851 + "notNull": true, 2852 + "default": "now()" 2853 + }, 2854 + "xata_version": { 2855 + "name": "xata_version", 2856 + "type": "integer", 2857 + "primaryKey": false, 2858 + "notNull": false 2859 + }, 2860 + "scrobbles": { 2861 + "name": "scrobbles", 2862 + "type": "integer", 2863 + "primaryKey": false, 2864 + "notNull": false 2865 + }, 2866 + "uri": { 2867 + "name": "uri", 2868 + "type": "text", 2869 + "primaryKey": false, 2870 + "notNull": true 2871 + } 2872 + }, 2873 + "indexes": {}, 2874 + "foreignKeys": { 2875 + "user_artists_user_id_users_xata_id_fk": { 2876 + "name": "user_artists_user_id_users_xata_id_fk", 2877 + "tableFrom": "user_artists", 2878 + "tableTo": "users", 2879 + "columnsFrom": [ 2880 + "user_id" 2881 + ], 2882 + "columnsTo": [ 2883 + "xata_id" 2884 + ], 2885 + "onDelete": "no action", 2886 + "onUpdate": "no action" 2887 + }, 2888 + "user_artists_artist_id_artists_xata_id_fk": { 2889 + "name": "user_artists_artist_id_artists_xata_id_fk", 2890 + "tableFrom": "user_artists", 2891 + "tableTo": "artists", 2892 + "columnsFrom": [ 2893 + "artist_id" 2894 + ], 2895 + "columnsTo": [ 2896 + "xata_id" 2897 + ], 2898 + "onDelete": "no action", 2899 + "onUpdate": "no action" 2900 + } 2901 + }, 2902 + "compositePrimaryKeys": {}, 2903 + "uniqueConstraints": { 2904 + "user_artists_uri_unique": { 2905 + "name": "user_artists_uri_unique", 2906 + "nullsNotDistinct": false, 2907 + "columns": [ 2908 + "uri" 2909 + ] 2910 + } 2911 + }, 2912 + "policies": {}, 2913 + "checkConstraints": {}, 2914 + "isRLSEnabled": false 2915 + }, 2916 + "public.user_playlists": { 2917 + "name": "user_playlists", 2918 + "schema": "", 2919 + "columns": { 2920 + "xata_id": { 2921 + "name": "xata_id", 2922 + "type": "text", 2923 + "primaryKey": true, 2924 + "notNull": true, 2925 + "default": "xata_id()" 2926 + }, 2927 + "user_id": { 2928 + "name": "user_id", 2929 + "type": "text", 2930 + "primaryKey": false, 2931 + "notNull": true 2932 + }, 2933 + "playlist_id": { 2934 + "name": "playlist_id", 2935 + "type": "text", 2936 + "primaryKey": false, 2937 + "notNull": true 2938 + }, 2939 + "xata_createdat": { 2940 + "name": "xata_createdat", 2941 + "type": "timestamp", 2942 + "primaryKey": false, 2943 + "notNull": true, 2944 + "default": "now()" 2945 + }, 2946 + "uri": { 2947 + "name": "uri", 2948 + "type": "text", 2949 + "primaryKey": false, 2950 + "notNull": false 2951 + } 2952 + }, 2953 + "indexes": {}, 2954 + "foreignKeys": { 2955 + "user_playlists_user_id_users_xata_id_fk": { 2956 + "name": "user_playlists_user_id_users_xata_id_fk", 2957 + "tableFrom": "user_playlists", 2958 + "tableTo": "users", 2959 + "columnsFrom": [ 2960 + "user_id" 2961 + ], 2962 + "columnsTo": [ 2963 + "xata_id" 2964 + ], 2965 + "onDelete": "no action", 2966 + "onUpdate": "no action" 2967 + }, 2968 + "user_playlists_playlist_id_playlists_xata_id_fk": { 2969 + "name": "user_playlists_playlist_id_playlists_xata_id_fk", 2970 + "tableFrom": "user_playlists", 2971 + "tableTo": "playlists", 2972 + "columnsFrom": [ 2973 + "playlist_id" 2974 + ], 2975 + "columnsTo": [ 2976 + "xata_id" 2977 + ], 2978 + "onDelete": "no action", 2979 + "onUpdate": "no action" 2980 + } 2981 + }, 2982 + "compositePrimaryKeys": {}, 2983 + "uniqueConstraints": { 2984 + "user_playlists_uri_unique": { 2985 + "name": "user_playlists_uri_unique", 2986 + "nullsNotDistinct": false, 2987 + "columns": [ 2988 + "uri" 2989 + ] 2990 + } 2991 + }, 2992 + "policies": {}, 2993 + "checkConstraints": {}, 2994 + "isRLSEnabled": false 2995 + }, 2996 + "public.user_tracks": { 2997 + "name": "user_tracks", 2998 + "schema": "", 2999 + "columns": { 3000 + "xata_id": { 3001 + "name": "xata_id", 3002 + "type": "text", 3003 + "primaryKey": true, 3004 + "notNull": true, 3005 + "default": "xata_id()" 3006 + }, 3007 + "user_id": { 3008 + "name": "user_id", 3009 + "type": "text", 3010 + "primaryKey": false, 3011 + "notNull": true 3012 + }, 3013 + "track_id": { 3014 + "name": "track_id", 3015 + "type": "text", 3016 + "primaryKey": false, 3017 + "notNull": true 3018 + }, 3019 + "xata_createdat": { 3020 + "name": "xata_createdat", 3021 + "type": "timestamp", 3022 + "primaryKey": false, 3023 + "notNull": true, 3024 + "default": "now()" 3025 + }, 3026 + "xata_updatedat": { 3027 + "name": "xata_updatedat", 3028 + "type": "timestamp", 3029 + "primaryKey": false, 3030 + "notNull": true, 3031 + "default": "now()" 3032 + }, 3033 + "xata_version": { 3034 + "name": "xata_version", 3035 + "type": "integer", 3036 + "primaryKey": false, 3037 + "notNull": false 3038 + }, 3039 + "uri": { 3040 + "name": "uri", 3041 + "type": "text", 3042 + "primaryKey": false, 3043 + "notNull": true 3044 + }, 3045 + "scrobbles": { 3046 + "name": "scrobbles", 3047 + "type": "integer", 3048 + "primaryKey": false, 3049 + "notNull": false 3050 + } 3051 + }, 3052 + "indexes": {}, 3053 + "foreignKeys": { 3054 + "user_tracks_user_id_users_xata_id_fk": { 3055 + "name": "user_tracks_user_id_users_xata_id_fk", 3056 + "tableFrom": "user_tracks", 3057 + "tableTo": "users", 3058 + "columnsFrom": [ 3059 + "user_id" 3060 + ], 3061 + "columnsTo": [ 3062 + "xata_id" 3063 + ], 3064 + "onDelete": "no action", 3065 + "onUpdate": "no action" 3066 + }, 3067 + "user_tracks_track_id_tracks_xata_id_fk": { 3068 + "name": "user_tracks_track_id_tracks_xata_id_fk", 3069 + "tableFrom": "user_tracks", 3070 + "tableTo": "tracks", 3071 + "columnsFrom": [ 3072 + "track_id" 3073 + ], 3074 + "columnsTo": [ 3075 + "xata_id" 3076 + ], 3077 + "onDelete": "no action", 3078 + "onUpdate": "no action" 3079 + } 3080 + }, 3081 + "compositePrimaryKeys": {}, 3082 + "uniqueConstraints": { 3083 + "user_tracks_uri_unique": { 3084 + "name": "user_tracks_uri_unique", 3085 + "nullsNotDistinct": false, 3086 + "columns": [ 3087 + "uri" 3088 + ] 3089 + } 3090 + }, 3091 + "policies": {}, 3092 + "checkConstraints": {}, 3093 + "isRLSEnabled": false 3094 + }, 3095 + "public.users": { 3096 + "name": "users", 3097 + "schema": "", 3098 + "columns": { 3099 + "xata_id": { 3100 + "name": "xata_id", 3101 + "type": "text", 3102 + "primaryKey": true, 3103 + "notNull": true, 3104 + "default": "xata_id()" 3105 + }, 3106 + "did": { 3107 + "name": "did", 3108 + "type": "text", 3109 + "primaryKey": false, 3110 + "notNull": true 3111 + }, 3112 + "display_name": { 3113 + "name": "display_name", 3114 + "type": "text", 3115 + "primaryKey": false, 3116 + "notNull": false 3117 + }, 3118 + "handle": { 3119 + "name": "handle", 3120 + "type": "text", 3121 + "primaryKey": false, 3122 + "notNull": true 3123 + }, 3124 + "avatar": { 3125 + "name": "avatar", 3126 + "type": "text", 3127 + "primaryKey": false, 3128 + "notNull": true 3129 + }, 3130 + "xata_createdat": { 3131 + "name": "xata_createdat", 3132 + "type": "timestamp", 3133 + "primaryKey": false, 3134 + "notNull": true, 3135 + "default": "now()" 3136 + }, 3137 + "xata_updatedat": { 3138 + "name": "xata_updatedat", 3139 + "type": "timestamp", 3140 + "primaryKey": false, 3141 + "notNull": true, 3142 + "default": "now()" 3143 + }, 3144 + "xata_version": { 3145 + "name": "xata_version", 3146 + "type": "integer", 3147 + "primaryKey": false, 3148 + "notNull": false 3149 + } 3150 + }, 3151 + "indexes": {}, 3152 + "foreignKeys": {}, 3153 + "compositePrimaryKeys": {}, 3154 + "uniqueConstraints": { 3155 + "users_did_unique": { 3156 + "name": "users_did_unique", 3157 + "nullsNotDistinct": false, 3158 + "columns": [ 3159 + "did" 3160 + ] 3161 + }, 3162 + "users_handle_unique": { 3163 + "name": "users_handle_unique", 3164 + "nullsNotDistinct": false, 3165 + "columns": [ 3166 + "handle" 3167 + ] 3168 + } 3169 + }, 3170 + "policies": {}, 3171 + "checkConstraints": {}, 3172 + "isRLSEnabled": false 3173 + }, 3174 + "public.webscrobblers": { 3175 + "name": "webscrobblers", 3176 + "schema": "", 3177 + "columns": { 3178 + "xata_id": { 3179 + "name": "xata_id", 3180 + "type": "text", 3181 + "primaryKey": true, 3182 + "notNull": true, 3183 + "default": "xata_id()" 3184 + }, 3185 + "name": { 3186 + "name": "name", 3187 + "type": "text", 3188 + "primaryKey": false, 3189 + "notNull": true 3190 + }, 3191 + "uuid": { 3192 + "name": "uuid", 3193 + "type": "text", 3194 + "primaryKey": false, 3195 + "notNull": true 3196 + }, 3197 + "description": { 3198 + "name": "description", 3199 + "type": "text", 3200 + "primaryKey": false, 3201 + "notNull": false 3202 + }, 3203 + "enabled": { 3204 + "name": "enabled", 3205 + "type": "boolean", 3206 + "primaryKey": false, 3207 + "notNull": true, 3208 + "default": true 3209 + }, 3210 + "user_id": { 3211 + "name": "user_id", 3212 + "type": "text", 3213 + "primaryKey": false, 3214 + "notNull": true 3215 + }, 3216 + "xata_createdat": { 3217 + "name": "xata_createdat", 3218 + "type": "timestamp", 3219 + "primaryKey": false, 3220 + "notNull": true, 3221 + "default": "now()" 3222 + }, 3223 + "xata_updatedat": { 3224 + "name": "xata_updatedat", 3225 + "type": "timestamp", 3226 + "primaryKey": false, 3227 + "notNull": true, 3228 + "default": "now()" 3229 + } 3230 + }, 3231 + "indexes": {}, 3232 + "foreignKeys": { 3233 + "webscrobblers_user_id_users_xata_id_fk": { 3234 + "name": "webscrobblers_user_id_users_xata_id_fk", 3235 + "tableFrom": "webscrobblers", 3236 + "tableTo": "users", 3237 + "columnsFrom": [ 3238 + "user_id" 3239 + ], 3240 + "columnsTo": [ 3241 + "xata_id" 3242 + ], 3243 + "onDelete": "no action", 3244 + "onUpdate": "no action" 3245 + } 3246 + }, 3247 + "compositePrimaryKeys": {}, 3248 + "uniqueConstraints": {}, 3249 + "policies": {}, 3250 + "checkConstraints": {}, 3251 + "isRLSEnabled": false 3252 + } 3253 + }, 3254 + "enums": {}, 3255 + "schemas": {}, 3256 + "sequences": {}, 3257 + "roles": {}, 3258 + "policies": {}, 3259 + "views": {}, 3260 + "_meta": { 3261 + "columns": {}, 3262 + "schemas": {}, 3263 + "tables": {} 3264 + } 3265 + }
+7
apps/api/drizzle/meta/_journal.json
··· 29 29 "when": 1759819936859, 30 30 "tag": "0003_same_rocket_racer", 31 31 "breakpoints": true 32 + }, 33 + { 34 + "idx": 4, 35 + "version": "7", 36 + "when": 1760169551153, 37 + "tag": "0004_whole_greymalkin", 38 + "breakpoints": true 32 39 } 33 40 ] 34 41 }
+2 -1
apps/api/package.json
··· 23 23 "db:gen-migration": "drizzle-kit generate", 24 24 "prod:all": "concurrently 'tsx ./src/index.ts' 'tsx ./src/server.ts'", 25 25 "format": "biome format src", 26 - "lint": "biome lint src" 26 + "lint": "biome lint src", 27 + "feed": "tsx ./src/scripts/feed.ts" 27 28 }, 28 29 "dependencies": { 29 30 "@atproto/api": "^0.13.31",
+25
apps/api/src/schema/feeds.ts
··· 1 + import type { InferInsertModel, InferSelectModel } from "drizzle-orm"; 2 + import { sql } from "drizzle-orm"; 3 + import { integer, pgTable, text, timestamp } from "drizzle-orm/pg-core"; 4 + import users from "./users"; 5 + 6 + const feeds = pgTable("feeds", { 7 + id: text("xata_id") 8 + .primaryKey() 9 + .default(sql`xata_id()`), 10 + displayName: text("display_name").notNull(), 11 + description: text("description"), 12 + did: text("did").notNull().unique(), 13 + uri: text("uri").notNull().unique(), 14 + userId: text("user_id") 15 + .notNull() 16 + .references(() => users.id), 17 + xataVersion: integer("xata_version"), 18 + createdAt: timestamp("xata_createdat").defaultNow().notNull(), 19 + updatedAt: timestamp("xata_updatedat").defaultNow().notNull(), 20 + }); 21 + 22 + export type SelectFeed = InferSelectModel<typeof feeds>; 23 + export type InsertFeed = InferInsertModel<typeof feeds>; 24 + 25 + export default feeds;
+65
apps/api/src/scripts/feed.ts
··· 1 + import chalk from "chalk"; 2 + import { ctx } from "context"; 3 + import { createAgent } from "lib/agent"; 4 + import prompts from "prompts"; 5 + 6 + const args = process.argv.slice(2); 7 + 8 + if (args.length === 0) { 9 + console.error("Please provide user author identifier (handle or DID)."); 10 + console.log(`Usage: ${chalk.cyan("npm run feed -- <handle|did>")}`); 11 + process.exit(1); 12 + } 13 + 14 + const name = await prompts({ 15 + type: "text", 16 + name: "value", 17 + message: "What is the feed name?", 18 + }); 19 + 20 + if (!/^[a-zA-Z0-9_.-]{3,30}$/.test(name.value)) { 21 + console.error( 22 + "Invalid feed name. Only alphanumeric characters, underscores, hyphens, and periods are allowed. Length must be between 3 and 30 characters." 23 + ); 24 + process.exit(1); 25 + } 26 + 27 + const description = await prompts({ 28 + type: "text", 29 + name: "value", 30 + message: "Please provide a short description of the feed", 31 + }); 32 + 33 + if (description.value.length > 3000) { 34 + console.error("Description is too long. Maximum length is 3000 characters."); 35 + process.exit(1); 36 + } 37 + 38 + const did = await prompts({ 39 + type: "text", 40 + name: "value", 41 + message: "What is the feed DID?", 42 + }); 43 + 44 + if (!/^did:web:[a-zA-Z0-9_.-]{3,30}$/.test(did.value)) { 45 + console.error( 46 + "Invalid DID format. It should start with 'did:web:' followed by 3 to 30 alphanumeric characters, underscores, hyphens, or periods." 47 + ); 48 + process.exit(1); 49 + } 50 + 51 + console.log("Feed name:", name.value); 52 + console.log("Description:", description.value); 53 + console.log("DID:", did.value); 54 + 55 + let userDid = args[0]; 56 + 57 + if (!userDid.startsWith("did:plc:")) { 58 + userDid = await ctx.baseIdResolver.handle.resolve(userDid); 59 + } 60 + 61 + const agent = await createAgent(ctx.oauthClient, userDid); 62 + 63 + console.log("Creating feed..."); 64 + 65 + process.exit(0);