// Generated by Xata Codegen 0.30.1. Please do not edit. import { buildClient } from "@xata.io/client"; import type { BaseClientOptions, SchemaInference, XataRecord, } from "@xata.io/client"; const tables = [ { name: "album_tags", checkConstraints: { album_tags_xata_id_length_xata_id: { name: "album_tags_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { album_id_link: { name: "album_id_link", columns: ["album_id"], referencedTable: "albums", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, tag_id_link: { name: "tag_id_link", columns: ["tag_id"], referencedTable: "tags", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_album_tags_xata_id_key: { name: "_pgroll_new_album_tags_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "album_id", type: "link", link: { table: "albums" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"albums"}', }, { name: "tag_id", type: "link", link: { table: "tags" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tags"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "album_tracks", checkConstraints: { album_tracks_xata_id_length_xata_id: { name: "album_tracks_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { album_id_link: { name: "album_id_link", columns: ["album_id"], referencedTable: "albums", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_album_tracks_xata_id_key: { name: "_pgroll_new_album_tracks_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "album_id", type: "link", link: { table: "albums" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"albums"}', }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "albums", checkConstraints: { albums_xata_id_length_xata_id: { name: "albums_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_albums_xata_id_key: { name: "_pgroll_new_albums_xata_id_key", columns: ["xata_id"], }, albums__pgroll_new_sha256_key: { name: "albums__pgroll_new_sha256_key", columns: ["sha256"], }, albums__pgroll_new_uri_key: { name: "albums__pgroll_new_uri_key", columns: ["uri"], }, albums_apple_music_link_unique: { name: "albums_apple_music_link_unique", columns: ["apple_music_link"], }, albums_spotify_link_unique: { name: "albums_spotify_link_unique", columns: ["spotify_link"], }, }, columns: [ { name: "album_art", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "apple_music_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "artist", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "artist_uri", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "lastfm_link", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "release_date", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "sha256", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "spotify_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "tidal_link", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "title", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, { name: "year", type: "int", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "youtube_link", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, ], }, { name: "api_keys", checkConstraints: { api_keys_xata_id_length_xata_id: { name: "api_keys_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_api_keys_xata_id_key: { name: "_pgroll_new_api_keys_xata_id_key", columns: ["xata_id"], }, api_keys__pgroll_new_api_key_key: { name: "api_keys__pgroll_new_api_key_key", columns: ["api_key"], }, api_keys__pgroll_new_shared_secret_key: { name: "api_keys__pgroll_new_shared_secret_key", columns: ["shared_secret"], }, api_keys_name_unique: { name: "api_keys_name_unique", columns: ["name"] }, }, columns: [ { name: "api_key", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "description", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "enabled", type: "bool", notNull: true, unique: false, defaultValue: "true", comment: "", }, { name: "name", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "shared_secret", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "artist_albums", checkConstraints: { artist_albums_xata_id_length_xata_id: { name: "artist_albums_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { album_id_link: { name: "album_id_link", columns: ["album_id"], referencedTable: "albums", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, artist_id_link: { name: "artist_id_link", columns: ["artist_id"], referencedTable: "artists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_artist_albums_xata_id_key: { name: "_pgroll_new_artist_albums_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "album_id", type: "link", link: { table: "albums" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"albums"}', }, { name: "artist_id", type: "link", link: { table: "artists" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"artists"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "artist_tags", checkConstraints: { artist_tags_xata_id_length_xata_id: { name: "artist_tags_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { artist_id_link: { name: "artist_id_link", columns: ["artist_id"], referencedTable: "artists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, tag_id_link: { name: "tag_id_link", columns: ["tag_id"], referencedTable: "tags", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_artist_tags_xata_id_key: { name: "_pgroll_new_artist_tags_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "artist_id", type: "link", link: { table: "artists" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"artists"}', }, { name: "tag_id", type: "link", link: { table: "tags" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tags"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "artist_tracks", checkConstraints: { artist_tracks_xata_id_length_xata_id: { name: "artist_tracks_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { artist_id_link: { name: "artist_id_link", columns: ["artist_id"], referencedTable: "artists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_artist_tracks_xata_id_key: { name: "_pgroll_new_artist_tracks_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "artist_id", type: "link", link: { table: "artists" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"artists"}', }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "artists", checkConstraints: { artists_xata_id_length_xata_id: { name: "artists_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_artists_xata_id_key: { name: "_pgroll_new_artists_xata_id_key", columns: ["xata_id"], }, artists__pgroll_new_sha256_key: { name: "artists__pgroll_new_sha256_key", columns: ["sha256"], }, artists__pgroll_new_uri_key: { name: "artists__pgroll_new_uri_key", columns: ["uri"], }, artists_apple_music_link_unique: { name: "artists_apple_music_link_unique", columns: ["apple_music_link"], }, artists_spotify_link_unique: { name: "artists_spotify_link_unique", columns: ["spotify_link"], }, artists_tidal_link_unique: { name: "artists_tidal_link_unique", columns: ["tidal_link"], }, artists_youtube_link_unique: { name: "artists_youtube_link_unique", columns: ["youtube_link"], }, }, columns: [ { name: "apple_music_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "biography", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "born", type: "datetime", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "born_in", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "died", type: "datetime", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "lastfm_link", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "picture", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "sha256", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "spotify_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "tidal_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, { name: "youtube_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, ], }, { name: "builtin_storage_paths", checkConstraints: { builtin_storage_paths_xata_id_length_xata_id: { name: "builtin_storage_paths_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_builtin_storage_paths_xata_id_key: { name: "_pgroll_new_builtin_storage_paths_xata_id_key", columns: ["xata_id"], }, builtin_storage_paths__pgroll_new_path_key: { name: "builtin_storage_paths__pgroll_new_path_key", columns: ["path"], }, }, columns: [ { name: "path", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "dropbox", checkConstraints: { dropbox_xata_id_length_xata_id: { name: "dropbox_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { dropbox_token_id_link: { name: "dropbox_token_id_link", columns: ["dropbox_token_id"], referencedTable: "dropbox_tokens", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_dropbox_xata_id_key: { name: "_pgroll_new_dropbox_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "dropbox_token_id", type: "link", link: { table: "dropbox_tokens" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"dropbox_tokens"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "dropbox_accounts", checkConstraints: { dropbox_accounts_xata_id_length_xata_id: { name: "dropbox_accounts_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_dropbox_accounts_xata_id_key: { name: "_pgroll_new_dropbox_accounts_xata_id_key", columns: ["xata_id"], }, dropbox_accounts__pgroll_new_email_key: { name: "dropbox_accounts__pgroll_new_email_key", columns: ["email"], }, }, columns: [ { name: "email", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "is_beta_user", type: "bool", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "dropbox_paths", checkConstraints: { dropbox_paths_xata_id_length_xata_id: { name: "dropbox_paths_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { dropbox_id_link: { name: "dropbox_id_link", columns: ["dropbox_id"], referencedTable: "dropbox", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_dropbox_paths_xata_id_key: { name: "_pgroll_new_dropbox_paths_xata_id_key", columns: ["xata_id"], }, dropbox_paths__pgroll_new_file_id_key: { name: "dropbox_paths__pgroll_new_file_id_key", columns: ["file_id"], }, }, columns: [ { name: "dropbox_id", type: "link", link: { table: "dropbox" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"dropbox"}', }, { name: "file_id", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "path", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "dropbox_tokens", checkConstraints: { dropbox_tokens_xata_id_length_xata_id: { name: "dropbox_tokens_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_dropbox_tokens_xata_id_key: { name: "_pgroll_new_dropbox_tokens_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "refresh_token", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "google_drive", checkConstraints: { google_drive_xata_id_length_xata_id: { name: "google_drive_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { google_drive_token_id_link: { name: "google_drive_token_id_link", columns: ["google_drive_token_id"], referencedTable: "google_drive_tokens", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_google_drive_xata_id_key: { name: "_pgroll_new_google_drive_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "google_drive_token_id", type: "link", link: { table: "google_drive_tokens" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"google_drive_tokens"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "google_drive_accounts", checkConstraints: { google_drive_accounts_xata_id_length_xata_id: { name: "google_drive_accounts_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_google_drive_accounts_xata_id_key: { name: "_pgroll_new_google_drive_accounts_xata_id_key", columns: ["xata_id"], }, google_drive_accounts__pgroll_new_email_key: { name: "google_drive_accounts__pgroll_new_email_key", columns: ["email"], }, }, columns: [ { name: "email", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "is_beta_user", type: "bool", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "google_drive_paths", checkConstraints: { google_drive_paths_xata_id_length_xata_id: { name: "google_drive_paths_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { google_drive_id_link: { name: "google_drive_id_link", columns: ["google_drive_id"], referencedTable: "google_drive", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_google_drive_paths_xata_id_key: { name: "_pgroll_new_google_drive_paths_xata_id_key", columns: ["xata_id"], }, google_drive_paths__pgroll_new_google_drive_file_id_key: { name: "google_drive_paths__pgroll_new_google_drive_file_id_key", columns: ["file_id"], }, }, columns: [ { name: "file_id", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "google_drive_id", type: "link", link: { table: "google_drive" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"google_drive"}', }, { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "google_drive_tokens", checkConstraints: { google_drive_tokens_xata_id_length_xata_id: { name: "google_drive_tokens_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_google_drive_tokens_xata_id_key: { name: "_pgroll_new_google_drive_tokens_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "refresh_token", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "loved_tracks", checkConstraints: { loved_tracks_xata_id_length_xata_id: { name: "loved_tracks_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_loved_tracks_xata_id_key: { name: "_pgroll_new_loved_tracks_xata_id_key", columns: ["xata_id"], }, loved_tracks__pgroll_new_uri_key: { name: "loved_tracks__pgroll_new_uri_key", columns: ["uri"], }, }, columns: [ { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "playback_state", checkConstraints: { playback_states_xata_id_length_xata_id: { name: "playback_states_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_playback_states_xata_id_key: { name: "_pgroll_new_playback_states_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "progress_ms", type: "int", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "queue_position", type: "int", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "playlist_tracks", checkConstraints: { playlist_tracks_xata_id_length_xata_id: { name: "playlist_tracks_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { playlist_id_link: { name: "playlist_id_link", columns: ["playlist_id"], referencedTable: "playlists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_playlist_tracks_xata_id_key: { name: "_pgroll_new_playlist_tracks_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "playlist_id", type: "link", link: { table: "playlists" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"playlists"}', }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "playlists", checkConstraints: { playlists_xata_id_length_xata_id: { name: "playlists_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { created_by_link: { name: "created_by_link", columns: ["created_by"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_playlists_xata_id_key: { name: "_pgroll_new_playlists_xata_id_key", columns: ["xata_id"], }, playlists__pgroll_new_uri_key: { name: "playlists__pgroll_new_uri_key", columns: ["uri"], }, playlists_apple_music_link_unique: { name: "playlists_apple_music_link_unique", columns: ["apple_music_link"], }, playlists_spotify_link_unique: { name: "playlists_spotify_link_unique", columns: ["spotify_link"], }, playlists_tidal_link_unique: { name: "playlists_tidal_link_unique", columns: ["tidal_link"], }, }, columns: [ { name: "apple_music_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "created_by", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "description", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "picture", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "spotify_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "tidal_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "profile_shouts", checkConstraints: { profile_shouts_xata_id_length_xata_id: { name: "profile_shouts_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { shout_id_link: { name: "shout_id_link", columns: ["shout_id"], referencedTable: "shouts", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_profile_shouts_xata_id_key: { name: "_pgroll_new_profile_shouts_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "shout_id", type: "link", link: { table: "shouts" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"shouts"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "queue_tracks", checkConstraints: { queue_tracks_xata_id_length_xata_id: { name: "queue_tracks_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_queue_tracks_xata_id_key: { name: "_pgroll_new_queue_tracks_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "position", type: "int", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "radios", checkConstraints: { radios_xata_id_length_xata_id: { name: "radios_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_radios_xata_id_key: { name: "_pgroll_new_radios_xata_id_key", columns: ["xata_id"], }, radios__pgroll_new_uri_key: { name: "radios__pgroll_new_uri_key", columns: ["uri"], }, radios__pgroll_new_url_key: { name: "radios__pgroll_new_url_key", columns: ["url"], }, }, columns: [ { name: "description", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "genre", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "logo", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "url", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "website", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "s3_bucket", checkConstraints: { s3_xata_id_length_xata_id: { name: "s3_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { s3_token_id_link: { name: "s3_token_id_link", columns: ["s3_token_id"], referencedTable: "s3_tokens", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_s3_xata_id_key: { name: "_pgroll_new_s3_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "s3_token_id", type: "link", link: { table: "s3_tokens" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"s3_tokens"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "s3_paths", checkConstraints: { s3_paths_xata_id_length_xata_id: { name: "s3_paths_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { s3_bucket_id_link: { name: "s3_bucket_id_link", columns: ["s3_bucket_id"], referencedTable: "s3_bucket", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_s3_paths_xata_id_key: { name: "_pgroll_new_s3_paths_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "path", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "s3_bucket_id", type: "link", link: { table: "s3_bucket" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"s3_bucket"}', }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "s3_tokens", checkConstraints: { s3_tokens_xata_id_length_xata_id: { name: "s3_tokens_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_s3_tokens_xata_id_key: { name: "_pgroll_new_s3_tokens_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "client_access_key", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "secret_access_key", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "scrobbles", checkConstraints: { scrobbles_xata_id_length_xata_id: { name: "scrobbles_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { album_id_link: { name: "album_id_link", columns: ["album_id"], referencedTable: "albums", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, artist_id_link: { name: "artist_id_link", columns: ["artist_id"], referencedTable: "artists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_scrobbles_xata_id_key: { name: "_pgroll_new_scrobbles_xata_id_key", columns: ["xata_id"], }, scrobbles_uri_unique: { name: "scrobbles_uri_unique", columns: ["uri"] }, }, columns: [ { name: "album_id", type: "link", link: { table: "albums" }, notNull: false, unique: false, defaultValue: null, comment: '{"xata.link":"albums"}', }, { name: "artist_id", type: "link", link: { table: "artists" }, notNull: false, unique: false, defaultValue: null, comment: '{"xata.link":"artists"}', }, { name: "timestamp", type: "datetime", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "sftp", checkConstraints: { sftp_xata_id_length_xata_id: { name: "sftp_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_sftp_xata_id_key: { name: "_pgroll_new_sftp_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "sftp_access", checkConstraints: { sftp_access_xata_id_length_xata_id: { name: "sftp_access_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_sftp_access_xata_id_key: { name: "_pgroll_new_sftp_access_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "sftp_path", checkConstraints: { sftp_path_xata_id_length_xata_id: { name: "sftp_path_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { sftp_id_link: { name: "sftp_id_link", columns: ["sftp_id"], referencedTable: "sftp", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_sftp_path_xata_id_key: { name: "_pgroll_new_sftp_path_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "path", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "sftp_id", type: "link", link: { table: "sftp" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"sftp"}', }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "shout_likes", checkConstraints: { shout_likes_xata_id_length_xata_id: { name: "shout_likes_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { shout_id_link: { name: "shout_id_link", columns: ["shout_id"], referencedTable: "shouts", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_shout_likes_xata_id_key: { name: "_pgroll_new_shout_likes_xata_id_key", columns: ["xata_id"], }, shout_likes__pgroll_new_uri_key: { name: "shout_likes__pgroll_new_uri_key", columns: ["uri"], }, }, columns: [ { name: "shout_id", type: "link", link: { table: "shouts" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"shouts"}', }, { name: "uri", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "shout_reports", checkConstraints: { shout_reports_xata_id_length_xata_id: { name: "shout_reports_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { shout_id_link: { name: "shout_id_link", columns: ["shout_id"], referencedTable: "shouts", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_shout_reports_xata_id_key: { name: "_pgroll_new_shout_reports_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "shout_id", type: "link", link: { table: "shouts" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"shouts"}', }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "shouts", checkConstraints: { shouts_xata_id_length_xata_id: { name: "shouts_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { album_id_link: { name: "album_id_link", columns: ["album_id"], referencedTable: "albums", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, artist_id_link: { name: "artist_id_link", columns: ["artist_id"], referencedTable: "artists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, parent_id_link: { name: "parent_id_link", columns: ["parent_id"], referencedTable: "shouts", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, scrobble_id_link: { name: "scrobble_id_link", columns: ["scrobble_id"], referencedTable: "scrobbles", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["author_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_shouts_xata_id_key: { name: "_pgroll_new_shouts_xata_id_key", columns: ["xata_id"], }, shouts__pgroll_new_uri_key: { name: "shouts__pgroll_new_uri_key", columns: ["uri"], }, }, columns: [ { name: "album_id", type: "link", link: { table: "albums" }, notNull: false, unique: false, defaultValue: null, comment: '{"xata.link":"albums"}', }, { name: "artist_id", type: "link", link: { table: "artists" }, notNull: false, unique: false, defaultValue: null, comment: '{"xata.link":"artists"}', }, { name: "author_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "content", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "parent_id", type: "link", link: { table: "shouts" }, notNull: false, unique: false, defaultValue: null, comment: '{"xata.link":"shouts"}', }, { name: "scrobble_id", type: "link", link: { table: "scrobbles" }, notNull: false, unique: false, defaultValue: null, comment: '{"xata.link":"scrobbles"}', }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: false, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "spotify_accounts", checkConstraints: { spotify_accounts_xata_id_length_xata_id: { name: "spotify_accounts_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_spotify_accounts_xata_id_key: { name: "_pgroll_new_spotify_accounts_xata_id_key", columns: ["xata_id"], }, spotify_accounts__pgroll_new_email_key: { name: "spotify_accounts__pgroll_new_email_key", columns: ["email"], }, }, columns: [ { name: "email", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "is_beta_user", type: "bool", notNull: true, unique: false, defaultValue: "false", comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "spotify_tokens", checkConstraints: { spotify_tokens_xata_id_length_xata_id: { name: "spotify_tokens_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_spotify_tokens_xata_id_key: { name: "_pgroll_new_spotify_tokens_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "access_token", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "refresh_token", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "tags", checkConstraints: { tags_xata_id_length_xata_id: { name: "tags_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_tags_xata_id_key: { name: "_pgroll_new_tags_xata_id_key", columns: ["xata_id"], }, tags__pgroll_new_name_key: { name: "tags__pgroll_new_name_key", columns: ["name"], }, }, columns: [ { name: "name", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "track_tags", checkConstraints: { track_tags_xata_id_length_xata_id: { name: "track_tags_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { tag_id_link: { name: "tag_id_link", columns: ["tag_id"], referencedTable: "tags", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_track_tags_xata_id_key: { name: "_pgroll_new_track_tags_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "tag_id", type: "link", link: { table: "tags" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tags"}', }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "tracks", checkConstraints: { tracks_xata_id_length_xata_id: { name: "tracks_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_tracks_xata_id_key: { name: "_pgroll_new_tracks_xata_id_key", columns: ["xata_id"], }, tracks__pgroll_new_mb_id_key: { name: "tracks__pgroll_new_mb_id_key", columns: ["mb_id"], }, tracks__pgroll_new_sha256_key: { name: "tracks__pgroll_new_sha256_key", columns: ["sha256"], }, tracks__pgroll_new_uri_key: { name: "tracks__pgroll_new_uri_key", columns: ["uri"], }, tracks_tidal_link_unique: { name: "tracks_tidal_link_unique", columns: ["tidal_link"], }, tracks_youtube_link_unique: { name: "tracks_youtube_link_unique", columns: ["youtube_link"], }, }, columns: [ { name: "album", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "album_art", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "album_artist", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "album_uri", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "apple_music_link", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "artist", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "artist_uri", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "composer", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "copyright_message", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "disc_number", type: "int", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "duration", type: "int", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "genre", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "label", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "lastfm_link", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "lyrics", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "mb_id", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "sha256", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "spotify_link", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "tidal_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "title", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "track_number", type: "int", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, { name: "youtube_link", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, ], }, { name: "user_albums", checkConstraints: { user_albums_xata_id_length_xata_id: { name: "user_albums_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { album_id_link: { name: "album_id_link", columns: ["album_id"], referencedTable: "albums", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_user_albums_xata_id_key: { name: "_pgroll_new_user_albums_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "album_id", type: "link", link: { table: "albums" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"albums"}', }, { name: "scrobbles", type: "int", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "uri", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "user_artists", checkConstraints: { user_artists_xata_id_length_xata_id: { name: "user_artists_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { artist_id_link: { name: "artist_id_link", columns: ["artist_id"], referencedTable: "artists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_user_artists_xata_id_key: { name: "_pgroll_new_user_artists_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "artist_id", type: "link", link: { table: "artists" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"artists"}', }, { name: "scrobbles", type: "int", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "uri", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "user_playlists", checkConstraints: { user_playlists_xata_id_length_xata_id: { name: "user_playlists_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { playlist_id_link: { name: "playlist_id_link", columns: ["playlist_id"], referencedTable: "playlists", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_user_playlists_xata_id_key: { name: "_pgroll_new_user_playlists_xata_id_key", columns: ["xata_id"], }, user_playlists__pgroll_new_uri_key: { name: "user_playlists__pgroll_new_uri_key", columns: ["uri"], }, }, columns: [ { name: "playlist_id", type: "link", link: { table: "playlists" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"playlists"}', }, { name: "uri", type: "text", notNull: false, unique: true, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "user_tracks", checkConstraints: { user_tracks_xata_id_length_xata_id: { name: "user_tracks_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { track_id_link: { name: "track_id_link", columns: ["track_id"], referencedTable: "tracks", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "SET NULL", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_user_tracks_xata_id_key: { name: "_pgroll_new_user_tracks_xata_id_key", columns: ["xata_id"], }, }, columns: [ { name: "scrobbles", type: "int", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "track_id", type: "link", link: { table: "tracks" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"tracks"}', }, { name: "uri", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "users", checkConstraints: { users_xata_id_length_xata_id: { name: "users_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: {}, primaryKey: [], uniqueConstraints: { _pgroll_new_users_xata_id_key: { name: "_pgroll_new_users_xata_id_key", columns: ["xata_id"], }, users__pgroll_new_did_key: { name: "users__pgroll_new_did_key", columns: ["did"], }, users__pgroll_new_handle_key: { name: "users__pgroll_new_handle_key", columns: ["handle"], }, }, columns: [ { name: "avatar", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "did", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "display_name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "handle", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, { name: "webscrobblers", checkConstraints: { webscrobblers_xata_id_length_xata_id: { name: "webscrobblers_xata_id_length_xata_id", columns: ["xata_id"], definition: "CHECK ((length(xata_id) < 256))", }, }, foreignKeys: { user_id_link: { name: "user_id_link", columns: ["user_id"], referencedTable: "users", referencedColumns: ["xata_id"], onDelete: "CASCADE", }, }, primaryKey: [], uniqueConstraints: { _pgroll_new_webscrobblers_xata_id_key: { name: "_pgroll_new_webscrobblers_xata_id_key", columns: ["xata_id"], }, webscrobblers__pgroll_new_uuid_key: { name: "webscrobblers__pgroll_new_uuid_key", columns: ["uuid"], }, }, columns: [ { name: "description", type: "text", notNull: false, unique: false, defaultValue: null, comment: "", }, { name: "enabled", type: "bool", notNull: false, unique: false, defaultValue: "true", comment: "", }, { name: "name", type: "text", notNull: true, unique: false, defaultValue: null, comment: "", }, { name: "user_id", type: "link", link: { table: "users" }, notNull: true, unique: false, defaultValue: null, comment: '{"xata.link":"users"}', }, { name: "uuid", type: "text", notNull: true, unique: true, defaultValue: null, comment: "", }, { name: "xata_createdat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_id", type: "text", notNull: true, unique: true, defaultValue: "('rec_'::text || (xata_private.xid())::text)", comment: "", }, { name: "xata_updatedat", type: "datetime", notNull: true, unique: false, defaultValue: "now()", comment: "", }, { name: "xata_version", type: "int", notNull: true, unique: false, defaultValue: "0", comment: "", }, ], }, ] as const; export type SchemaTables = typeof tables; export type InferredTypes = SchemaInference; export type AlbumTags = InferredTypes["album_tags"]; export type AlbumTagsRecord = AlbumTags & XataRecord; export type AlbumTracks = InferredTypes["album_tracks"]; export type AlbumTracksRecord = AlbumTracks & XataRecord; export type Albums = InferredTypes["albums"]; export type AlbumsRecord = Albums & XataRecord; export type ApiKeys = InferredTypes["api_keys"]; export type ApiKeysRecord = ApiKeys & XataRecord; export type ArtistAlbums = InferredTypes["artist_albums"]; export type ArtistAlbumsRecord = ArtistAlbums & XataRecord; export type ArtistTags = InferredTypes["artist_tags"]; export type ArtistTagsRecord = ArtistTags & XataRecord; export type ArtistTracks = InferredTypes["artist_tracks"]; export type ArtistTracksRecord = ArtistTracks & XataRecord; export type Artists = InferredTypes["artists"]; export type ArtistsRecord = Artists & XataRecord; export type BuiltinStoragePaths = InferredTypes["builtin_storage_paths"]; export type BuiltinStoragePathsRecord = BuiltinStoragePaths & XataRecord; export type Dropbox = InferredTypes["dropbox"]; export type DropboxRecord = Dropbox & XataRecord; export type DropboxAccounts = InferredTypes["dropbox_accounts"]; export type DropboxAccountsRecord = DropboxAccounts & XataRecord; export type DropboxPaths = InferredTypes["dropbox_paths"]; export type DropboxPathsRecord = DropboxPaths & XataRecord; export type DropboxTokens = InferredTypes["dropbox_tokens"]; export type DropboxTokensRecord = DropboxTokens & XataRecord; export type GoogleDrive = InferredTypes["google_drive"]; export type GoogleDriveRecord = GoogleDrive & XataRecord; export type GoogleDriveAccounts = InferredTypes["google_drive_accounts"]; export type GoogleDriveAccountsRecord = GoogleDriveAccounts & XataRecord; export type GoogleDrivePaths = InferredTypes["google_drive_paths"]; export type GoogleDrivePathsRecord = GoogleDrivePaths & XataRecord; export type GoogleDriveTokens = InferredTypes["google_drive_tokens"]; export type GoogleDriveTokensRecord = GoogleDriveTokens & XataRecord; export type LovedTracks = InferredTypes["loved_tracks"]; export type LovedTracksRecord = LovedTracks & XataRecord; export type PlaybackState = InferredTypes["playback_state"]; export type PlaybackStateRecord = PlaybackState & XataRecord; export type PlaylistTracks = InferredTypes["playlist_tracks"]; export type PlaylistTracksRecord = PlaylistTracks & XataRecord; export type Playlists = InferredTypes["playlists"]; export type PlaylistsRecord = Playlists & XataRecord; export type ProfileShouts = InferredTypes["profile_shouts"]; export type ProfileShoutsRecord = ProfileShouts & XataRecord; export type QueueTracks = InferredTypes["queue_tracks"]; export type QueueTracksRecord = QueueTracks & XataRecord; export type Radios = InferredTypes["radios"]; export type RadiosRecord = Radios & XataRecord; export type S3Bucket = InferredTypes["s3_bucket"]; export type S3BucketRecord = S3Bucket & XataRecord; export type S3Paths = InferredTypes["s3_paths"]; export type S3PathsRecord = S3Paths & XataRecord; export type S3Tokens = InferredTypes["s3_tokens"]; export type S3TokensRecord = S3Tokens & XataRecord; export type Scrobbles = InferredTypes["scrobbles"]; export type ScrobblesRecord = Scrobbles & XataRecord; export type Sftp = InferredTypes["sftp"]; export type SftpRecord = Sftp & XataRecord; export type SftpAccess = InferredTypes["sftp_access"]; export type SftpAccessRecord = SftpAccess & XataRecord; export type SftpPath = InferredTypes["sftp_path"]; export type SftpPathRecord = SftpPath & XataRecord; export type ShoutLikes = InferredTypes["shout_likes"]; export type ShoutLikesRecord = ShoutLikes & XataRecord; export type ShoutReports = InferredTypes["shout_reports"]; export type ShoutReportsRecord = ShoutReports & XataRecord; export type Shouts = InferredTypes["shouts"]; export type ShoutsRecord = Shouts & XataRecord; export type SpotifyAccounts = InferredTypes["spotify_accounts"]; export type SpotifyAccountsRecord = SpotifyAccounts & XataRecord; export type SpotifyTokens = InferredTypes["spotify_tokens"]; export type SpotifyTokensRecord = SpotifyTokens & XataRecord; export type Tags = InferredTypes["tags"]; export type TagsRecord = Tags & XataRecord; export type TrackTags = InferredTypes["track_tags"]; export type TrackTagsRecord = TrackTags & XataRecord; export type Tracks = InferredTypes["tracks"]; export type TracksRecord = Tracks & XataRecord; export type UserAlbums = InferredTypes["user_albums"]; export type UserAlbumsRecord = UserAlbums & XataRecord; export type UserArtists = InferredTypes["user_artists"]; export type UserArtistsRecord = UserArtists & XataRecord; export type UserPlaylists = InferredTypes["user_playlists"]; export type UserPlaylistsRecord = UserPlaylists & XataRecord; export type UserTracks = InferredTypes["user_tracks"]; export type UserTracksRecord = UserTracks & XataRecord; export type Users = InferredTypes["users"]; export type UsersRecord = Users & XataRecord; export type Webscrobblers = InferredTypes["webscrobblers"]; export type WebscrobblersRecord = Webscrobblers & XataRecord; export type DatabaseSchema = { album_tags: AlbumTagsRecord; album_tracks: AlbumTracksRecord; albums: AlbumsRecord; api_keys: ApiKeysRecord; artist_albums: ArtistAlbumsRecord; artist_tags: ArtistTagsRecord; artist_tracks: ArtistTracksRecord; artists: ArtistsRecord; builtin_storage_paths: BuiltinStoragePathsRecord; dropbox: DropboxRecord; dropbox_accounts: DropboxAccountsRecord; dropbox_paths: DropboxPathsRecord; dropbox_tokens: DropboxTokensRecord; google_drive: GoogleDriveRecord; google_drive_accounts: GoogleDriveAccountsRecord; google_drive_paths: GoogleDrivePathsRecord; google_drive_tokens: GoogleDriveTokensRecord; loved_tracks: LovedTracksRecord; playback_state: PlaybackStateRecord; playlist_tracks: PlaylistTracksRecord; playlists: PlaylistsRecord; profile_shouts: ProfileShoutsRecord; queue_tracks: QueueTracksRecord; radios: RadiosRecord; s3_bucket: S3BucketRecord; s3_paths: S3PathsRecord; s3_tokens: S3TokensRecord; scrobbles: ScrobblesRecord; sftp: SftpRecord; sftp_access: SftpAccessRecord; sftp_path: SftpPathRecord; shout_likes: ShoutLikesRecord; shout_reports: ShoutReportsRecord; shouts: ShoutsRecord; spotify_accounts: SpotifyAccountsRecord; spotify_tokens: SpotifyTokensRecord; tags: TagsRecord; track_tags: TrackTagsRecord; tracks: TracksRecord; user_albums: UserAlbumsRecord; user_artists: UserArtistsRecord; user_playlists: UserPlaylistsRecord; user_tracks: UserTracksRecord; users: UsersRecord; webscrobblers: WebscrobblersRecord; }; const DatabaseClient = buildClient(); const defaultOptions = { databaseURL: "https://Tsiry-Sandratraina-s-workspace-b1ficn.us-east-1.xata.sh/db/rocksky", }; export class XataClient extends DatabaseClient { constructor(options?: BaseClientOptions) { super({ ...defaultOptions, ...options }, tables); } } let instance: XataClient | undefined; export const getXataClient = () => { if (instance) return instance; instance = new XataClient(); return instance; };