forked from
rocksky.app/rocksky
A decentralized music tracking and discovery platform built on AT Protocol 馃幍
1CREATE TABLE "album_tracks" (
2 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
3 "album_id" text NOT NULL,
4 "track_id" text NOT NULL,
5 "xata_createdat" timestamp DEFAULT now() NOT NULL,
6 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
7 "xata_version" integer NOT NULL
8);
9--> statement-breakpoint
10CREATE TABLE "albums" (
11 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
12 "title" text NOT NULL,
13 "artist" text NOT NULL,
14 "release_date" text,
15 "year" integer,
16 "album_art" text,
17 "uri" text,
18 "artist_uri" text,
19 "apple_music_link" text,
20 "spotify_link" text,
21 "tidal_link" text,
22 "youtube_link" text,
23 "sha256" text NOT NULL,
24 "xata_createdat" timestamp DEFAULT now() NOT NULL,
25 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
26 "xata_version" integer,
27 CONSTRAINT "albums_uri_unique" UNIQUE("uri"),
28 CONSTRAINT "albums_apple_music_link_unique" UNIQUE("apple_music_link"),
29 CONSTRAINT "albums_spotify_link_unique" UNIQUE("spotify_link"),
30 CONSTRAINT "albums_tidal_link_unique" UNIQUE("tidal_link"),
31 CONSTRAINT "albums_youtube_link_unique" UNIQUE("youtube_link"),
32 CONSTRAINT "albums_sha256_unique" UNIQUE("sha256")
33);
34--> statement-breakpoint
35CREATE TABLE "api_keys" (
36 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
37 "name" text NOT NULL,
38 "api_key" text NOT NULL,
39 "shared_secret" text NOT NULL,
40 "description" text,
41 "enabled" boolean DEFAULT true NOT NULL,
42 "user_id" text NOT NULL,
43 "xata_createdat" timestamp DEFAULT now() NOT NULL,
44 "xata_updatedat" timestamp DEFAULT now() NOT NULL
45);
46--> statement-breakpoint
47CREATE TABLE "artist_albums" (
48 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
49 "artist_id" text NOT NULL,
50 "album_id" text NOT NULL,
51 "xata_createdat" timestamp DEFAULT now() NOT NULL,
52 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
53 "xata_version" integer NOT NULL
54);
55--> statement-breakpoint
56CREATE TABLE "artist_tracks" (
57 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
58 "artist_id" text NOT NULL,
59 "track_id" text NOT NULL,
60 "xata_createdat" timestamp DEFAULT now() NOT NULL,
61 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
62 "xata_version" integer NOT NULL
63);
64--> statement-breakpoint
65CREATE TABLE "artists" (
66 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
67 "name" text NOT NULL,
68 "biography" text,
69 "born" timestamp,
70 "born_in" text,
71 "died" timestamp,
72 "picture" text,
73 "sha256" text NOT NULL,
74 "uri" text,
75 "apple_music_link" text,
76 "spotify_link" text,
77 "tidal_link" text,
78 "youtube_link" text,
79 "xata_createdat" timestamp DEFAULT now() NOT NULL,
80 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
81 "xata_version" integer,
82 CONSTRAINT "artists_sha256_unique" UNIQUE("sha256"),
83 CONSTRAINT "artists_uri_unique" UNIQUE("uri")
84);
85--> statement-breakpoint
86CREATE 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
97CREATE 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
110CREATE 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
124CREATE TABLE "dropbox_tokens" (
125 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
126 "refresh_token" text NOT NULL,
127 "xata_createdat" timestamp DEFAULT now() NOT NULL,
128 "xata_updatedat" timestamp DEFAULT now() NOT NULL
129);
130--> statement-breakpoint
131CREATE 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
140CREATE 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
151CREATE 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
164CREATE 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
177CREATE TABLE "google_drive_tokens" (
178 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
179 "refresh_token" text NOT NULL,
180 "xata_createdat" timestamp DEFAULT now() NOT NULL,
181 "xata_updatedat" timestamp DEFAULT now() NOT NULL
182);
183--> statement-breakpoint
184CREATE 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
193CREATE TABLE "loved_tracks" (
194 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
195 "user_id" text NOT NULL,
196 "track_id" text NOT NULL,
197 "uri" text,
198 "xata_createdat" timestamp DEFAULT now() NOT NULL,
199 CONSTRAINT "loved_tracks_uri_unique" UNIQUE("uri")
200);
201--> statement-breakpoint
202CREATE TABLE "playlist_tracks" (
203 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
204 "playlist_id" text NOT NULL,
205 "track_id" text NOT NULL,
206 "xata_createdat" timestamp DEFAULT now() NOT NULL
207);
208--> statement-breakpoint
209CREATE TABLE "playlists" (
210 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
211 "name" text NOT NULL,
212 "picture" text,
213 "description" text,
214 "uri" text,
215 "spotify_link" text,
216 "tidal_link" text,
217 "apple_music_link" text,
218 "created_by" text NOT NULL,
219 "xata_createdat" timestamp DEFAULT now() NOT NULL,
220 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
221 CONSTRAINT "playlists_uri_unique" UNIQUE("uri")
222);
223--> statement-breakpoint
224CREATE TABLE "profile_shouts" (
225 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
226 "user_id" text NOT NULL,
227 "shout_id" text NOT NULL,
228 "xata_createdat" timestamp DEFAULT now() NOT NULL
229);
230--> statement-breakpoint
231CREATE 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
242CREATE TABLE "scrobbles" (
243 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
244 "user_id" text,
245 "track_id" text,
246 "album_id" text,
247 "artist_id" text,
248 "uri" text,
249 "xata_createdat" timestamp DEFAULT now() NOT NULL,
250 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
251 "xata_version" integer,
252 "timestamp" timestamp DEFAULT now() NOT NULL,
253 CONSTRAINT "scrobbles_uri_unique" UNIQUE("uri")
254);
255--> statement-breakpoint
256CREATE TABLE "shout_likes" (
257 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
258 "user_id" text NOT NULL,
259 "shout_id" text NOT NULL,
260 "xata_createdat" timestamp DEFAULT now() NOT NULL,
261 "uri" text NOT NULL,
262 CONSTRAINT "shout_likes_uri_unique" UNIQUE("uri")
263);
264--> statement-breakpoint
265CREATE TABLE "shout_reports" (
266 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
267 "user_id" text NOT NULL,
268 "shout_id" text NOT NULL,
269 "xata_createdat" timestamp DEFAULT now() NOT NULL
270);
271--> statement-breakpoint
272CREATE TABLE "shouts" (
273 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
274 "content" text NOT NULL,
275 "track_id" text,
276 "artist_id" text,
277 "album_id" text,
278 "scrobble_id" text,
279 "uri" text NOT NULL,
280 "author_id" text NOT NULL,
281 "parent_id" text,
282 "xata_createdat" timestamp DEFAULT now() NOT NULL,
283 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
284 CONSTRAINT "shouts_uri_unique" UNIQUE("uri")
285);
286--> statement-breakpoint
287CREATE TABLE "spotify_accounts" (
288 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
289 "xata_version" integer NOT NULL,
290 "email" text NOT NULL,
291 "user_id" text NOT NULL,
292 "is_beta_user" boolean DEFAULT false NOT NULL,
293 "xata_createdat" timestamp DEFAULT now() NOT NULL,
294 "xata_updatedat" timestamp DEFAULT now() NOT NULL
295);
296--> statement-breakpoint
297CREATE TABLE "spotify_tokens" (
298 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
299 "xata_version" integer NOT NULL,
300 "access_token" text NOT NULL,
301 "refresh_token" text NOT NULL,
302 "user_id" text NOT NULL,
303 "xata_createdat" timestamp DEFAULT now() NOT NULL,
304 "xata_updatedat" timestamp DEFAULT now() NOT NULL
305);
306--> statement-breakpoint
307CREATE TABLE "tracks" (
308 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
309 "title" text NOT NULL,
310 "artist" text NOT NULL,
311 "album_artist" text NOT NULL,
312 "album_art" text,
313 "album" text NOT NULL,
314 "track_number" integer,
315 "duration" integer NOT NULL,
316 "mb_id" text,
317 "youtube_link" text,
318 "spotify_link" text,
319 "apple_music_link" text,
320 "tidal_link" text,
321 "sha256" text NOT NULL,
322 "disc_number" integer,
323 "lyrics" text,
324 "composer" text,
325 "genre" text,
326 "label" text,
327 "copyright_message" text,
328 "uri" text,
329 "album_uri" text,
330 "artist_uri" text,
331 "xata_createdat" timestamp DEFAULT now() NOT NULL,
332 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
333 "xata_version" integer,
334 CONSTRAINT "tracks_mb_id_unique" UNIQUE("mb_id"),
335 CONSTRAINT "tracks_youtube_link_unique" UNIQUE("youtube_link"),
336 CONSTRAINT "tracks_spotify_link_unique" UNIQUE("spotify_link"),
337 CONSTRAINT "tracks_apple_music_link_unique" UNIQUE("apple_music_link"),
338 CONSTRAINT "tracks_tidal_link_unique" UNIQUE("tidal_link"),
339 CONSTRAINT "tracks_sha256_unique" UNIQUE("sha256"),
340 CONSTRAINT "tracks_uri_unique" UNIQUE("uri"),
341 CONSTRAINT "tracks_album_uri_unique" UNIQUE("album_uri"),
342 CONSTRAINT "tracks_artist_uri_unique" UNIQUE("artist_uri")
343);
344--> statement-breakpoint
345CREATE TABLE "user_albums" (
346 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
347 "user_id" text NOT NULL,
348 "album_id" text NOT NULL,
349 "xata_createdat" timestamp DEFAULT now() NOT NULL,
350 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
351 "xata_version" integer NOT NULL,
352 "scrobbles" integer,
353 "uri" text NOT NULL,
354 CONSTRAINT "user_albums_uri_unique" UNIQUE("uri")
355);
356--> statement-breakpoint
357CREATE TABLE "user_artists" (
358 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
359 "user_id" text NOT NULL,
360 "artist_id" text NOT NULL,
361 "xata_createdat" timestamp DEFAULT now() NOT NULL,
362 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
363 "xata_version" integer NOT NULL,
364 "scrobbles" integer,
365 "uri" text NOT NULL,
366 CONSTRAINT "user_artists_uri_unique" UNIQUE("uri")
367);
368--> statement-breakpoint
369CREATE TABLE "user_playlists" (
370 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
371 "user_id" text NOT NULL,
372 "playlist_id" text NOT NULL,
373 "xata_createdat" timestamp DEFAULT now() NOT NULL,
374 "uri" text NOT NULL,
375 CONSTRAINT "user_playlists_uri_unique" UNIQUE("uri")
376);
377--> statement-breakpoint
378CREATE TABLE "user_tracks" (
379 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
380 "user_id" text NOT NULL,
381 "track_id" text NOT NULL,
382 "xata_createdat" timestamp DEFAULT now() NOT NULL,
383 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
384 "xata_version" integer NOT NULL,
385 "uri" text NOT NULL,
386 "scrobbles" integer,
387 CONSTRAINT "user_tracks_uri_unique" UNIQUE("uri")
388);
389--> statement-breakpoint
390CREATE TABLE "users" (
391 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
392 "did" text NOT NULL,
393 "display_name" text NOT NULL,
394 "handle" text NOT NULL,
395 "avatar" text NOT NULL,
396 "xata_createdat" timestamp DEFAULT now() NOT NULL,
397 "xata_updatedat" timestamp DEFAULT now() NOT NULL,
398 "xata_version" integer,
399 CONSTRAINT "users_did_unique" UNIQUE("did"),
400 CONSTRAINT "users_handle_unique" UNIQUE("handle")
401);
402--> statement-breakpoint
403CREATE TABLE "webscrobblers" (
404 "xata_id" text PRIMARY KEY DEFAULT xata_id(),
405 "name" text NOT NULL,
406 "uuid" text NOT NULL,
407 "description" text,
408 "enabled" boolean DEFAULT true NOT NULL,
409 "user_id" text NOT NULL,
410 "xata_createdat" timestamp DEFAULT now() NOT NULL,
411 "xata_updatedat" timestamp DEFAULT now() NOT NULL
412);
413--> statement-breakpoint
414ALTER TABLE "album_tracks" ADD CONSTRAINT "album_tracks_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
415ALTER TABLE "album_tracks" ADD CONSTRAINT "album_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
416ALTER TABLE "api_keys" ADD CONSTRAINT "api_keys_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
417ALTER TABLE "artist_albums" ADD CONSTRAINT "artist_albums_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
418ALTER 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
419ALTER 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
420ALTER 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
421ALTER 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
422ALTER 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
423ALTER 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
424ALTER 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
425ALTER 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
426ALTER 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
427ALTER 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
428ALTER 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
429ALTER 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
430ALTER 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
431ALTER 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
432ALTER 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
433ALTER 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
434ALTER TABLE "playlist_tracks" ADD CONSTRAINT "playlist_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
435ALTER 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
436ALTER 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
437ALTER 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
438ALTER 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
439ALTER 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
440ALTER 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
441ALTER 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
442ALTER 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
443ALTER TABLE "scrobbles" ADD CONSTRAINT "scrobbles_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
444ALTER TABLE "shout_likes" ADD CONSTRAINT "shout_likes_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
445ALTER TABLE "shout_likes" ADD CONSTRAINT "shout_likes_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
446ALTER TABLE "shout_reports" ADD CONSTRAINT "shout_reports_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
447ALTER TABLE "shout_reports" ADD CONSTRAINT "shout_reports_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
448ALTER TABLE "shouts" ADD CONSTRAINT "shouts_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
449ALTER TABLE "shouts" ADD CONSTRAINT "shouts_artist_id_users_xata_id_fk" FOREIGN KEY ("artist_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
450ALTER TABLE "shouts" ADD CONSTRAINT "shouts_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
451ALTER TABLE "shouts" ADD CONSTRAINT "shouts_scrobble_id_scrobbles_xata_id_fk" FOREIGN KEY ("scrobble_id") REFERENCES "public"."scrobbles"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
452ALTER TABLE "shouts" ADD CONSTRAINT "shouts_author_id_users_xata_id_fk" FOREIGN KEY ("author_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
453ALTER TABLE "shouts" ADD CONSTRAINT "shouts_parent_id_shouts_xata_id_fk" FOREIGN KEY ("parent_id") REFERENCES "public"."shouts"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
454ALTER TABLE "spotify_accounts" ADD CONSTRAINT "spotify_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
455ALTER TABLE "spotify_tokens" ADD CONSTRAINT "spotify_tokens_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
456ALTER TABLE "user_albums" ADD CONSTRAINT "user_albums_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
457ALTER TABLE "user_albums" ADD CONSTRAINT "user_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
458ALTER TABLE "user_artists" ADD CONSTRAINT "user_artists_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
459ALTER TABLE "user_artists" ADD CONSTRAINT "user_artists_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
460ALTER TABLE "user_playlists" ADD CONSTRAINT "user_playlists_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
461ALTER TABLE "user_playlists" ADD CONSTRAINT "user_playlists_playlist_id_tracks_xata_id_fk" FOREIGN KEY ("playlist_id") REFERENCES "public"."tracks"("xata_id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
462ALTER TABLE "user_tracks" ADD CONSTRAINT "user_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
463ALTER TABLE "user_tracks" ADD CONSTRAINT "user_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
464ALTER TABLE "webscrobblers" ADD CONSTRAINT "webscrobblers_user_id_users_xata_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("xata_id") ON DELETE no action ON UPDATE no action;