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

use a custom postgres image with xataid extension enabled

+926 -31
+141 -25
apps/api/drizzle/0000_init.sql apps/api/drizzle/0000_quiet_mister_sinister.sql
··· 1 1 CREATE TABLE "album_tracks" ( 2 - "xata_id" text PRIMARY KEY NOT NULL, 2 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 3 3 "album_id" text NOT NULL, 4 4 "track_id" text NOT NULL, 5 5 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 8 8 ); 9 9 --> statement-breakpoint 10 10 CREATE TABLE "albums" ( 11 - "xata_id" text PRIMARY KEY NOT NULL, 11 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 12 12 "title" text NOT NULL, 13 13 "artist" text NOT NULL, 14 14 "release_date" text, ··· 33 33 ); 34 34 --> statement-breakpoint 35 35 CREATE TABLE "api_keys" ( 36 - "xata_id" text PRIMARY KEY NOT NULL, 36 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 37 37 "name" text NOT NULL, 38 38 "api_key" text NOT NULL, 39 39 "shared_secret" text NOT NULL, ··· 45 45 ); 46 46 --> statement-breakpoint 47 47 CREATE TABLE "artist_albums" ( 48 - "xata_id" text PRIMARY KEY NOT NULL, 48 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 49 49 "artist_id" text NOT NULL, 50 50 "album_id" text NOT NULL, 51 51 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 54 54 ); 55 55 --> statement-breakpoint 56 56 CREATE TABLE "artist_tracks" ( 57 - "xata_id" text PRIMARY KEY NOT NULL, 57 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 58 58 "artist_id" text NOT NULL, 59 59 "track_id" text NOT NULL, 60 60 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 63 63 ); 64 64 --> statement-breakpoint 65 65 CREATE TABLE "artists" ( 66 - "xata_id" text PRIMARY KEY NOT NULL, 66 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 67 67 "name" text NOT NULL, 68 68 "biography" text, 69 69 "born" timestamp, ··· 83 83 CONSTRAINT "artists_uri_unique" UNIQUE("uri") 84 84 ); 85 85 --> statement-breakpoint 86 + CREATE TABLE "dropbox_accounts" ( 87 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 88 + "email" text NOT NULL, 89 + "is_beta_user" boolean DEFAULT false NOT NULL, 90 + "user_id" text NOT NULL, 91 + "xata_version" text NOT NULL, 92 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 93 + "xata_updatedat" timestamp DEFAULT now() NOT NULL, 94 + CONSTRAINT "dropbox_accounts_email_unique" UNIQUE("email") 95 + ); 96 + --> statement-breakpoint 97 + CREATE TABLE "dropbox_directories" ( 98 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 99 + "name" text NOT NULL, 100 + "path" text NOT NULL, 101 + "parent_id" text, 102 + "dropbox_id" text NOT NULL, 103 + "file_id" text NOT NULL, 104 + "xata_version" text NOT NULL, 105 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 106 + "xata_updatedat" timestamp DEFAULT now() NOT NULL, 107 + CONSTRAINT "dropbox_directories_file_id_unique" UNIQUE("file_id") 108 + ); 109 + --> statement-breakpoint 110 + CREATE TABLE "dropbox_paths" ( 111 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 112 + "path" text NOT NULL, 113 + "name" text NOT NULL, 114 + "dropbox_id" text NOT NULL, 115 + "track_id" text NOT NULL, 116 + "directory_id" text, 117 + "file_id" text NOT NULL, 118 + "xata_version" text NOT NULL, 119 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 120 + "xata_updatedat" timestamp DEFAULT now() NOT NULL, 121 + CONSTRAINT "dropbox_paths_file_id_unique" UNIQUE("file_id") 122 + ); 123 + --> statement-breakpoint 86 124 CREATE TABLE "dropbox_tokens" ( 87 - "xata_id" text PRIMARY KEY NOT NULL, 125 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 88 126 "refresh_token" text NOT NULL, 89 127 "xata_createdat" timestamp DEFAULT now() NOT NULL, 90 128 "xata_updatedat" timestamp DEFAULT now() NOT NULL 91 129 ); 92 130 --> statement-breakpoint 131 + CREATE TABLE "dropbox" ( 132 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 133 + "user_id" text NOT NULL, 134 + "dropbox_token_id" text NOT NULL, 135 + "xata_version" text NOT NULL, 136 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 137 + "xata_updatedat" timestamp DEFAULT now() NOT NULL 138 + ); 139 + --> statement-breakpoint 140 + CREATE TABLE "google_drive_accounts" ( 141 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 142 + "email" text NOT NULL, 143 + "is_beta_user" boolean DEFAULT false NOT NULL, 144 + "user_id" text NOT NULL, 145 + "xata_version" text NOT NULL, 146 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 147 + "xata_updatedat" timestamp DEFAULT now() NOT NULL, 148 + CONSTRAINT "google_drive_accounts_email_unique" UNIQUE("email") 149 + ); 150 + --> statement-breakpoint 151 + CREATE TABLE "google_drive_directories" ( 152 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 153 + "name" text NOT NULL, 154 + "path" text NOT NULL, 155 + "parent_id" text, 156 + "google_drive_id" text NOT NULL, 157 + "file_id" text NOT NULL, 158 + "xata_version" text NOT NULL, 159 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 160 + "xata_updatedat" timestamp DEFAULT now() NOT NULL, 161 + CONSTRAINT "google_drive_directories_file_id_unique" UNIQUE("file_id") 162 + ); 163 + --> statement-breakpoint 164 + CREATE TABLE "google_drive_paths" ( 165 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 166 + "google_drive_id" text NOT NULL, 167 + "track_id" text NOT NULL, 168 + "name" text NOT NULL, 169 + "directory_id" text, 170 + "file_id" text NOT NULL, 171 + "xata_version" text NOT NULL, 172 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 173 + "xata_updatedat" timestamp DEFAULT now() NOT NULL, 174 + CONSTRAINT "google_drive_paths_file_id_unique" UNIQUE("file_id") 175 + ); 176 + --> statement-breakpoint 93 177 CREATE TABLE "google_drive_tokens" ( 94 - "xata_id" text PRIMARY KEY NOT NULL, 178 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 95 179 "refresh_token" text NOT NULL, 96 180 "xata_createdat" timestamp DEFAULT now() NOT NULL, 97 181 "xata_updatedat" timestamp DEFAULT now() NOT NULL 98 182 ); 99 183 --> statement-breakpoint 184 + CREATE TABLE "google_drive" ( 185 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 186 + "google_drive_token_id" text NOT NULL, 187 + "user_id" text NOT NULL, 188 + "xata_version" text NOT NULL, 189 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 190 + "xata_updatedat" timestamp DEFAULT now() NOT NULL 191 + ); 192 + --> statement-breakpoint 100 193 CREATE TABLE "loved_tracks" ( 101 - "xata_id" text PRIMARY KEY NOT NULL, 194 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 102 195 "user_id" text NOT NULL, 103 196 "track_id" text NOT NULL, 104 197 "uri" text, ··· 107 200 ); 108 201 --> statement-breakpoint 109 202 CREATE TABLE "playlist_tracks" ( 110 - "xata_id" text PRIMARY KEY NOT NULL, 203 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 111 204 "playlist_id" text NOT NULL, 112 205 "track_id" text NOT NULL, 113 206 "xata_createdat" timestamp DEFAULT now() NOT NULL 114 207 ); 115 208 --> statement-breakpoint 116 209 CREATE TABLE "playlists" ( 117 - "xata_id" text PRIMARY KEY NOT NULL, 210 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 118 211 "name" text NOT NULL, 119 212 "picture" text, 120 213 "description" text, ··· 129 222 ); 130 223 --> statement-breakpoint 131 224 CREATE TABLE "profile_shouts" ( 132 - "xata_id" text PRIMARY KEY NOT NULL, 225 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 133 226 "user_id" text NOT NULL, 134 227 "shout_id" text NOT NULL, 135 228 "xata_createdat" timestamp DEFAULT now() NOT NULL 136 229 ); 137 230 --> statement-breakpoint 231 + CREATE TABLE "queue_tracks" ( 232 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 233 + "user_id" text NOT NULL, 234 + "track_id" text NOT NULL, 235 + "position" integer NOT NULL, 236 + "file_uri" text NOT NULL, 237 + "xata_version" integer DEFAULT 0 NOT NULL, 238 + "xata_createdat" timestamp DEFAULT now() NOT NULL, 239 + "xata_updatedat" timestamp DEFAULT now() NOT NULL 240 + ); 241 + --> statement-breakpoint 138 242 CREATE TABLE "scrobbles" ( 139 - "xata_id" text PRIMARY KEY NOT NULL, 243 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 140 244 "user_id" text, 141 245 "track_id" text, 142 246 "album_id" text, ··· 150 254 ); 151 255 --> statement-breakpoint 152 256 CREATE TABLE "shout_likes" ( 153 - "xata_id" text PRIMARY KEY NOT NULL, 257 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 154 258 "user_id" text NOT NULL, 155 259 "shout_id" text NOT NULL, 156 260 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 159 263 ); 160 264 --> statement-breakpoint 161 265 CREATE TABLE "shout_reports" ( 162 - "xata_id" text PRIMARY KEY NOT NULL, 266 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 163 267 "user_id" text NOT NULL, 164 268 "shout_id" text NOT NULL, 165 269 "xata_createdat" timestamp DEFAULT now() NOT NULL 166 270 ); 167 271 --> statement-breakpoint 168 272 CREATE TABLE "shouts" ( 169 - "xata_id" text PRIMARY KEY NOT NULL, 273 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 170 274 "content" text NOT NULL, 171 275 "track_id" text, 172 276 "artist_id" text, ··· 181 285 ); 182 286 --> statement-breakpoint 183 287 CREATE TABLE "spotify_accounts" ( 184 - "xata_id" text PRIMARY KEY NOT NULL, 288 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 185 289 "xata_version" integer NOT NULL, 186 290 "email" text NOT NULL, 187 291 "user_id" text NOT NULL, ··· 191 295 ); 192 296 --> statement-breakpoint 193 297 CREATE TABLE "spotify_tokens" ( 194 - "xata_id" text PRIMARY KEY NOT NULL, 298 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 195 299 "xata_version" integer NOT NULL, 196 300 "access_token" text NOT NULL, 197 301 "refresh_token" text NOT NULL, ··· 201 305 ); 202 306 --> statement-breakpoint 203 307 CREATE TABLE "tracks" ( 204 - "xata_id" text PRIMARY KEY NOT NULL, 308 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 205 309 "title" text NOT NULL, 206 310 "artist" text NOT NULL, 207 311 "album_artist" text NOT NULL, ··· 239 343 ); 240 344 --> statement-breakpoint 241 345 CREATE TABLE "user_albums" ( 242 - "xata_id" text PRIMARY KEY NOT NULL, 346 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 243 347 "user_id" text NOT NULL, 244 348 "album_id" text NOT NULL, 245 349 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 251 355 ); 252 356 --> statement-breakpoint 253 357 CREATE TABLE "user_artists" ( 254 - "xata_id" text PRIMARY KEY NOT NULL, 358 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 255 359 "user_id" text NOT NULL, 256 360 "artist_id" text NOT NULL, 257 361 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 263 367 ); 264 368 --> statement-breakpoint 265 369 CREATE TABLE "user_playlists" ( 266 - "xata_id" text PRIMARY KEY NOT NULL, 370 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 267 371 "user_id" text NOT NULL, 268 372 "playlist_id" text NOT NULL, 269 373 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 272 376 ); 273 377 --> statement-breakpoint 274 378 CREATE TABLE "user_tracks" ( 275 - "xata_id" text PRIMARY KEY NOT NULL, 379 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 276 380 "user_id" text NOT NULL, 277 381 "track_id" text NOT NULL, 278 382 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 284 388 ); 285 389 --> statement-breakpoint 286 390 CREATE TABLE "users" ( 287 - "xata_id" text PRIMARY KEY NOT NULL, 391 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 288 392 "did" text NOT NULL, 289 393 "display_name" text NOT NULL, 290 394 "handle" text NOT NULL, ··· 297 401 ); 298 402 --> statement-breakpoint 299 403 CREATE TABLE "webscrobblers" ( 300 - "xata_id" text PRIMARY KEY NOT NULL, 404 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 301 405 "name" text NOT NULL, 302 406 "uuid" text NOT NULL, 303 407 "description" text, ··· 314 418 ALTER TABLE "artist_albums" ADD CONSTRAINT "artist_albums_album_id_albums_xata_id_fk" FOREIGN KEY ("album_id") REFERENCES "public"."albums"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 315 419 ALTER TABLE "artist_tracks" ADD CONSTRAINT "artist_tracks_artist_id_artists_xata_id_fk" FOREIGN KEY ("artist_id") REFERENCES "public"."artists"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 316 420 ALTER TABLE "artist_tracks" ADD CONSTRAINT "artist_tracks_track_id_tracks_xata_id_fk" FOREIGN KEY ("track_id") REFERENCES "public"."tracks"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 421 + ALTER TABLE "dropbox_accounts" ADD CONSTRAINT "dropbox_accounts_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 422 + ALTER TABLE "dropbox_directories" ADD CONSTRAINT "dropbox_directories_parent_id_dropbox_directories_xata_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."dropbox_directories"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 423 + ALTER TABLE "dropbox_paths" ADD CONSTRAINT "dropbox_paths_directory_id_dropbox_directories_xata_id_fk" FOREIGN KEY ("directory_id") REFERENCES "public"."dropbox_directories"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 424 + ALTER TABLE "dropbox" ADD CONSTRAINT "dropbox_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 425 + ALTER TABLE "dropbox" ADD CONSTRAINT "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk" FOREIGN KEY ("dropbox_token_id") REFERENCES "public"."dropbox_tokens"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 426 + ALTER TABLE "google_drive_accounts" ADD CONSTRAINT "google_drive_accounts_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 427 + ALTER TABLE "google_drive_directories" ADD CONSTRAINT "google_drive_directories_parent_id_google_drive_directories_xata_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."google_drive_directories"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 428 + ALTER TABLE "google_drive_paths" ADD CONSTRAINT "google_drive_paths_directory_id_google_drive_directories_xata_id_fk" FOREIGN KEY ("directory_id") REFERENCES "public"."google_drive_directories"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 429 + ALTER TABLE "google_drive" ADD CONSTRAINT "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk" FOREIGN KEY ("google_drive_token_id") REFERENCES "public"."google_drive_tokens"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 430 + ALTER TABLE "google_drive" ADD CONSTRAINT "google_drive_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 317 431 ALTER TABLE "loved_tracks" ADD CONSTRAINT "loved_tracks_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 318 432 ALTER TABLE "loved_tracks" ADD CONSTRAINT "loved_tracks_track_id_tracks_xata_id_fk" FOREIGN KEY ("track_id") REFERENCES "public"."tracks"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 319 433 ALTER TABLE "playlist_tracks" ADD CONSTRAINT "playlist_tracks_playlist_id_playlists_xata_id_fk" FOREIGN KEY ("playlist_id") REFERENCES "public"."playlists"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint ··· 321 435 ALTER TABLE "playlists" ADD CONSTRAINT "playlists_created_by_users_xata_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 322 436 ALTER TABLE "profile_shouts" ADD CONSTRAINT "profile_shouts_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 323 437 ALTER TABLE "profile_shouts" ADD CONSTRAINT "profile_shouts_shout_id_shouts_xata_id_fk" FOREIGN KEY ("shout_id") REFERENCES "public"."shouts"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 438 + ALTER TABLE "queue_tracks" ADD CONSTRAINT "queue_tracks_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 439 + ALTER TABLE "queue_tracks" ADD CONSTRAINT "queue_tracks_track_id_tracks_xata_id_fk" FOREIGN KEY ("track_id") REFERENCES "public"."tracks"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 324 440 ALTER TABLE "scrobbles" ADD CONSTRAINT "scrobbles_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 325 441 ALTER TABLE "scrobbles" ADD CONSTRAINT "scrobbles_track_id_tracks_xata_id_fk" FOREIGN KEY ("track_id") REFERENCES "public"."tracks"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint 326 442 ALTER TABLE "scrobbles" ADD CONSTRAINT "scrobbles_album_id_albums_xata_id_fk" FOREIGN KEY ("album_id") REFERENCES "public"."albums"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+778 -1
apps/api/drizzle/meta/0000_snapshot.json
··· 1 1 { 2 - "id": "4c369380-a733-4097-b87a-036a11bbc173", 2 + "id": "49adc24b-83c8-4065-8e13-80045e7f0f27", 3 3 "prevId": "00000000-0000-0000-0000-000000000000", 4 4 "version": "7", 5 5 "dialect": "postgresql", ··· 602 602 "checkConstraints": {}, 603 603 "isRLSEnabled": false 604 604 }, 605 + "public.dropbox_accounts": { 606 + "name": "dropbox_accounts", 607 + "schema": "", 608 + "columns": { 609 + "xata_id": { 610 + "name": "xata_id", 611 + "type": "text", 612 + "primaryKey": true, 613 + "notNull": true 614 + }, 615 + "email": { 616 + "name": "email", 617 + "type": "text", 618 + "primaryKey": false, 619 + "notNull": true 620 + }, 621 + "is_beta_user": { 622 + "name": "is_beta_user", 623 + "type": "boolean", 624 + "primaryKey": false, 625 + "notNull": true, 626 + "default": false 627 + }, 628 + "user_id": { 629 + "name": "user_id", 630 + "type": "text", 631 + "primaryKey": false, 632 + "notNull": true 633 + }, 634 + "xata_version": { 635 + "name": "xata_version", 636 + "type": "text", 637 + "primaryKey": false, 638 + "notNull": true 639 + }, 640 + "xata_createdat": { 641 + "name": "xata_createdat", 642 + "type": "timestamp", 643 + "primaryKey": false, 644 + "notNull": true, 645 + "default": "now()" 646 + }, 647 + "xata_updatedat": { 648 + "name": "xata_updatedat", 649 + "type": "timestamp", 650 + "primaryKey": false, 651 + "notNull": true, 652 + "default": "now()" 653 + } 654 + }, 655 + "indexes": {}, 656 + "foreignKeys": { 657 + "dropbox_accounts_user_id_users_xata_id_fk": { 658 + "name": "dropbox_accounts_user_id_users_xata_id_fk", 659 + "tableFrom": "dropbox_accounts", 660 + "tableTo": "users", 661 + "columnsFrom": [ 662 + "user_id" 663 + ], 664 + "columnsTo": [ 665 + "xata_id" 666 + ], 667 + "onDelete": "no action", 668 + "onUpdate": "no action" 669 + } 670 + }, 671 + "compositePrimaryKeys": {}, 672 + "uniqueConstraints": { 673 + "dropbox_accounts_email_unique": { 674 + "name": "dropbox_accounts_email_unique", 675 + "nullsNotDistinct": false, 676 + "columns": [ 677 + "email" 678 + ] 679 + } 680 + }, 681 + "policies": {}, 682 + "checkConstraints": {}, 683 + "isRLSEnabled": false 684 + }, 685 + "public.dropbox_directories": { 686 + "name": "dropbox_directories", 687 + "schema": "", 688 + "columns": { 689 + "xata_id": { 690 + "name": "xata_id", 691 + "type": "text", 692 + "primaryKey": true, 693 + "notNull": true 694 + }, 695 + "name": { 696 + "name": "name", 697 + "type": "text", 698 + "primaryKey": false, 699 + "notNull": true 700 + }, 701 + "path": { 702 + "name": "path", 703 + "type": "text", 704 + "primaryKey": false, 705 + "notNull": true 706 + }, 707 + "parent_id": { 708 + "name": "parent_id", 709 + "type": "text", 710 + "primaryKey": false, 711 + "notNull": false 712 + }, 713 + "dropbox_id": { 714 + "name": "dropbox_id", 715 + "type": "text", 716 + "primaryKey": false, 717 + "notNull": true 718 + }, 719 + "file_id": { 720 + "name": "file_id", 721 + "type": "text", 722 + "primaryKey": false, 723 + "notNull": true 724 + }, 725 + "xata_version": { 726 + "name": "xata_version", 727 + "type": "text", 728 + "primaryKey": false, 729 + "notNull": true 730 + }, 731 + "xata_createdat": { 732 + "name": "xata_createdat", 733 + "type": "timestamp", 734 + "primaryKey": false, 735 + "notNull": true, 736 + "default": "now()" 737 + }, 738 + "xata_updatedat": { 739 + "name": "xata_updatedat", 740 + "type": "timestamp", 741 + "primaryKey": false, 742 + "notNull": true, 743 + "default": "now()" 744 + } 745 + }, 746 + "indexes": {}, 747 + "foreignKeys": { 748 + "dropbox_directories_parent_id_dropbox_directories_xata_id_fk": { 749 + "name": "dropbox_directories_parent_id_dropbox_directories_xata_id_fk", 750 + "tableFrom": "dropbox_directories", 751 + "tableTo": "dropbox_directories", 752 + "columnsFrom": [ 753 + "parent_id" 754 + ], 755 + "columnsTo": [ 756 + "xata_id" 757 + ], 758 + "onDelete": "no action", 759 + "onUpdate": "no action" 760 + } 761 + }, 762 + "compositePrimaryKeys": {}, 763 + "uniqueConstraints": { 764 + "dropbox_directories_file_id_unique": { 765 + "name": "dropbox_directories_file_id_unique", 766 + "nullsNotDistinct": false, 767 + "columns": [ 768 + "file_id" 769 + ] 770 + } 771 + }, 772 + "policies": {}, 773 + "checkConstraints": {}, 774 + "isRLSEnabled": false 775 + }, 776 + "public.dropbox_paths": { 777 + "name": "dropbox_paths", 778 + "schema": "", 779 + "columns": { 780 + "xata_id": { 781 + "name": "xata_id", 782 + "type": "text", 783 + "primaryKey": true, 784 + "notNull": true 785 + }, 786 + "path": { 787 + "name": "path", 788 + "type": "text", 789 + "primaryKey": false, 790 + "notNull": true 791 + }, 792 + "name": { 793 + "name": "name", 794 + "type": "text", 795 + "primaryKey": false, 796 + "notNull": true 797 + }, 798 + "dropbox_id": { 799 + "name": "dropbox_id", 800 + "type": "text", 801 + "primaryKey": false, 802 + "notNull": true 803 + }, 804 + "track_id": { 805 + "name": "track_id", 806 + "type": "text", 807 + "primaryKey": false, 808 + "notNull": true 809 + }, 810 + "directory_id": { 811 + "name": "directory_id", 812 + "type": "text", 813 + "primaryKey": false, 814 + "notNull": false 815 + }, 816 + "file_id": { 817 + "name": "file_id", 818 + "type": "text", 819 + "primaryKey": false, 820 + "notNull": true 821 + }, 822 + "xata_version": { 823 + "name": "xata_version", 824 + "type": "text", 825 + "primaryKey": false, 826 + "notNull": true 827 + }, 828 + "xata_createdat": { 829 + "name": "xata_createdat", 830 + "type": "timestamp", 831 + "primaryKey": false, 832 + "notNull": true, 833 + "default": "now()" 834 + }, 835 + "xata_updatedat": { 836 + "name": "xata_updatedat", 837 + "type": "timestamp", 838 + "primaryKey": false, 839 + "notNull": true, 840 + "default": "now()" 841 + } 842 + }, 843 + "indexes": {}, 844 + "foreignKeys": { 845 + "dropbox_paths_directory_id_dropbox_directories_xata_id_fk": { 846 + "name": "dropbox_paths_directory_id_dropbox_directories_xata_id_fk", 847 + "tableFrom": "dropbox_paths", 848 + "tableTo": "dropbox_directories", 849 + "columnsFrom": [ 850 + "directory_id" 851 + ], 852 + "columnsTo": [ 853 + "xata_id" 854 + ], 855 + "onDelete": "no action", 856 + "onUpdate": "no action" 857 + } 858 + }, 859 + "compositePrimaryKeys": {}, 860 + "uniqueConstraints": { 861 + "dropbox_paths_file_id_unique": { 862 + "name": "dropbox_paths_file_id_unique", 863 + "nullsNotDistinct": false, 864 + "columns": [ 865 + "file_id" 866 + ] 867 + } 868 + }, 869 + "policies": {}, 870 + "checkConstraints": {}, 871 + "isRLSEnabled": false 872 + }, 605 873 "public.dropbox_tokens": { 606 874 "name": "dropbox_tokens", 607 875 "schema": "", ··· 641 909 "checkConstraints": {}, 642 910 "isRLSEnabled": false 643 911 }, 912 + "public.dropbox": { 913 + "name": "dropbox", 914 + "schema": "", 915 + "columns": { 916 + "xata_id": { 917 + "name": "xata_id", 918 + "type": "text", 919 + "primaryKey": true, 920 + "notNull": true 921 + }, 922 + "user_id": { 923 + "name": "user_id", 924 + "type": "text", 925 + "primaryKey": false, 926 + "notNull": true 927 + }, 928 + "dropbox_token_id": { 929 + "name": "dropbox_token_id", 930 + "type": "text", 931 + "primaryKey": false, 932 + "notNull": true 933 + }, 934 + "xata_version": { 935 + "name": "xata_version", 936 + "type": "text", 937 + "primaryKey": false, 938 + "notNull": true 939 + }, 940 + "xata_createdat": { 941 + "name": "xata_createdat", 942 + "type": "timestamp", 943 + "primaryKey": false, 944 + "notNull": true, 945 + "default": "now()" 946 + }, 947 + "xata_updatedat": { 948 + "name": "xata_updatedat", 949 + "type": "timestamp", 950 + "primaryKey": false, 951 + "notNull": true, 952 + "default": "now()" 953 + } 954 + }, 955 + "indexes": {}, 956 + "foreignKeys": { 957 + "dropbox_user_id_users_xata_id_fk": { 958 + "name": "dropbox_user_id_users_xata_id_fk", 959 + "tableFrom": "dropbox", 960 + "tableTo": "users", 961 + "columnsFrom": [ 962 + "user_id" 963 + ], 964 + "columnsTo": [ 965 + "xata_id" 966 + ], 967 + "onDelete": "no action", 968 + "onUpdate": "no action" 969 + }, 970 + "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk": { 971 + "name": "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk", 972 + "tableFrom": "dropbox", 973 + "tableTo": "dropbox_tokens", 974 + "columnsFrom": [ 975 + "dropbox_token_id" 976 + ], 977 + "columnsTo": [ 978 + "xata_id" 979 + ], 980 + "onDelete": "no action", 981 + "onUpdate": "no action" 982 + } 983 + }, 984 + "compositePrimaryKeys": {}, 985 + "uniqueConstraints": {}, 986 + "policies": {}, 987 + "checkConstraints": {}, 988 + "isRLSEnabled": false 989 + }, 990 + "public.google_drive_accounts": { 991 + "name": "google_drive_accounts", 992 + "schema": "", 993 + "columns": { 994 + "xata_id": { 995 + "name": "xata_id", 996 + "type": "text", 997 + "primaryKey": true, 998 + "notNull": true 999 + }, 1000 + "email": { 1001 + "name": "email", 1002 + "type": "text", 1003 + "primaryKey": false, 1004 + "notNull": true 1005 + }, 1006 + "is_beta_user": { 1007 + "name": "is_beta_user", 1008 + "type": "boolean", 1009 + "primaryKey": false, 1010 + "notNull": true, 1011 + "default": false 1012 + }, 1013 + "user_id": { 1014 + "name": "user_id", 1015 + "type": "text", 1016 + "primaryKey": false, 1017 + "notNull": true 1018 + }, 1019 + "xata_version": { 1020 + "name": "xata_version", 1021 + "type": "text", 1022 + "primaryKey": false, 1023 + "notNull": true 1024 + }, 1025 + "xata_createdat": { 1026 + "name": "xata_createdat", 1027 + "type": "timestamp", 1028 + "primaryKey": false, 1029 + "notNull": true, 1030 + "default": "now()" 1031 + }, 1032 + "xata_updatedat": { 1033 + "name": "xata_updatedat", 1034 + "type": "timestamp", 1035 + "primaryKey": false, 1036 + "notNull": true, 1037 + "default": "now()" 1038 + } 1039 + }, 1040 + "indexes": {}, 1041 + "foreignKeys": { 1042 + "google_drive_accounts_user_id_users_xata_id_fk": { 1043 + "name": "google_drive_accounts_user_id_users_xata_id_fk", 1044 + "tableFrom": "google_drive_accounts", 1045 + "tableTo": "users", 1046 + "columnsFrom": [ 1047 + "user_id" 1048 + ], 1049 + "columnsTo": [ 1050 + "xata_id" 1051 + ], 1052 + "onDelete": "no action", 1053 + "onUpdate": "no action" 1054 + } 1055 + }, 1056 + "compositePrimaryKeys": {}, 1057 + "uniqueConstraints": { 1058 + "google_drive_accounts_email_unique": { 1059 + "name": "google_drive_accounts_email_unique", 1060 + "nullsNotDistinct": false, 1061 + "columns": [ 1062 + "email" 1063 + ] 1064 + } 1065 + }, 1066 + "policies": {}, 1067 + "checkConstraints": {}, 1068 + "isRLSEnabled": false 1069 + }, 1070 + "public.google_drive_directories": { 1071 + "name": "google_drive_directories", 1072 + "schema": "", 1073 + "columns": { 1074 + "xata_id": { 1075 + "name": "xata_id", 1076 + "type": "text", 1077 + "primaryKey": true, 1078 + "notNull": true 1079 + }, 1080 + "name": { 1081 + "name": "name", 1082 + "type": "text", 1083 + "primaryKey": false, 1084 + "notNull": true 1085 + }, 1086 + "path": { 1087 + "name": "path", 1088 + "type": "text", 1089 + "primaryKey": false, 1090 + "notNull": true 1091 + }, 1092 + "parent_id": { 1093 + "name": "parent_id", 1094 + "type": "text", 1095 + "primaryKey": false, 1096 + "notNull": false 1097 + }, 1098 + "google_drive_id": { 1099 + "name": "google_drive_id", 1100 + "type": "text", 1101 + "primaryKey": false, 1102 + "notNull": true 1103 + }, 1104 + "file_id": { 1105 + "name": "file_id", 1106 + "type": "text", 1107 + "primaryKey": false, 1108 + "notNull": true 1109 + }, 1110 + "xata_version": { 1111 + "name": "xata_version", 1112 + "type": "text", 1113 + "primaryKey": false, 1114 + "notNull": true 1115 + }, 1116 + "xata_createdat": { 1117 + "name": "xata_createdat", 1118 + "type": "timestamp", 1119 + "primaryKey": false, 1120 + "notNull": true, 1121 + "default": "now()" 1122 + }, 1123 + "xata_updatedat": { 1124 + "name": "xata_updatedat", 1125 + "type": "timestamp", 1126 + "primaryKey": false, 1127 + "notNull": true, 1128 + "default": "now()" 1129 + } 1130 + }, 1131 + "indexes": {}, 1132 + "foreignKeys": { 1133 + "google_drive_directories_parent_id_google_drive_directories_xata_id_fk": { 1134 + "name": "google_drive_directories_parent_id_google_drive_directories_xata_id_fk", 1135 + "tableFrom": "google_drive_directories", 1136 + "tableTo": "google_drive_directories", 1137 + "columnsFrom": [ 1138 + "parent_id" 1139 + ], 1140 + "columnsTo": [ 1141 + "xata_id" 1142 + ], 1143 + "onDelete": "no action", 1144 + "onUpdate": "no action" 1145 + } 1146 + }, 1147 + "compositePrimaryKeys": {}, 1148 + "uniqueConstraints": { 1149 + "google_drive_directories_file_id_unique": { 1150 + "name": "google_drive_directories_file_id_unique", 1151 + "nullsNotDistinct": false, 1152 + "columns": [ 1153 + "file_id" 1154 + ] 1155 + } 1156 + }, 1157 + "policies": {}, 1158 + "checkConstraints": {}, 1159 + "isRLSEnabled": false 1160 + }, 1161 + "public.google_drive_paths": { 1162 + "name": "google_drive_paths", 1163 + "schema": "", 1164 + "columns": { 1165 + "xata_id": { 1166 + "name": "xata_id", 1167 + "type": "text", 1168 + "primaryKey": true, 1169 + "notNull": true 1170 + }, 1171 + "google_drive_id": { 1172 + "name": "google_drive_id", 1173 + "type": "text", 1174 + "primaryKey": false, 1175 + "notNull": true 1176 + }, 1177 + "track_id": { 1178 + "name": "track_id", 1179 + "type": "text", 1180 + "primaryKey": false, 1181 + "notNull": true 1182 + }, 1183 + "name": { 1184 + "name": "name", 1185 + "type": "text", 1186 + "primaryKey": false, 1187 + "notNull": true 1188 + }, 1189 + "directory_id": { 1190 + "name": "directory_id", 1191 + "type": "text", 1192 + "primaryKey": false, 1193 + "notNull": false 1194 + }, 1195 + "file_id": { 1196 + "name": "file_id", 1197 + "type": "text", 1198 + "primaryKey": false, 1199 + "notNull": true 1200 + }, 1201 + "xata_version": { 1202 + "name": "xata_version", 1203 + "type": "text", 1204 + "primaryKey": false, 1205 + "notNull": true 1206 + }, 1207 + "xata_createdat": { 1208 + "name": "xata_createdat", 1209 + "type": "timestamp", 1210 + "primaryKey": false, 1211 + "notNull": true, 1212 + "default": "now()" 1213 + }, 1214 + "xata_updatedat": { 1215 + "name": "xata_updatedat", 1216 + "type": "timestamp", 1217 + "primaryKey": false, 1218 + "notNull": true, 1219 + "default": "now()" 1220 + } 1221 + }, 1222 + "indexes": {}, 1223 + "foreignKeys": { 1224 + "google_drive_paths_directory_id_google_drive_directories_xata_id_fk": { 1225 + "name": "google_drive_paths_directory_id_google_drive_directories_xata_id_fk", 1226 + "tableFrom": "google_drive_paths", 1227 + "tableTo": "google_drive_directories", 1228 + "columnsFrom": [ 1229 + "directory_id" 1230 + ], 1231 + "columnsTo": [ 1232 + "xata_id" 1233 + ], 1234 + "onDelete": "no action", 1235 + "onUpdate": "no action" 1236 + } 1237 + }, 1238 + "compositePrimaryKeys": {}, 1239 + "uniqueConstraints": { 1240 + "google_drive_paths_file_id_unique": { 1241 + "name": "google_drive_paths_file_id_unique", 1242 + "nullsNotDistinct": false, 1243 + "columns": [ 1244 + "file_id" 1245 + ] 1246 + } 1247 + }, 1248 + "policies": {}, 1249 + "checkConstraints": {}, 1250 + "isRLSEnabled": false 1251 + }, 644 1252 "public.google_drive_tokens": { 645 1253 "name": "google_drive_tokens", 646 1254 "schema": "", ··· 674 1282 }, 675 1283 "indexes": {}, 676 1284 "foreignKeys": {}, 1285 + "compositePrimaryKeys": {}, 1286 + "uniqueConstraints": {}, 1287 + "policies": {}, 1288 + "checkConstraints": {}, 1289 + "isRLSEnabled": false 1290 + }, 1291 + "public.google_drive": { 1292 + "name": "google_drive", 1293 + "schema": "", 1294 + "columns": { 1295 + "xata_id": { 1296 + "name": "xata_id", 1297 + "type": "text", 1298 + "primaryKey": true, 1299 + "notNull": true 1300 + }, 1301 + "google_drive_token_id": { 1302 + "name": "google_drive_token_id", 1303 + "type": "text", 1304 + "primaryKey": false, 1305 + "notNull": true 1306 + }, 1307 + "user_id": { 1308 + "name": "user_id", 1309 + "type": "text", 1310 + "primaryKey": false, 1311 + "notNull": true 1312 + }, 1313 + "xata_version": { 1314 + "name": "xata_version", 1315 + "type": "text", 1316 + "primaryKey": false, 1317 + "notNull": true 1318 + }, 1319 + "xata_createdat": { 1320 + "name": "xata_createdat", 1321 + "type": "timestamp", 1322 + "primaryKey": false, 1323 + "notNull": true, 1324 + "default": "now()" 1325 + }, 1326 + "xata_updatedat": { 1327 + "name": "xata_updatedat", 1328 + "type": "timestamp", 1329 + "primaryKey": false, 1330 + "notNull": true, 1331 + "default": "now()" 1332 + } 1333 + }, 1334 + "indexes": {}, 1335 + "foreignKeys": { 1336 + "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk": { 1337 + "name": "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk", 1338 + "tableFrom": "google_drive", 1339 + "tableTo": "google_drive_tokens", 1340 + "columnsFrom": [ 1341 + "google_drive_token_id" 1342 + ], 1343 + "columnsTo": [ 1344 + "xata_id" 1345 + ], 1346 + "onDelete": "no action", 1347 + "onUpdate": "no action" 1348 + }, 1349 + "google_drive_user_id_users_xata_id_fk": { 1350 + "name": "google_drive_user_id_users_xata_id_fk", 1351 + "tableFrom": "google_drive", 1352 + "tableTo": "users", 1353 + "columnsFrom": [ 1354 + "user_id" 1355 + ], 1356 + "columnsTo": [ 1357 + "xata_id" 1358 + ], 1359 + "onDelete": "no action", 1360 + "onUpdate": "no action" 1361 + } 1362 + }, 677 1363 "compositePrimaryKeys": {}, 678 1364 "uniqueConstraints": {}, 679 1365 "policies": {}, ··· 978 1664 "tableTo": "shouts", 979 1665 "columnsFrom": [ 980 1666 "shout_id" 1667 + ], 1668 + "columnsTo": [ 1669 + "xata_id" 1670 + ], 1671 + "onDelete": "no action", 1672 + "onUpdate": "no action" 1673 + } 1674 + }, 1675 + "compositePrimaryKeys": {}, 1676 + "uniqueConstraints": {}, 1677 + "policies": {}, 1678 + "checkConstraints": {}, 1679 + "isRLSEnabled": false 1680 + }, 1681 + "public.queue_tracks": { 1682 + "name": "queue_tracks", 1683 + "schema": "", 1684 + "columns": { 1685 + "xata_id": { 1686 + "name": "xata_id", 1687 + "type": "text", 1688 + "primaryKey": true, 1689 + "notNull": true 1690 + }, 1691 + "user_id": { 1692 + "name": "user_id", 1693 + "type": "text", 1694 + "primaryKey": false, 1695 + "notNull": true 1696 + }, 1697 + "track_id": { 1698 + "name": "track_id", 1699 + "type": "text", 1700 + "primaryKey": false, 1701 + "notNull": true 1702 + }, 1703 + "position": { 1704 + "name": "position", 1705 + "type": "integer", 1706 + "primaryKey": false, 1707 + "notNull": true 1708 + }, 1709 + "file_uri": { 1710 + "name": "file_uri", 1711 + "type": "text", 1712 + "primaryKey": false, 1713 + "notNull": true 1714 + }, 1715 + "xata_version": { 1716 + "name": "xata_version", 1717 + "type": "integer", 1718 + "primaryKey": false, 1719 + "notNull": true, 1720 + "default": 0 1721 + }, 1722 + "xata_createdat": { 1723 + "name": "xata_createdat", 1724 + "type": "timestamp", 1725 + "primaryKey": false, 1726 + "notNull": true, 1727 + "default": "now()" 1728 + }, 1729 + "xata_updatedat": { 1730 + "name": "xata_updatedat", 1731 + "type": "timestamp", 1732 + "primaryKey": false, 1733 + "notNull": true, 1734 + "default": "now()" 1735 + } 1736 + }, 1737 + "indexes": {}, 1738 + "foreignKeys": { 1739 + "queue_tracks_user_id_users_xata_id_fk": { 1740 + "name": "queue_tracks_user_id_users_xata_id_fk", 1741 + "tableFrom": "queue_tracks", 1742 + "tableTo": "users", 1743 + "columnsFrom": [ 1744 + "user_id" 1745 + ], 1746 + "columnsTo": [ 1747 + "xata_id" 1748 + ], 1749 + "onDelete": "no action", 1750 + "onUpdate": "no action" 1751 + }, 1752 + "queue_tracks_track_id_tracks_xata_id_fk": { 1753 + "name": "queue_tracks_track_id_tracks_xata_id_fk", 1754 + "tableFrom": "queue_tracks", 1755 + "tableTo": "tracks", 1756 + "columnsFrom": [ 1757 + "track_id" 981 1758 ], 982 1759 "columnsTo": [ 983 1760 "xata_id"
+2 -2
apps/api/drizzle/meta/_journal.json
··· 5 5 { 6 6 "idx": 0, 7 7 "version": "7", 8 - "when": 1750169528964, 9 - "tag": "0000_init", 8 + "when": 1753405608015, 9 + "tag": "0000_quiet_mister_sinister", 10 10 "breakpoints": true 11 11 } 12 12 ]
+2 -1
apps/api/package.json
··· 17 17 "pkl:gen": "tsx ./scripts/pkl.ts", 18 18 "dev:xrpc": "tsx --watch ./src/server.ts", 19 19 "prod:xrpc": "tsx ./src/server.ts", 20 - "db:migrate": "drizzle-kit migrate" 20 + "db:migrate": "drizzle-kit migrate", 21 + "db:gen-migration": "drizzle-kit generate" 21 22 }, 22 23 "dependencies": { 23 24 "@atproto/api": "^0.13.31",
+1 -1
compose.yaml
··· 26 26 - meilisearch_data:/data.ms 27 27 28 28 db: 29 - image: postgres:15 29 + image: tsiry/postgres-xataid:latest 30 30 ports: 31 31 - '5433:5432' 32 32 environment:
+2 -1
package.json
··· 11 11 "scripts": { 12 12 "dev": "turbo dev", 13 13 "db:migrate": "cd apps/api && bun run db:migrate", 14 + "db:gen-migration": "cd apps/api && bun run db:gen-migration", 14 15 "pkl:eval": "cd apps/api && bun run pkl:eval", 15 16 "pkl:gen": "cd apps/api && bun run pkl:gen", 16 17 "lexgen": "cd apps/api && bun run lexgen", ··· 38 39 "packages/*", 39 40 "crates" 40 41 ] 41 - } 42 + }