A decentralized music tracking and discovery platform built on AT Protocol 🎵
listenbrainz spotify atproto lastfm musicbrainz scrobbling

update migrations

Changed files
+43 -38
apps
crates
pgpull
src
+34 -34
apps/api/drizzle/0000_greedy_vanisher.sql apps/api/drizzle/0000_polite_pixie.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, ··· 85 85 ); 86 86 --> statement-breakpoint 87 87 CREATE TABLE "dropbox_accounts" ( 88 - "xata_id" text PRIMARY KEY NOT NULL, 88 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 89 89 "email" text NOT NULL, 90 90 "is_beta_user" boolean DEFAULT false NOT NULL, 91 91 "user_id" text NOT NULL, ··· 96 96 ); 97 97 --> statement-breakpoint 98 98 CREATE TABLE "dropbox_directories" ( 99 - "xata_id" text PRIMARY KEY NOT NULL, 99 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 100 100 "name" text NOT NULL, 101 101 "path" text NOT NULL, 102 102 "parent_id" text, ··· 109 109 ); 110 110 --> statement-breakpoint 111 111 CREATE TABLE "dropbox_paths" ( 112 - "xata_id" text PRIMARY KEY NOT NULL, 112 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 113 113 "path" text NOT NULL, 114 114 "name" text NOT NULL, 115 115 "dropbox_id" text NOT NULL, ··· 123 123 ); 124 124 --> statement-breakpoint 125 125 CREATE TABLE "dropbox_tokens" ( 126 - "xata_id" text PRIMARY KEY NOT NULL, 126 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 127 127 "refresh_token" text NOT NULL, 128 128 "xata_createdat" timestamp DEFAULT now() NOT NULL, 129 129 "xata_updatedat" timestamp DEFAULT now() NOT NULL 130 130 ); 131 131 --> statement-breakpoint 132 132 CREATE TABLE "dropbox" ( 133 - "xata_id" text PRIMARY KEY NOT NULL, 133 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 134 134 "user_id" text NOT NULL, 135 135 "dropbox_token_id" text NOT NULL, 136 136 "xata_version" text NOT NULL, ··· 139 139 ); 140 140 --> statement-breakpoint 141 141 CREATE TABLE "google_drive_accounts" ( 142 - "xata_id" text PRIMARY KEY NOT NULL, 142 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 143 143 "email" text NOT NULL, 144 144 "is_beta_user" boolean DEFAULT false NOT NULL, 145 145 "user_id" text NOT NULL, ··· 150 150 ); 151 151 --> statement-breakpoint 152 152 CREATE TABLE "google_drive_directories" ( 153 - "xata_id" text PRIMARY KEY NOT NULL, 153 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 154 154 "name" text NOT NULL, 155 155 "path" text NOT NULL, 156 156 "parent_id" text, ··· 163 163 ); 164 164 --> statement-breakpoint 165 165 CREATE TABLE "google_drive_paths" ( 166 - "xata_id" text PRIMARY KEY NOT NULL, 166 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 167 167 "google_drive_id" text NOT NULL, 168 168 "track_id" text NOT NULL, 169 169 "name" text NOT NULL, ··· 176 176 ); 177 177 --> statement-breakpoint 178 178 CREATE TABLE "google_drive_tokens" ( 179 - "xata_id" text PRIMARY KEY NOT NULL, 179 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 180 180 "refresh_token" text NOT NULL, 181 181 "xata_createdat" timestamp DEFAULT now() NOT NULL, 182 182 "xata_updatedat" timestamp DEFAULT now() NOT NULL 183 183 ); 184 184 --> statement-breakpoint 185 185 CREATE TABLE "google_drive" ( 186 - "xata_id" text PRIMARY KEY NOT NULL, 186 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 187 187 "google_drive_token_id" text NOT NULL, 188 188 "user_id" text NOT NULL, 189 189 "xata_version" text NOT NULL, ··· 192 192 ); 193 193 --> statement-breakpoint 194 194 CREATE TABLE "loved_tracks" ( 195 - "xata_id" text PRIMARY KEY NOT NULL, 195 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 196 196 "user_id" text NOT NULL, 197 197 "track_id" text NOT NULL, 198 198 "uri" text, ··· 201 201 ); 202 202 --> statement-breakpoint 203 203 CREATE TABLE "playlist_tracks" ( 204 - "xata_id" text PRIMARY KEY NOT NULL, 204 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 205 205 "playlist_id" text NOT NULL, 206 206 "track_id" text NOT NULL, 207 207 "xata_createdat" timestamp DEFAULT now() NOT NULL 208 208 ); 209 209 --> statement-breakpoint 210 210 CREATE TABLE "playlists" ( 211 - "xata_id" text PRIMARY KEY NOT NULL, 211 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 212 212 "name" text NOT NULL, 213 213 "picture" text, 214 214 "description" text, ··· 223 223 ); 224 224 --> statement-breakpoint 225 225 CREATE TABLE "profile_shouts" ( 226 - "xata_id" text PRIMARY KEY NOT NULL, 226 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 227 227 "user_id" text NOT NULL, 228 228 "shout_id" text NOT NULL, 229 229 "xata_createdat" timestamp DEFAULT now() NOT NULL 230 230 ); 231 231 --> statement-breakpoint 232 232 CREATE TABLE "queue_tracks" ( 233 - "xata_id" text PRIMARY KEY NOT NULL, 233 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 234 234 "user_id" text NOT NULL, 235 235 "track_id" text NOT NULL, 236 236 "position" integer NOT NULL, ··· 241 241 ); 242 242 --> statement-breakpoint 243 243 CREATE TABLE "scrobbles" ( 244 - "xata_id" text PRIMARY KEY NOT NULL, 244 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 245 245 "user_id" text, 246 246 "track_id" text, 247 247 "album_id" text, ··· 255 255 ); 256 256 --> statement-breakpoint 257 257 CREATE TABLE "shout_likes" ( 258 - "xata_id" text PRIMARY KEY NOT NULL, 258 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 259 259 "user_id" text NOT NULL, 260 260 "shout_id" text NOT NULL, 261 261 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 264 264 ); 265 265 --> statement-breakpoint 266 266 CREATE TABLE "shout_reports" ( 267 - "xata_id" text PRIMARY KEY NOT NULL, 267 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 268 268 "user_id" text NOT NULL, 269 269 "shout_id" text NOT NULL, 270 270 "xata_createdat" timestamp DEFAULT now() NOT NULL 271 271 ); 272 272 --> statement-breakpoint 273 273 CREATE TABLE "shouts" ( 274 - "xata_id" text PRIMARY KEY NOT NULL, 274 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 275 275 "content" text NOT NULL, 276 276 "track_id" text, 277 277 "artist_id" text, ··· 286 286 ); 287 287 --> statement-breakpoint 288 288 CREATE TABLE "spotify_accounts" ( 289 - "xata_id" text PRIMARY KEY NOT NULL, 289 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 290 290 "xata_version" integer NOT NULL, 291 291 "email" text NOT NULL, 292 292 "user_id" text NOT NULL, ··· 296 296 ); 297 297 --> statement-breakpoint 298 298 CREATE TABLE "spotify_tokens" ( 299 - "xata_id" text PRIMARY KEY NOT NULL, 299 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 300 300 "xata_version" integer NOT NULL, 301 301 "access_token" text NOT NULL, 302 302 "refresh_token" text NOT NULL, ··· 306 306 ); 307 307 --> statement-breakpoint 308 308 CREATE TABLE "tracks" ( 309 - "xata_id" text PRIMARY KEY NOT NULL, 309 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 310 310 "title" text NOT NULL, 311 311 "artist" text NOT NULL, 312 312 "album_artist" text NOT NULL, ··· 342 342 ); 343 343 --> statement-breakpoint 344 344 CREATE TABLE "user_albums" ( 345 - "xata_id" text PRIMARY KEY NOT NULL, 345 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 346 346 "user_id" text NOT NULL, 347 347 "album_id" text NOT NULL, 348 348 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 354 354 ); 355 355 --> statement-breakpoint 356 356 CREATE TABLE "user_artists" ( 357 - "xata_id" text PRIMARY KEY NOT NULL, 357 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 358 358 "user_id" text NOT NULL, 359 359 "artist_id" text NOT NULL, 360 360 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 366 366 ); 367 367 --> statement-breakpoint 368 368 CREATE TABLE "user_playlists" ( 369 - "xata_id" text PRIMARY KEY NOT NULL, 369 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 370 370 "user_id" text NOT NULL, 371 371 "playlist_id" text NOT NULL, 372 372 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 375 375 ); 376 376 --> statement-breakpoint 377 377 CREATE TABLE "user_tracks" ( 378 - "xata_id" text PRIMARY KEY NOT NULL, 378 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 379 379 "user_id" text NOT NULL, 380 380 "track_id" text NOT NULL, 381 381 "xata_createdat" timestamp DEFAULT now() NOT NULL, ··· 387 387 ); 388 388 --> statement-breakpoint 389 389 CREATE TABLE "users" ( 390 - "xata_id" text PRIMARY KEY NOT NULL, 390 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 391 391 "did" text NOT NULL, 392 392 "display_name" text, 393 393 "handle" text NOT NULL, ··· 400 400 ); 401 401 --> statement-breakpoint 402 402 CREATE TABLE "webscrobblers" ( 403 - "xata_id" text PRIMARY KEY NOT NULL, 403 + "xata_id" text PRIMARY KEY DEFAULT xata_id(), 404 404 "name" text NOT NULL, 405 405 "uuid" text NOT NULL, 406 406 "description" text,
+1 -1
apps/api/drizzle/meta/0000_snapshot.json
··· 1 1 { 2 - "id": "97b0b357-40d7-42b5-ab53-2738bd804a2c", 2 + "id": "f7f59d87-3fa3-4146-91b5-692a483d2abc", 3 3 "prevId": "00000000-0000-0000-0000-000000000000", 4 4 "version": "7", 5 5 "dialect": "postgresql",
+2 -2
apps/api/drizzle/meta/_journal.json
··· 5 5 { 6 6 "idx": 0, 7 7 "version": "7", 8 - "when": 1759736561936, 9 - "tag": "0000_greedy_vanisher", 8 + "when": 1759738835464, 9 + "tag": "0000_polite_pixie", 10 10 "breakpoints": true 11 11 } 12 12 ]
+6 -1
crates/pgpull/src/lib.rs
··· 239 239 240 240 for loved_track in &loved_tracks { 241 241 tracing::info!(user_id = %loved_track.user_id.cyan(), track_id = %loved_track.track_id.magenta(), i = %i.magenta(), total = %total_loved_tracks.magenta(), "Inserting loved track"); 242 - repo::loved_track::insert_loved_track(&dest_pool_clone, loved_track).await?; 242 + match repo::loved_track::insert_loved_track(&dest_pool_clone, loved_track).await { 243 + Ok(_) => {} 244 + Err(e) => { 245 + tracing::error!(error = %e, "Failed to insert loved track"); 246 + } 247 + } 243 248 i += 1; 244 249 } 245 250 }