From 692a1fa204c2aa2bcd7219993c8b91c814c4720c Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Mon, 6 Oct 2025 13:49:30 +0300 Subject: [PATCH] feat: update user playlists schema and related functionality - Added new entries to the journal for tracking purposes. - Changed the import from tracks to playlists in user-playlists schema. - Updated the playlistId reference in user-playlists to point to playlists instead of tracks. - Modified the insert_album_track function to remove xata_createdat from the insert statement. - Updated the insert_playlist_track function to remove added_by from the insert statement. - Removed added_by field from the PlaylistTrack struct in xata. --- apps/api/drizzle/0001_fluffy_epoch.sql | 1 + apps/api/drizzle/0002_sweet_randall_flagg.sql | 3 + apps/api/drizzle/meta/0001_snapshot.json | 3132 +++++++++++++++++ apps/api/drizzle/meta/0002_snapshot.json | 3132 +++++++++++++++++ apps/api/drizzle/meta/_journal.json | 14 + apps/api/src/schema/user-playlists.ts | 6 +- crates/pgpull/src/repo/album.rs | 3 +- crates/pgpull/src/repo/playlist.rs | 4 +- crates/pgpull/src/xata/playlist_track.rs | 1 - 9 files changed, 6287 insertions(+), 9 deletions(-) create mode 100644 apps/api/drizzle/0001_fluffy_epoch.sql create mode 100644 apps/api/drizzle/0002_sweet_randall_flagg.sql create mode 100644 apps/api/drizzle/meta/0001_snapshot.json create mode 100644 apps/api/drizzle/meta/0002_snapshot.json diff --git a/apps/api/drizzle/0001_fluffy_epoch.sql b/apps/api/drizzle/0001_fluffy_epoch.sql new file mode 100644 index 00000000..84a76322 --- /dev/null +++ b/apps/api/drizzle/0001_fluffy_epoch.sql @@ -0,0 +1 @@ +ALTER TABLE "user_playlists" ALTER COLUMN "uri" DROP NOT NULL; \ No newline at end of file diff --git a/apps/api/drizzle/0002_sweet_randall_flagg.sql b/apps/api/drizzle/0002_sweet_randall_flagg.sql new file mode 100644 index 00000000..8e565437 --- /dev/null +++ b/apps/api/drizzle/0002_sweet_randall_flagg.sql @@ -0,0 +1,3 @@ +ALTER TABLE "user_playlists" DROP CONSTRAINT "user_playlists_playlist_id_tracks_xata_id_fk"; +--> statement-breakpoint +ALTER TABLE "user_playlists" ADD CONSTRAINT "user_playlists_playlist_id_playlists_xata_id_fk" FOREIGN KEY ("playlist_id") REFERENCES "public"."playlists"("xata_id") ON DELETE no action ON UPDATE no action; \ No newline at end of file diff --git a/apps/api/drizzle/meta/0001_snapshot.json b/apps/api/drizzle/meta/0001_snapshot.json new file mode 100644 index 00000000..caa1aa79 --- /dev/null +++ b/apps/api/drizzle/meta/0001_snapshot.json @@ -0,0 +1,3132 @@ +{ + "id": "6ebb9775-b900-418c-bbd8-b704571a20d5", + "prevId": "6b33dcd0-52df-4403-bdc0-31517769923d", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.album_tracks": { + "name": "album_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "album_tracks_album_id_albums_xata_id_fk": { + "name": "album_tracks_album_id_albums_xata_id_fk", + "tableFrom": "album_tracks", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "album_tracks_track_id_tracks_xata_id_fk": { + "name": "album_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "album_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.albums": { + "name": "albums", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "artist": { + "name": "artist", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "release_date": { + "name": "release_date", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "album_art": { + "name": "album_art", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_uri": { + "name": "artist_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "youtube_link": { + "name": "youtube_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "albums_uri_unique": { + "name": "albums_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + }, + "albums_apple_music_link_unique": { + "name": "albums_apple_music_link_unique", + "nullsNotDistinct": false, + "columns": [ + "apple_music_link" + ] + }, + "albums_spotify_link_unique": { + "name": "albums_spotify_link_unique", + "nullsNotDistinct": false, + "columns": [ + "spotify_link" + ] + }, + "albums_tidal_link_unique": { + "name": "albums_tidal_link_unique", + "nullsNotDistinct": false, + "columns": [ + "tidal_link" + ] + }, + "albums_youtube_link_unique": { + "name": "albums_youtube_link_unique", + "nullsNotDistinct": false, + "columns": [ + "youtube_link" + ] + }, + "albums_sha256_unique": { + "name": "albums_sha256_unique", + "nullsNotDistinct": false, + "columns": [ + "sha256" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.api_keys": { + "name": "api_keys", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "api_key": { + "name": "api_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shared_secret": { + "name": "shared_secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "api_keys_user_id_users_xata_id_fk": { + "name": "api_keys_user_id_users_xata_id_fk", + "tableFrom": "api_keys", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.artist_albums": { + "name": "artist_albums", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "artist_albums_artist_id_artists_xata_id_fk": { + "name": "artist_albums_artist_id_artists_xata_id_fk", + "tableFrom": "artist_albums", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "artist_albums_album_id_albums_xata_id_fk": { + "name": "artist_albums_album_id_albums_xata_id_fk", + "tableFrom": "artist_albums", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.artist_tracks": { + "name": "artist_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "artist_tracks_artist_id_artists_xata_id_fk": { + "name": "artist_tracks_artist_id_artists_xata_id_fk", + "tableFrom": "artist_tracks", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "artist_tracks_track_id_tracks_xata_id_fk": { + "name": "artist_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "artist_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.artists": { + "name": "artists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "biography": { + "name": "biography", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "born": { + "name": "born", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "born_in": { + "name": "born_in", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "died": { + "name": "died", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "picture": { + "name": "picture", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "youtube_link": { + "name": "youtube_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "genres": { + "name": "genres", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "artists_sha256_unique": { + "name": "artists_sha256_unique", + "nullsNotDistinct": false, + "columns": [ + "sha256" + ] + }, + "artists_uri_unique": { + "name": "artists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_accounts": { + "name": "dropbox_accounts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_beta_user": { + "name": "is_beta_user", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_accounts_user_id_users_xata_id_fk": { + "name": "dropbox_accounts_user_id_users_xata_id_fk", + "tableFrom": "dropbox_accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dropbox_accounts_email_unique": { + "name": "dropbox_accounts_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_directories": { + "name": "dropbox_directories", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dropbox_id": { + "name": "dropbox_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_directories_parent_id_dropbox_directories_xata_id_fk": { + "name": "dropbox_directories_parent_id_dropbox_directories_xata_id_fk", + "tableFrom": "dropbox_directories", + "tableTo": "dropbox_directories", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dropbox_directories_file_id_unique": { + "name": "dropbox_directories_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_paths": { + "name": "dropbox_paths", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dropbox_id": { + "name": "dropbox_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "directory_id": { + "name": "directory_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_paths_directory_id_dropbox_directories_xata_id_fk": { + "name": "dropbox_paths_directory_id_dropbox_directories_xata_id_fk", + "tableFrom": "dropbox_paths", + "tableTo": "dropbox_directories", + "columnsFrom": [ + "directory_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dropbox_paths_file_id_unique": { + "name": "dropbox_paths_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_tokens": { + "name": "dropbox_tokens", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox": { + "name": "dropbox", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dropbox_token_id": { + "name": "dropbox_token_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_user_id_users_xata_id_fk": { + "name": "dropbox_user_id_users_xata_id_fk", + "tableFrom": "dropbox", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk": { + "name": "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk", + "tableFrom": "dropbox", + "tableTo": "dropbox_tokens", + "columnsFrom": [ + "dropbox_token_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_accounts": { + "name": "google_drive_accounts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_beta_user": { + "name": "is_beta_user", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_accounts_user_id_users_xata_id_fk": { + "name": "google_drive_accounts_user_id_users_xata_id_fk", + "tableFrom": "google_drive_accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "google_drive_accounts_email_unique": { + "name": "google_drive_accounts_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_directories": { + "name": "google_drive_directories", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "google_drive_id": { + "name": "google_drive_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_directories_parent_id_google_drive_directories_xata_id_fk": { + "name": "google_drive_directories_parent_id_google_drive_directories_xata_id_fk", + "tableFrom": "google_drive_directories", + "tableTo": "google_drive_directories", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "google_drive_directories_file_id_unique": { + "name": "google_drive_directories_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_paths": { + "name": "google_drive_paths", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "google_drive_id": { + "name": "google_drive_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "directory_id": { + "name": "directory_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_paths_directory_id_google_drive_directories_xata_id_fk": { + "name": "google_drive_paths_directory_id_google_drive_directories_xata_id_fk", + "tableFrom": "google_drive_paths", + "tableTo": "google_drive_directories", + "columnsFrom": [ + "directory_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "google_drive_paths_file_id_unique": { + "name": "google_drive_paths_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_tokens": { + "name": "google_drive_tokens", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive": { + "name": "google_drive", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "google_drive_token_id": { + "name": "google_drive_token_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk": { + "name": "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk", + "tableFrom": "google_drive", + "tableTo": "google_drive_tokens", + "columnsFrom": [ + "google_drive_token_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "google_drive_user_id_users_xata_id_fk": { + "name": "google_drive_user_id_users_xata_id_fk", + "tableFrom": "google_drive", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.loved_tracks": { + "name": "loved_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "loved_tracks_user_id_users_xata_id_fk": { + "name": "loved_tracks_user_id_users_xata_id_fk", + "tableFrom": "loved_tracks", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "loved_tracks_track_id_tracks_xata_id_fk": { + "name": "loved_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "loved_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "loved_tracks_uri_unique": { + "name": "loved_tracks_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.playlist_tracks": { + "name": "playlist_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "playlist_id": { + "name": "playlist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "playlist_tracks_playlist_id_playlists_xata_id_fk": { + "name": "playlist_tracks_playlist_id_playlists_xata_id_fk", + "tableFrom": "playlist_tracks", + "tableTo": "playlists", + "columnsFrom": [ + "playlist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "playlist_tracks_track_id_tracks_xata_id_fk": { + "name": "playlist_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "playlist_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.playlists": { + "name": "playlists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "picture": { + "name": "picture", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "playlists_created_by_users_xata_id_fk": { + "name": "playlists_created_by_users_xata_id_fk", + "tableFrom": "playlists", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "playlists_uri_unique": { + "name": "playlists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_shouts": { + "name": "profile_shouts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shout_id": { + "name": "shout_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "profile_shouts_user_id_users_xata_id_fk": { + "name": "profile_shouts_user_id_users_xata_id_fk", + "tableFrom": "profile_shouts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "profile_shouts_shout_id_shouts_xata_id_fk": { + "name": "profile_shouts_shout_id_shouts_xata_id_fk", + "tableFrom": "profile_shouts", + "tableTo": "shouts", + "columnsFrom": [ + "shout_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.queue_tracks": { + "name": "queue_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "file_uri": { + "name": "file_uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "queue_tracks_user_id_users_xata_id_fk": { + "name": "queue_tracks_user_id_users_xata_id_fk", + "tableFrom": "queue_tracks", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "queue_tracks_track_id_tracks_xata_id_fk": { + "name": "queue_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "queue_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scrobbles": { + "name": "scrobbles", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "scrobbles_user_id_users_xata_id_fk": { + "name": "scrobbles_user_id_users_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "scrobbles_track_id_tracks_xata_id_fk": { + "name": "scrobbles_track_id_tracks_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "scrobbles_album_id_albums_xata_id_fk": { + "name": "scrobbles_album_id_albums_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "scrobbles_artist_id_artists_xata_id_fk": { + "name": "scrobbles_artist_id_artists_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "scrobbles_uri_unique": { + "name": "scrobbles_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shout_likes": { + "name": "shout_likes", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shout_id": { + "name": "shout_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "shout_likes_user_id_users_xata_id_fk": { + "name": "shout_likes_user_id_users_xata_id_fk", + "tableFrom": "shout_likes", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shout_likes_shout_id_shouts_xata_id_fk": { + "name": "shout_likes_shout_id_shouts_xata_id_fk", + "tableFrom": "shout_likes", + "tableTo": "shouts", + "columnsFrom": [ + "shout_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "shout_likes_uri_unique": { + "name": "shout_likes_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shout_reports": { + "name": "shout_reports", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shout_id": { + "name": "shout_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "shout_reports_user_id_users_xata_id_fk": { + "name": "shout_reports_user_id_users_xata_id_fk", + "tableFrom": "shout_reports", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shout_reports_shout_id_shouts_xata_id_fk": { + "name": "shout_reports_shout_id_shouts_xata_id_fk", + "tableFrom": "shout_reports", + "tableTo": "shouts", + "columnsFrom": [ + "shout_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shouts": { + "name": "shouts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scrobble_id": { + "name": "scrobble_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "shouts_track_id_tracks_xata_id_fk": { + "name": "shouts_track_id_tracks_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_artist_id_users_xata_id_fk": { + "name": "shouts_artist_id_users_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "users", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_album_id_albums_xata_id_fk": { + "name": "shouts_album_id_albums_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_scrobble_id_scrobbles_xata_id_fk": { + "name": "shouts_scrobble_id_scrobbles_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "scrobbles", + "columnsFrom": [ + "scrobble_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_author_id_users_xata_id_fk": { + "name": "shouts_author_id_users_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "users", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_parent_id_shouts_xata_id_fk": { + "name": "shouts_parent_id_shouts_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "shouts", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "shouts_uri_unique": { + "name": "shouts_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.spotify_accounts": { + "name": "spotify_accounts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_beta_user": { + "name": "is_beta_user", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "spotify_accounts_user_id_users_xata_id_fk": { + "name": "spotify_accounts_user_id_users_xata_id_fk", + "tableFrom": "spotify_accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.spotify_tokens": { + "name": "spotify_tokens", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "spotify_tokens_user_id_users_xata_id_fk": { + "name": "spotify_tokens_user_id_users_xata_id_fk", + "tableFrom": "spotify_tokens", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tracks": { + "name": "tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "artist": { + "name": "artist", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_artist": { + "name": "album_artist", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_art": { + "name": "album_art", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album": { + "name": "album", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_number": { + "name": "track_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "duration": { + "name": "duration", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "mb_id": { + "name": "mb_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "youtube_link": { + "name": "youtube_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "disc_number": { + "name": "disc_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "lyrics": { + "name": "lyrics", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "composer": { + "name": "composer", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "genre": { + "name": "genre", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "copyright_message": { + "name": "copyright_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album_uri": { + "name": "album_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_uri": { + "name": "artist_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tracks_mb_id_unique": { + "name": "tracks_mb_id_unique", + "nullsNotDistinct": false, + "columns": [ + "mb_id" + ] + }, + "tracks_youtube_link_unique": { + "name": "tracks_youtube_link_unique", + "nullsNotDistinct": false, + "columns": [ + "youtube_link" + ] + }, + "tracks_spotify_link_unique": { + "name": "tracks_spotify_link_unique", + "nullsNotDistinct": false, + "columns": [ + "spotify_link" + ] + }, + "tracks_apple_music_link_unique": { + "name": "tracks_apple_music_link_unique", + "nullsNotDistinct": false, + "columns": [ + "apple_music_link" + ] + }, + "tracks_tidal_link_unique": { + "name": "tracks_tidal_link_unique", + "nullsNotDistinct": false, + "columns": [ + "tidal_link" + ] + }, + "tracks_sha256_unique": { + "name": "tracks_sha256_unique", + "nullsNotDistinct": false, + "columns": [ + "sha256" + ] + }, + "tracks_uri_unique": { + "name": "tracks_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_albums": { + "name": "user_albums", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "scrobbles": { + "name": "scrobbles", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_albums_user_id_users_xata_id_fk": { + "name": "user_albums_user_id_users_xata_id_fk", + "tableFrom": "user_albums", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_albums_album_id_albums_xata_id_fk": { + "name": "user_albums_album_id_albums_xata_id_fk", + "tableFrom": "user_albums", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_albums_uri_unique": { + "name": "user_albums_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_artists": { + "name": "user_artists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "scrobbles": { + "name": "scrobbles", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_artists_user_id_users_xata_id_fk": { + "name": "user_artists_user_id_users_xata_id_fk", + "tableFrom": "user_artists", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_artists_artist_id_artists_xata_id_fk": { + "name": "user_artists_artist_id_artists_xata_id_fk", + "tableFrom": "user_artists", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_artists_uri_unique": { + "name": "user_artists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_playlists": { + "name": "user_playlists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "playlist_id": { + "name": "playlist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_playlists_user_id_users_xata_id_fk": { + "name": "user_playlists_user_id_users_xata_id_fk", + "tableFrom": "user_playlists", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_playlists_playlist_id_tracks_xata_id_fk": { + "name": "user_playlists_playlist_id_tracks_xata_id_fk", + "tableFrom": "user_playlists", + "tableTo": "tracks", + "columnsFrom": [ + "playlist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_playlists_uri_unique": { + "name": "user_playlists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_tracks": { + "name": "user_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scrobbles": { + "name": "scrobbles", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_tracks_user_id_users_xata_id_fk": { + "name": "user_tracks_user_id_users_xata_id_fk", + "tableFrom": "user_tracks", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_tracks_track_id_tracks_xata_id_fk": { + "name": "user_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "user_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_tracks_uri_unique": { + "name": "user_tracks_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "did": { + "name": "did", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "handle": { + "name": "handle", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "avatar": { + "name": "avatar", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_did_unique": { + "name": "users_did_unique", + "nullsNotDistinct": false, + "columns": [ + "did" + ] + }, + "users_handle_unique": { + "name": "users_handle_unique", + "nullsNotDistinct": false, + "columns": [ + "handle" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.webscrobblers": { + "name": "webscrobblers", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "webscrobblers_user_id_users_xata_id_fk": { + "name": "webscrobblers_user_id_users_xata_id_fk", + "tableFrom": "webscrobblers", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/apps/api/drizzle/meta/0002_snapshot.json b/apps/api/drizzle/meta/0002_snapshot.json new file mode 100644 index 00000000..9b803123 --- /dev/null +++ b/apps/api/drizzle/meta/0002_snapshot.json @@ -0,0 +1,3132 @@ +{ + "id": "3ef49661-fdf0-4245-8943-ff69567a09b9", + "prevId": "6ebb9775-b900-418c-bbd8-b704571a20d5", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.album_tracks": { + "name": "album_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "album_tracks_album_id_albums_xata_id_fk": { + "name": "album_tracks_album_id_albums_xata_id_fk", + "tableFrom": "album_tracks", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "album_tracks_track_id_tracks_xata_id_fk": { + "name": "album_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "album_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.albums": { + "name": "albums", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "artist": { + "name": "artist", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "release_date": { + "name": "release_date", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "year": { + "name": "year", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "album_art": { + "name": "album_art", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_uri": { + "name": "artist_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "youtube_link": { + "name": "youtube_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "albums_uri_unique": { + "name": "albums_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + }, + "albums_apple_music_link_unique": { + "name": "albums_apple_music_link_unique", + "nullsNotDistinct": false, + "columns": [ + "apple_music_link" + ] + }, + "albums_spotify_link_unique": { + "name": "albums_spotify_link_unique", + "nullsNotDistinct": false, + "columns": [ + "spotify_link" + ] + }, + "albums_tidal_link_unique": { + "name": "albums_tidal_link_unique", + "nullsNotDistinct": false, + "columns": [ + "tidal_link" + ] + }, + "albums_youtube_link_unique": { + "name": "albums_youtube_link_unique", + "nullsNotDistinct": false, + "columns": [ + "youtube_link" + ] + }, + "albums_sha256_unique": { + "name": "albums_sha256_unique", + "nullsNotDistinct": false, + "columns": [ + "sha256" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.api_keys": { + "name": "api_keys", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "api_key": { + "name": "api_key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shared_secret": { + "name": "shared_secret", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "api_keys_user_id_users_xata_id_fk": { + "name": "api_keys_user_id_users_xata_id_fk", + "tableFrom": "api_keys", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.artist_albums": { + "name": "artist_albums", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "artist_albums_artist_id_artists_xata_id_fk": { + "name": "artist_albums_artist_id_artists_xata_id_fk", + "tableFrom": "artist_albums", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "artist_albums_album_id_albums_xata_id_fk": { + "name": "artist_albums_album_id_albums_xata_id_fk", + "tableFrom": "artist_albums", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.artist_tracks": { + "name": "artist_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "artist_tracks_artist_id_artists_xata_id_fk": { + "name": "artist_tracks_artist_id_artists_xata_id_fk", + "tableFrom": "artist_tracks", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "artist_tracks_track_id_tracks_xata_id_fk": { + "name": "artist_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "artist_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.artists": { + "name": "artists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "biography": { + "name": "biography", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "born": { + "name": "born", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "born_in": { + "name": "born_in", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "died": { + "name": "died", + "type": "timestamp", + "primaryKey": false, + "notNull": false + }, + "picture": { + "name": "picture", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "youtube_link": { + "name": "youtube_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "genres": { + "name": "genres", + "type": "text[]", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "artists_sha256_unique": { + "name": "artists_sha256_unique", + "nullsNotDistinct": false, + "columns": [ + "sha256" + ] + }, + "artists_uri_unique": { + "name": "artists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_accounts": { + "name": "dropbox_accounts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_beta_user": { + "name": "is_beta_user", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_accounts_user_id_users_xata_id_fk": { + "name": "dropbox_accounts_user_id_users_xata_id_fk", + "tableFrom": "dropbox_accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dropbox_accounts_email_unique": { + "name": "dropbox_accounts_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_directories": { + "name": "dropbox_directories", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "dropbox_id": { + "name": "dropbox_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_directories_parent_id_dropbox_directories_xata_id_fk": { + "name": "dropbox_directories_parent_id_dropbox_directories_xata_id_fk", + "tableFrom": "dropbox_directories", + "tableTo": "dropbox_directories", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dropbox_directories_file_id_unique": { + "name": "dropbox_directories_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_paths": { + "name": "dropbox_paths", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dropbox_id": { + "name": "dropbox_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "directory_id": { + "name": "directory_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_paths_directory_id_dropbox_directories_xata_id_fk": { + "name": "dropbox_paths_directory_id_dropbox_directories_xata_id_fk", + "tableFrom": "dropbox_paths", + "tableTo": "dropbox_directories", + "columnsFrom": [ + "directory_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "dropbox_paths_file_id_unique": { + "name": "dropbox_paths_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox_tokens": { + "name": "dropbox_tokens", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.dropbox": { + "name": "dropbox", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "dropbox_token_id": { + "name": "dropbox_token_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "dropbox_user_id_users_xata_id_fk": { + "name": "dropbox_user_id_users_xata_id_fk", + "tableFrom": "dropbox", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk": { + "name": "dropbox_dropbox_token_id_dropbox_tokens_xata_id_fk", + "tableFrom": "dropbox", + "tableTo": "dropbox_tokens", + "columnsFrom": [ + "dropbox_token_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_accounts": { + "name": "google_drive_accounts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_beta_user": { + "name": "is_beta_user", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_accounts_user_id_users_xata_id_fk": { + "name": "google_drive_accounts_user_id_users_xata_id_fk", + "tableFrom": "google_drive_accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "google_drive_accounts_email_unique": { + "name": "google_drive_accounts_email_unique", + "nullsNotDistinct": false, + "columns": [ + "email" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_directories": { + "name": "google_drive_directories", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "path": { + "name": "path", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "google_drive_id": { + "name": "google_drive_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_directories_parent_id_google_drive_directories_xata_id_fk": { + "name": "google_drive_directories_parent_id_google_drive_directories_xata_id_fk", + "tableFrom": "google_drive_directories", + "tableTo": "google_drive_directories", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "google_drive_directories_file_id_unique": { + "name": "google_drive_directories_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_paths": { + "name": "google_drive_paths", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "google_drive_id": { + "name": "google_drive_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "directory_id": { + "name": "directory_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "file_id": { + "name": "file_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_paths_directory_id_google_drive_directories_xata_id_fk": { + "name": "google_drive_paths_directory_id_google_drive_directories_xata_id_fk", + "tableFrom": "google_drive_paths", + "tableTo": "google_drive_directories", + "columnsFrom": [ + "directory_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "google_drive_paths_file_id_unique": { + "name": "google_drive_paths_file_id_unique", + "nullsNotDistinct": false, + "columns": [ + "file_id" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive_tokens": { + "name": "google_drive_tokens", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.google_drive": { + "name": "google_drive", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "google_drive_token_id": { + "name": "google_drive_token_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk": { + "name": "google_drive_google_drive_token_id_google_drive_tokens_xata_id_fk", + "tableFrom": "google_drive", + "tableTo": "google_drive_tokens", + "columnsFrom": [ + "google_drive_token_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "google_drive_user_id_users_xata_id_fk": { + "name": "google_drive_user_id_users_xata_id_fk", + "tableFrom": "google_drive", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.loved_tracks": { + "name": "loved_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "loved_tracks_user_id_users_xata_id_fk": { + "name": "loved_tracks_user_id_users_xata_id_fk", + "tableFrom": "loved_tracks", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "loved_tracks_track_id_tracks_xata_id_fk": { + "name": "loved_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "loved_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "loved_tracks_uri_unique": { + "name": "loved_tracks_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.playlist_tracks": { + "name": "playlist_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "playlist_id": { + "name": "playlist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "playlist_tracks_playlist_id_playlists_xata_id_fk": { + "name": "playlist_tracks_playlist_id_playlists_xata_id_fk", + "tableFrom": "playlist_tracks", + "tableTo": "playlists", + "columnsFrom": [ + "playlist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "playlist_tracks_track_id_tracks_xata_id_fk": { + "name": "playlist_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "playlist_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.playlists": { + "name": "playlists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "picture": { + "name": "picture", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_by": { + "name": "created_by", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "playlists_created_by_users_xata_id_fk": { + "name": "playlists_created_by_users_xata_id_fk", + "tableFrom": "playlists", + "tableTo": "users", + "columnsFrom": [ + "created_by" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "playlists_uri_unique": { + "name": "playlists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.profile_shouts": { + "name": "profile_shouts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shout_id": { + "name": "shout_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "profile_shouts_user_id_users_xata_id_fk": { + "name": "profile_shouts_user_id_users_xata_id_fk", + "tableFrom": "profile_shouts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "profile_shouts_shout_id_shouts_xata_id_fk": { + "name": "profile_shouts_shout_id_shouts_xata_id_fk", + "tableFrom": "profile_shouts", + "tableTo": "shouts", + "columnsFrom": [ + "shout_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.queue_tracks": { + "name": "queue_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "position": { + "name": "position", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "file_uri": { + "name": "file_uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "queue_tracks_user_id_users_xata_id_fk": { + "name": "queue_tracks_user_id_users_xata_id_fk", + "tableFrom": "queue_tracks", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "queue_tracks_track_id_tracks_xata_id_fk": { + "name": "queue_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "queue_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scrobbles": { + "name": "scrobbles", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "timestamp": { + "name": "timestamp", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "scrobbles_user_id_users_xata_id_fk": { + "name": "scrobbles_user_id_users_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "scrobbles_track_id_tracks_xata_id_fk": { + "name": "scrobbles_track_id_tracks_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "scrobbles_album_id_albums_xata_id_fk": { + "name": "scrobbles_album_id_albums_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "scrobbles_artist_id_artists_xata_id_fk": { + "name": "scrobbles_artist_id_artists_xata_id_fk", + "tableFrom": "scrobbles", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "scrobbles_uri_unique": { + "name": "scrobbles_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shout_likes": { + "name": "shout_likes", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shout_id": { + "name": "shout_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "shout_likes_user_id_users_xata_id_fk": { + "name": "shout_likes_user_id_users_xata_id_fk", + "tableFrom": "shout_likes", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shout_likes_shout_id_shouts_xata_id_fk": { + "name": "shout_likes_shout_id_shouts_xata_id_fk", + "tableFrom": "shout_likes", + "tableTo": "shouts", + "columnsFrom": [ + "shout_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "shout_likes_uri_unique": { + "name": "shout_likes_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shout_reports": { + "name": "shout_reports", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shout_id": { + "name": "shout_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "shout_reports_user_id_users_xata_id_fk": { + "name": "shout_reports_user_id_users_xata_id_fk", + "tableFrom": "shout_reports", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shout_reports_shout_id_shouts_xata_id_fk": { + "name": "shout_reports_shout_id_shouts_xata_id_fk", + "tableFrom": "shout_reports", + "tableTo": "shouts", + "columnsFrom": [ + "shout_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.shouts": { + "name": "shouts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "scrobble_id": { + "name": "scrobble_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "author_id": { + "name": "author_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "parent_id": { + "name": "parent_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "shouts_track_id_tracks_xata_id_fk": { + "name": "shouts_track_id_tracks_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_artist_id_users_xata_id_fk": { + "name": "shouts_artist_id_users_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "users", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_album_id_albums_xata_id_fk": { + "name": "shouts_album_id_albums_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_scrobble_id_scrobbles_xata_id_fk": { + "name": "shouts_scrobble_id_scrobbles_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "scrobbles", + "columnsFrom": [ + "scrobble_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_author_id_users_xata_id_fk": { + "name": "shouts_author_id_users_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "users", + "columnsFrom": [ + "author_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "shouts_parent_id_shouts_xata_id_fk": { + "name": "shouts_parent_id_shouts_xata_id_fk", + "tableFrom": "shouts", + "tableTo": "shouts", + "columnsFrom": [ + "parent_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "shouts_uri_unique": { + "name": "shouts_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.spotify_accounts": { + "name": "spotify_accounts", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_beta_user": { + "name": "is_beta_user", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "spotify_accounts_user_id_users_xata_id_fk": { + "name": "spotify_accounts_user_id_users_xata_id_fk", + "tableFrom": "spotify_accounts", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.spotify_tokens": { + "name": "spotify_tokens", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "access_token": { + "name": "access_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "refresh_token": { + "name": "refresh_token", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "spotify_tokens_user_id_users_xata_id_fk": { + "name": "spotify_tokens_user_id_users_xata_id_fk", + "tableFrom": "spotify_tokens", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.tracks": { + "name": "tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "artist": { + "name": "artist", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_artist": { + "name": "album_artist", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_art": { + "name": "album_art", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album": { + "name": "album", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_number": { + "name": "track_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "duration": { + "name": "duration", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "mb_id": { + "name": "mb_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "youtube_link": { + "name": "youtube_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "spotify_link": { + "name": "spotify_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "apple_music_link": { + "name": "apple_music_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tidal_link": { + "name": "tidal_link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "sha256": { + "name": "sha256", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "disc_number": { + "name": "disc_number", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "lyrics": { + "name": "lyrics", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "composer": { + "name": "composer", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "genre": { + "name": "genre", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "label": { + "name": "label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "copyright_message": { + "name": "copyright_message", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "album_uri": { + "name": "album_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "artist_uri": { + "name": "artist_uri", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "tracks_mb_id_unique": { + "name": "tracks_mb_id_unique", + "nullsNotDistinct": false, + "columns": [ + "mb_id" + ] + }, + "tracks_youtube_link_unique": { + "name": "tracks_youtube_link_unique", + "nullsNotDistinct": false, + "columns": [ + "youtube_link" + ] + }, + "tracks_spotify_link_unique": { + "name": "tracks_spotify_link_unique", + "nullsNotDistinct": false, + "columns": [ + "spotify_link" + ] + }, + "tracks_apple_music_link_unique": { + "name": "tracks_apple_music_link_unique", + "nullsNotDistinct": false, + "columns": [ + "apple_music_link" + ] + }, + "tracks_tidal_link_unique": { + "name": "tracks_tidal_link_unique", + "nullsNotDistinct": false, + "columns": [ + "tidal_link" + ] + }, + "tracks_sha256_unique": { + "name": "tracks_sha256_unique", + "nullsNotDistinct": false, + "columns": [ + "sha256" + ] + }, + "tracks_uri_unique": { + "name": "tracks_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_albums": { + "name": "user_albums", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "album_id": { + "name": "album_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "scrobbles": { + "name": "scrobbles", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_albums_user_id_users_xata_id_fk": { + "name": "user_albums_user_id_users_xata_id_fk", + "tableFrom": "user_albums", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_albums_album_id_albums_xata_id_fk": { + "name": "user_albums_album_id_albums_xata_id_fk", + "tableFrom": "user_albums", + "tableTo": "albums", + "columnsFrom": [ + "album_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_albums_uri_unique": { + "name": "user_albums_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_artists": { + "name": "user_artists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "artist_id": { + "name": "artist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "scrobbles": { + "name": "scrobbles", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_artists_user_id_users_xata_id_fk": { + "name": "user_artists_user_id_users_xata_id_fk", + "tableFrom": "user_artists", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_artists_artist_id_artists_xata_id_fk": { + "name": "user_artists_artist_id_artists_xata_id_fk", + "tableFrom": "user_artists", + "tableTo": "artists", + "columnsFrom": [ + "artist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_artists_uri_unique": { + "name": "user_artists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_playlists": { + "name": "user_playlists", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "playlist_id": { + "name": "playlist_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_playlists_user_id_users_xata_id_fk": { + "name": "user_playlists_user_id_users_xata_id_fk", + "tableFrom": "user_playlists", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_playlists_playlist_id_playlists_xata_id_fk": { + "name": "user_playlists_playlist_id_playlists_xata_id_fk", + "tableFrom": "user_playlists", + "tableTo": "playlists", + "columnsFrom": [ + "playlist_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_playlists_uri_unique": { + "name": "user_playlists_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user_tracks": { + "name": "user_tracks", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "track_id": { + "name": "track_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "uri": { + "name": "uri", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "scrobbles": { + "name": "scrobbles", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_tracks_user_id_users_xata_id_fk": { + "name": "user_tracks_user_id_users_xata_id_fk", + "tableFrom": "user_tracks", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_tracks_track_id_tracks_xata_id_fk": { + "name": "user_tracks_track_id_tracks_xata_id_fk", + "tableFrom": "user_tracks", + "tableTo": "tracks", + "columnsFrom": [ + "track_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_tracks_uri_unique": { + "name": "user_tracks_uri_unique", + "nullsNotDistinct": false, + "columns": [ + "uri" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.users": { + "name": "users", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "did": { + "name": "did", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "display_name": { + "name": "display_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "handle": { + "name": "handle", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "avatar": { + "name": "avatar", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_version": { + "name": "xata_version", + "type": "integer", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "users_did_unique": { + "name": "users_did_unique", + "nullsNotDistinct": false, + "columns": [ + "did" + ] + }, + "users_handle_unique": { + "name": "users_handle_unique", + "nullsNotDistinct": false, + "columns": [ + "handle" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.webscrobblers": { + "name": "webscrobblers", + "schema": "", + "columns": { + "xata_id": { + "name": "xata_id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uuid": { + "name": "uuid", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "enabled": { + "name": "enabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "user_id": { + "name": "user_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "xata_createdat": { + "name": "xata_createdat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "xata_updatedat": { + "name": "xata_updatedat", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "webscrobblers_user_id_users_xata_id_fk": { + "name": "webscrobblers_user_id_users_xata_id_fk", + "tableFrom": "webscrobblers", + "tableTo": "users", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "xata_id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/apps/api/drizzle/meta/_journal.json b/apps/api/drizzle/meta/_journal.json index e47597fd..1cb432bc 100644 --- a/apps/api/drizzle/meta/_journal.json +++ b/apps/api/drizzle/meta/_journal.json @@ -8,6 +8,20 @@ "when": 1759744201158, "tag": "0000_left_swordsman", "breakpoints": true + }, + { + "idx": 1, + "version": "7", + "when": 1759746264036, + "tag": "0001_fluffy_epoch", + "breakpoints": true + }, + { + "idx": 2, + "version": "7", + "when": 1759747596050, + "tag": "0002_sweet_randall_flagg", + "breakpoints": true } ] } \ No newline at end of file diff --git a/apps/api/src/schema/user-playlists.ts b/apps/api/src/schema/user-playlists.ts index 72479362..7825353a 100644 --- a/apps/api/src/schema/user-playlists.ts +++ b/apps/api/src/schema/user-playlists.ts @@ -1,6 +1,6 @@ import type { InferInsertModel, InferSelectModel } from "drizzle-orm"; import { pgTable, text, timestamp } from "drizzle-orm/pg-core"; -import tracks from "./tracks"; +import playlists from "./playlists"; import users from "./users"; const userPlaylists = pgTable("user_playlists", { @@ -10,9 +10,9 @@ const userPlaylists = pgTable("user_playlists", { .references(() => users.id), playlistId: text("playlist_id") .notNull() - .references(() => tracks.id), + .references(() => playlists.id), createdAt: timestamp("xata_createdat").defaultNow().notNull(), - uri: text("uri").unique().notNull(), + uri: text("uri").unique(), }); export type SelectUserPlaylist = InferSelectModel; diff --git a/crates/pgpull/src/repo/album.rs b/crates/pgpull/src/repo/album.rs index d96c5d0d..10e9b1c8 100644 --- a/crates/pgpull/src/repo/album.rs +++ b/crates/pgpull/src/repo/album.rs @@ -92,8 +92,7 @@ pub async fn insert_album_track( r#"INSERT INTO album_tracks ( xata_id, album_id, - track_id, - xata_createdat + track_id ) VALUES ($1, $2, $3) ON CONFLICT (xata_id) DO NOTHING"#, ) diff --git a/crates/pgpull/src/repo/playlist.rs b/crates/pgpull/src/repo/playlist.rs index 2ae9db4c..f640f97f 100644 --- a/crates/pgpull/src/repo/playlist.rs +++ b/crates/pgpull/src/repo/playlist.rs @@ -86,15 +86,13 @@ pub async fn insert_playlist_track( xata_id, playlist_id, track_id, - added_by, xata_createdat - ) VALUES ($1, $2, $3, $4, $5) + ) VALUES ($1, $2, $3, $4) ON CONFLICT (xata_id) DO NOTHING"#, ) .bind(&playlist_track.xata_id) .bind(&playlist_track.playlist_id) .bind(&playlist_track.track_id) - .bind(&playlist_track.added_by) .bind(playlist_track.xata_createdat) .execute(pool) .await?; diff --git a/crates/pgpull/src/xata/playlist_track.rs b/crates/pgpull/src/xata/playlist_track.rs index b045a3f8..5bbea180 100644 --- a/crates/pgpull/src/xata/playlist_track.rs +++ b/crates/pgpull/src/xata/playlist_track.rs @@ -5,7 +5,6 @@ pub struct PlaylistTrack { pub xata_id: String, pub playlist_id: String, pub track_id: String, - pub added_by: String, #[serde(with = "chrono::serde::ts_seconds")] pub xata_createdat: chrono::DateTime, } -- 2.51.2