





















const db = require('../models');
const Users = db.users;






const OsuApiCredentials = db.osu_api_credentials;

const ApiRequestLogs = db.api_request_logs;

const SyncJobs = db.sync_jobs;

const BeatmapSets = db.beatmap_sets;

const Mappers = db.mappers;

const Artists = db.artists;

const Beatmaps = db.beatmaps;

const MapperStats = db.mapper_stats;

const ArtistStats = db.artist_stats;

const GameSessions = db.game_sessions;

const GameRounds = db.game_rounds;

const LeaderboardEntries = db.leaderboard_entries;

const DailySeeds = db.daily_seeds;

const ServerCaches = db.server_caches;







const OsuApiCredentialsData = [
    
    {
    
        
        
            
                "label": "Primary osu v2 app",
            
        
    
        
        
            
                "osu_client_numeric": 53031,
            
        
    
        
        
            
                "osu_client_secret": "env:OSU_CLIENT_SECRET_PRIMARY",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
        
        
            
                "last_token_at": new Date('2026-05-05T08:10:00Z'),
            
        
    
        
        
            
                "last_used_at": new Date('2026-05-05T08:12:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "label": "Rotation key set A",
            
        
    
        
        
            
                "osu_client_numeric": 53031,
            
        
    
        
        
            
                "osu_client_secret": "env:OSU_CLIENT_SECRET_ROT_A",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "last_token_at": new Date('2026-04-20T07:55:00Z'),
            
        
    
        
        
            
                "last_used_at": new Date('2026-04-20T08:00:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "label": "Rotation key set B",
            
        
    
        
        
            
                "osu_client_numeric": 53031,
            
        
    
        
        
            
                "osu_client_secret": "env:OSU_CLIENT_SECRET_ROT_B",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "last_token_at": new Date('2026-04-10T07:30:00Z'),
            
        
    
        
        
            
                "last_used_at": new Date('2026-04-10T07:31:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "label": "Staging osu v2 app",
            
        
    
        
        
            
                "osu_client_numeric": 53031,
            
        
    
        
        
            
                "osu_client_secret": "env:OSU_CLIENT_SECRET_STAGING",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
        
        
            
                "last_token_at": new Date('2026-03-15T06:20:00Z'),
            
        
    
        
        
            
                "last_used_at": new Date('2026-03-15T06:25:00Z'),
            
        
    
    },
    
];



const ApiRequestLogsData = [
    
    {
    
        
        
            
                "provider": "osu_v2",
            
        
    
        
        
            
                "request_method": "POST",
            
        
    
        
        
            
                "request_path": "/oauth/token",
            
        
    
        
        
            
                "request_query": "grant_type=client_credentials&scope=public",
            
        
    
        
        
            
                "response_status": 200,
            
        
    
        
        
            
                "duration_ms": 182,
            
        
    
        
        
            
                "error_message": "",
            
        
    
        
        
            
                "requested_at": new Date('2026-05-05T08:10:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "provider": "osu_v2",
            
        
    
        
        
            
                "request_method": "GET",
            
        
    
        
        
            
                "request_path": "/api/v2/beatmapsets/search",
            
        
    
        
        
            
                "request_query": "m=0&s=ranked, loved&sort=plays_desc&page=1",
            
        
    
        
        
            
                "response_status": 200,
            
        
    
        
        
            
                "duration_ms": 241,
            
        
    
        
        
            
                "error_message": "",
            
        
    
        
        
            
                "requested_at": new Date('2026-05-05T08:11:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "provider": "osu_v2",
            
        
    
        
        
            
                "request_method": "GET",
            
        
    
        
        
            
                "request_path": "/api/v2/beatmapsets/search",
            
        
    
        
        
            
                "request_query": "m=0&s=ranked, loved&sort=plays_desc&page=2",
            
        
    
        
        
            
                "response_status": 200,
            
        
    
        
        
            
                "duration_ms": 233,
            
        
    
        
        
            
                "error_message": "",
            
        
    
        
        
            
                "requested_at": new Date('2026-05-05T08:11:05Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "provider": "musicbrainz",
            
        
    
        
        
            
                "request_method": "GET",
            
        
    
        
        
            
                "request_path": "/api/v2/users/124493",
            
        
    
        
        
            
                "request_query": "mode=osu",
            
        
    
        
        
            
                "response_status": 200,
            
        
    
        
        
            
                "duration_ms": 190,
            
        
    
        
        
            
                "error_message": "",
            
        
    
        
        
            
                "requested_at": new Date('2026-05-05T08:11:30Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SyncJobsData = [
    
    {
    
        
        
            
                "job_type": "aggregate_mapper_totals",
            
        
    
        
        
            
                "status": "canceled",
            
        
    
        
        
            
                "started_at": new Date('2026-05-05T08:10:30Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-05-05T08:25:10Z'),
            
        
    
        
        
            
                "processed_count": 5000,
            
        
    
        
        
            
                "inserted_count": 5000,
            
        
    
        
        
            
                "updated_count": 0,
            
        
    
        
        
            
                "skipped_count": 0,
            
        
    
        
        
            
                "error_count": 0,
            
        
    
        
        
            
                "error_summary": "",
            
        
    
        
        
            
                "job_payload_json": "{mode:osu,statuses:[ranked,loved],pages:10}",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "job_type": "osu_refresh_artists",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "started_at": new Date('2026-05-05T08:26:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-05-05T08:30:40Z'),
            
        
    
        
        
            
                "processed_count": 450,
            
        
    
        
        
            
                "inserted_count": 450,
            
        
    
        
        
            
                "updated_count": 0,
            
        
    
        
        
            
                "skipped_count": 0,
            
        
    
        
        
            
                "error_count": 0,
            
        
    
        
        
            
                "error_summary": "",
            
        
    
        
        
            
                "job_payload_json": "{batchSize:100}",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "job_type": "aggregate_mapper_totals",
            
        
    
        
        
            
                "status": "succeeded",
            
        
    
        
        
            
                "started_at": new Date('2026-05-05T08:31:00Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-05-05T08:31:00Z'),
            
        
    
        
        
            
                "processed_count": 120,
            
        
    
        
        
            
                "inserted_count": 80,
            
        
    
        
        
            
                "updated_count": 40,
            
        
    
        
        
            
                "skipped_count": 0,
            
        
    
        
        
            
                "error_count": 0,
            
        
    
        
        
            
                "error_summary": "",
            
        
    
        
        
            
                "job_payload_json": "{providerPriority:[cached_dataset,lastfm,musicbrainz],batchSize:100}",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "job_type": "osu_sync_incremental",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "started_at": new Date('2026-05-05T08:31:10Z'),
            
        
    
        
        
            
                "finished_at": new Date('2026-05-05T08:31:10Z'),
            
        
    
        
        
            
                "processed_count": 0,
            
        
    
        
        
            
                "inserted_count": 0,
            
        
    
        
        
            
                "updated_count": 0,
            
        
    
        
        
            
                "skipped_count": 0,
            
        
    
        
        
            
                "error_count": 0,
            
        
    
        
        
            
                "error_summary": "",
            
        
    
        
        
            
                "job_payload_json": "{scope:ranked_loved_osu}",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BeatmapSetsData = [
    
    {
    
        
        
            
                "osu_beatmapset_numeric": 113933,
            
        
    
        
        
            
                "title": "Night of Knights",
            
        
    
        
        
            
                "artist_name": "ZUN",
            
        
    
        
        
            
                "creator_username": "DJPop",
            
        
    
        
        
            
                "creator_user_numeric": 112336,
            
        
    
        
        
            
                "status": "loved",
            
        
    
        
        
            
                "total_playcount": 18500000,
            
        
    
        
        
            
                "background_image_url": "https://assets.ppy.sh/beatmaps/113933/covers/raw.jpg",
            
        
    
        
        
            
                "cover_image_url": "https://assets.ppy.sh/beatmaps/113933/covers/cover.jpg",
            
        
    
        
        
            
                "ranked_at": new Date('2014-06-10T00:00:00Z'),
            
        
    
        
        
            
                "loved_at": new Date('2019-01-01T00:00:00Z'),
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:14:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "osu_beatmapset_numeric": 102120,
            
        
    
        
        
            
                "title": "Kyouran Hey Kids!!",
            
        
    
        
        
            
                "artist_name": "THE ORAL CIGARETTES",
            
        
    
        
        
            
                "creator_username": "Sotarks",
            
        
    
        
        
            
                "creator_user_numeric": 4452992,
            
        
    
        
        
            
                "status": "loved",
            
        
    
        
        
            
                "total_playcount": 42000000,
            
        
    
        
        
            
                "background_image_url": "https://assets.ppy.sh/beatmaps/102120/covers/raw.jpg",
            
        
    
        
        
            
                "cover_image_url": "https://assets.ppy.sh/beatmaps/102120/covers/cover.jpg",
            
        
    
        
        
            
                "ranked_at": new Date('2017-02-11T00:00:00Z'),
            
        
    
        
        
            
                "loved_at": new Date('2019-01-01T00:00:00Z'),
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:14:30Z'),
            
        
    
    },
    
    {
    
        
        
            
                "osu_beatmapset_numeric": 874923,
            
        
    
        
        
            
                "title": "Blue Zenith",
            
        
    
        
        
            
                "artist_name": "xi",
            
        
    
        
        
            
                "creator_username": "Monstrata",
            
        
    
        
        
            
                "creator_user_numeric": 2706438,
            
        
    
        
        
            
                "status": "ranked",
            
        
    
        
        
            
                "total_playcount": 30000000,
            
        
    
        
        
            
                "background_image_url": "https://assets.ppy.sh/beatmaps/874923/covers/raw.jpg",
            
        
    
        
        
            
                "cover_image_url": "https://assets.ppy.sh/beatmaps/874923/covers/cover.jpg",
            
        
    
        
        
            
                "ranked_at": new Date('2019-03-21T00:00:00Z'),
            
        
    
        
        
            
                "loved_at": new Date('2019-01-01T00:00:00Z'),
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:15:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "osu_beatmapset_numeric": 512330,
            
        
    
        
        
            
                "title": "Inferno",
            
        
    
        
        
            
                "artist_name": "Mrs. GREEN APPLE",
            
        
    
        
        
            
                "creator_username": "pishifat",
            
        
    
        
        
            
                "creator_user_numeric": 3178418,
            
        
    
        
        
            
                "status": "loved",
            
        
    
        
        
            
                "total_playcount": 38000000,
            
        
    
        
        
            
                "background_image_url": "https://assets.ppy.sh/beatmaps/512330/covers/raw.jpg",
            
        
    
        
        
            
                "cover_image_url": "https://assets.ppy.sh/beatmaps/512330/covers/cover.jpg",
            
        
    
        
        
            
                "ranked_at": new Date('2016-08-18T00:00:00Z'),
            
        
    
        
        
            
                "loved_at": new Date('2019-01-01T00:00:00Z'),
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:15:30Z'),
            
        
    
    },
    
];



const MappersData = [
    
    {
    
        
        
            
                "osu_user_numeric": 112336,
            
        
    
        
        
            
                "osu_username": "DJPop",
            
        
    
        
        
            
                "avatar_url": "https://a.ppy.sh/112336",
            
        
    
        
        
            
                "profile_url": "https://osu.ppy.sh/users/112336",
            
        
    
        
        
            
                "banner_url": "https://assets.ppy.sh/user-profile-covers/112336/cover.jpg",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:12:40Z'),
            
        
    
    },
    
    {
    
        
        
            
                "osu_user_numeric": 4452992,
            
        
    
        
        
            
                "osu_username": "Sotarks",
            
        
    
        
        
            
                "avatar_url": "https://a.ppy.sh/4452992",
            
        
    
        
        
            
                "profile_url": "https://osu.ppy.sh/users/4452992",
            
        
    
        
        
            
                "banner_url": "https://assets.ppy.sh/user-profile-covers/4452992/cover.jpg",
            
        
    
        
        
            
                "status": "missing",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:12:55Z'),
            
        
    
    },
    
    {
    
        
        
            
                "osu_user_numeric": 2706438,
            
        
    
        
        
            
                "osu_username": "Monstrata",
            
        
    
        
        
            
                "avatar_url": "https://a.ppy.sh/2706438",
            
        
    
        
        
            
                "profile_url": "https://osu.ppy.sh/users/2706438",
            
        
    
        
        
            
                "banner_url": "https://assets.ppy.sh/user-profile-covers/2706438/cover.jpg",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:13:10Z'),
            
        
    
    },
    
    {
    
        
        
            
                "osu_user_numeric": 3178418,
            
        
    
        
        
            
                "osu_username": "pishifat",
            
        
    
        
        
            
                "avatar_url": "https://a.ppy.sh/3178418",
            
        
    
        
        
            
                "profile_url": "https://osu.ppy.sh/users/3178418",
            
        
    
        
        
            
                "banner_url": "https://assets.ppy.sh/user-profile-covers/3178418/cover.jpg",
            
        
    
        
        
            
                "status": "missing",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:13:25Z'),
            
        
    
    },
    
];



const ArtistsData = [
    
    {
    
        
        
            
                "name": "xi",
            
        
    
        
        
            
                "image_source": "cached_dataset",
            
        
    
        
        
            
                "image_url": "https://lastfm.freetls.fastly.net/i/u/300x300/xi.jpg",
            
        
    
        
        
            
                "external_url": "https://www.last.fm/music/xi",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:20:00Z'),
            
        
    
    },
    
    {
    
        
        
            
                "name": "ZUN",
            
        
    
        
        
            
                "image_source": "none",
            
        
    
        
        
            
                "image_url": "https://cdn.example.com/artists/zun.jpg",
            
        
    
        
        
            
                "external_url": "https://musicbrainz.org/artist/zun",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:20:10Z'),
            
        
    
    },
    
    {
    
        
        
            
                "name": "THE ORAL CIGARETTES",
            
        
    
        
        
            
                "image_source": "lastfm",
            
        
    
        
        
            
                "image_url": "https://cdn.example.com/artists/the_oral_cigarettes.jpg",
            
        
    
        
        
            
                "external_url": "https://musicbrainz.org/artist/the-oral-cigarettes",
            
        
    
        
        
            
                "status": "missing",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:20:20Z'),
            
        
    
    },
    
    {
    
        
        
            
                "name": "Mrs. GREEN APPLE",
            
        
    
        
        
            
                "image_source": "cached_dataset",
            
        
    
        
        
            
                "image_url": "https://cdn.example.com/artists/mrs_green_apple.jpg",
            
        
    
        
        
            
                "external_url": "https://musicbrainz.org/artist/mrs-green-apple",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:20:30Z'),
            
        
    
    },
    
];



const BeatmapsData = [
    
    {
    
        
        
            
                "osu_beatmap_numeric": 245094,
            
        
    
        
        
            
                "difficulty_name": "Insane",
            
        
    
        
        
            
                "mode": "osu",
            
        
    
        
        
            
                "status": "ranked",
            
        
    
        
        
            
                "playcount": 6500000,
            
        
    
        
        
            
                "passcount": 240000,
            
        
    
        
        
            
                "star_rating": 4.92,
            
        
    
        
        
            
                "bpm": 170.0,
            
        
    
        
        
            
                "length_seconds": 140,
            
        
    
        
        
            
                "cs": 4.0,
            
        
    
        
        
            
                "ar": 9.0,
            
        
    
        
        
            
                "od": 8.5,
            
        
    
        
        
            
                "hp": 6.0,
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:16:30Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "osu_beatmap_numeric": 1991332,
            
        
    
        
        
            
                "difficulty_name": "Extra",
            
        
    
        
        
            
                "mode": "osu",
            
        
    
        
        
            
                "status": "ranked",
            
        
    
        
        
            
                "playcount": 12500000,
            
        
    
        
        
            
                "passcount": 520000,
            
        
    
        
        
            
                "star_rating": 5.68,
            
        
    
        
        
            
                "bpm": 190.0,
            
        
    
        
        
            
                "length_seconds": 205,
            
        
    
        
        
            
                "cs": 4.0,
            
        
    
        
        
            
                "ar": 9.6,
            
        
    
        
        
            
                "od": 9.0,
            
        
    
        
        
            
                "hp": 6.5,
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:16:45Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "osu_beatmap_numeric": 1762724,
            
        
    
        
        
            
                "difficulty_name": "FOUR DIMENSIONS",
            
        
    
        
        
            
                "mode": "osu",
            
        
    
        
        
            
                "status": "ranked",
            
        
    
        
        
            
                "playcount": 8800000,
            
        
    
        
        
            
                "passcount": 410000,
            
        
    
        
        
            
                "star_rating": 6.32,
            
        
    
        
        
            
                "bpm": 200.0,
            
        
    
        
        
            
                "length_seconds": 155,
            
        
    
        
        
            
                "cs": 4.0,
            
        
    
        
        
            
                "ar": 9.7,
            
        
    
        
        
            
                "od": 9.2,
            
        
    
        
        
            
                "hp": 6.5,
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:17:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "osu_beatmap_numeric": 1083095,
            
        
    
        
        
            
                "difficulty_name": "Insane",
            
        
    
        
        
            
                "mode": "osu",
            
        
    
        
        
            
                "status": "ranked",
            
        
    
        
        
            
                "playcount": 10200000,
            
        
    
        
        
            
                "passcount": 460000,
            
        
    
        
        
            
                "star_rating": 5.14,
            
        
    
        
        
            
                "bpm": 198.0,
            
        
    
        
        
            
                "length_seconds": 225,
            
        
    
        
        
            
                "cs": 4.0,
            
        
    
        
        
            
                "ar": 9.3,
            
        
    
        
        
            
                "od": 8.8,
            
        
    
        
        
            
                "hp": 6.0,
            
        
    
        
        
            
                "last_synced_at": new Date('2026-05-05T08:17:15Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MapperStatsData = [
    
    {
    
        
        
            
                "total_plays": 54000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 120,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:35:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "total_plays": 98000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 210,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:35:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "total_plays": 76000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 165,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:35:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "total_plays": 88000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 190,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:35:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ArtistStatsData = [
    
    {
    
        
        
            
                "total_plays": 155000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 85,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:36:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "total_plays": 45000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 40,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:36:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "total_plays": 73000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 55,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:36:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "total_plays": 68000000,
            
        
    
        
        
            
                "ranked_loved_maps_count": 50,
            
        
    
        
        
            
                "computed_at": new Date('2026-05-05T08:36:00Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GameSessionsData = [
    
    {
    
        
        
            
                "session_token": "sess_7f3a2c1b_normal_mixed",
            
        
    
        
        
            
                "status": "abandoned",
            
        
    
        
        
            
                "starting_lives": 2,
            
        
    
        
        
            
                "lives_remaining": 0,
            
        
    
        
        
            
                "streak": 0,
            
        
    
        
        
            
                "best_streak": 7,
            
        
    
        
        
            
                "timer_profile": "normal",
            
        
    
        
        
            
                "mode_selection": "mapper_only",
            
        
    
        
        
            
                "started_at": new Date('2026-05-05T18:30:00Z'),
            
        
    
        
        
            
                "ended_at": new Date('2026-05-05T18:34:10Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "session_token": "sess_4a91d2e0_normal_beatmap",
            
        
    
        
        
            
                "status": "finished",
            
        
    
        
        
            
                "starting_lives": 2,
            
        
    
        
        
            
                "lives_remaining": 0,
            
        
    
        
        
            
                "streak": 0,
            
        
    
        
        
            
                "best_streak": 5,
            
        
    
        
        
            
                "timer_profile": "insane",
            
        
    
        
        
            
                "mode_selection": "artist_only",
            
        
    
        
        
            
                "started_at": new Date('2026-05-05T19:05:00Z'),
            
        
    
        
        
            
                "ended_at": new Date('2026-05-05T19:08:40Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "session_token": "sess_91c0ab2e_insane_mixed",
            
        
    
        
        
            
                "status": "finished",
            
        
    
        
        
            
                "starting_lives": 2,
            
        
    
        
        
            
                "lives_remaining": 1,
            
        
    
        
        
            
                "streak": 2,
            
        
    
        
        
            
                "best_streak": 2,
            
        
    
        
        
            
                "timer_profile": "insane",
            
        
    
        
        
            
                "mode_selection": "beatmap_only",
            
        
    
        
        
            
                "started_at": new Date('2026-05-05T19:20:00Z'),
            
        
    
        
        
            
                "ended_at": new Date('2026-05-05T19:21:10Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "session_token": "sess_2b0f88aa_normal_artist",
            
        
    
        
        
            
                "status": "abandoned",
            
        
    
        
        
            
                "starting_lives": 2,
            
        
    
        
        
            
                "lives_remaining": 0,
            
        
    
        
        
            
                "streak": 0,
            
        
    
        
        
            
                "best_streak": 4,
            
        
    
        
        
            
                "timer_profile": "insane",
            
        
    
        
        
            
                "mode_selection": "artist_only",
            
        
    
        
        
            
                "started_at": new Date('2026-05-04T17:10:00Z'),
            
        
    
        
        
            
                "ended_at": new Date('2026-05-04T17:13:20Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const GameRoundsData = [
    
    {
    
        
        
            
                "round_number": 1,
            
        
    
        
        
            
                "round_mode": "mapper",
            
        
    
        
        
            
                "state": "resolved",
            
        
    
        
        
            
                "time_limit_ms": 7000,
            
        
    
        
        
            
                "presented_at": new Date('2026-05-05T18:30:05Z'),
            
        
    
        
        
            
                "answered_at": new Date('2026-05-05T18:30:10Z'),
            
        
    
        
        
            
                "player_choice": "b",
            
        
    
        
        
            
                "correct_choice": "a",
            
        
    
        
        
            
                "is_correct": true,
            
        
    
        
        
            
                "lose_reason": "timeout",
            
        
    
        
        
            
                "value_a": 6500000,
            
        
    
        
        
            
                "value_b": 12500000,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "round_number": 2,
            
        
    
        
        
            
                "round_mode": "beatmap",
            
        
    
        
        
            
                "state": "timed_out",
            
        
    
        
        
            
                "time_limit_ms": 6500,
            
        
    
        
        
            
                "presented_at": new Date('2026-05-05T18:30:11Z'),
            
        
    
        
        
            
                "answered_at": new Date('2026-05-05T18:30:16Z'),
            
        
    
        
        
            
                "player_choice": "none",
            
        
    
        
        
            
                "correct_choice": "a",
            
        
    
        
        
            
                "is_correct": false,
            
        
    
        
        
            
                "lose_reason": "none",
            
        
    
        
        
            
                "value_a": 54000000,
            
        
    
        
        
            
                "value_b": 98000000,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "round_number": 3,
            
        
    
        
        
            
                "round_mode": "beatmap",
            
        
    
        
        
            
                "state": "answered",
            
        
    
        
        
            
                "time_limit_ms": 6000,
            
        
    
        
        
            
                "presented_at": new Date('2026-05-05T18:30:17Z'),
            
        
    
        
        
            
                "answered_at": new Date('2026-05-05T18:30:23Z'),
            
        
    
        
        
            
                "player_choice": "a",
            
        
    
        
        
            
                "correct_choice": "b",
            
        
    
        
        
            
                "is_correct": true,
            
        
    
        
        
            
                "lose_reason": "wrong",
            
        
    
        
        
            
                "value_a": 155000000,
            
        
    
        
        
            
                "value_b": 68000000,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "round_number": 1,
            
        
    
        
        
            
                "round_mode": "artist",
            
        
    
        
        
            
                "state": "answered",
            
        
    
        
        
            
                "time_limit_ms": 7000,
            
        
    
        
        
            
                "presented_at": new Date('2026-05-05T19:05:05Z'),
            
        
    
        
        
            
                "answered_at": new Date('2026-05-05T19:05:09Z'),
            
        
    
        
        
            
                "player_choice": "b",
            
        
    
        
        
            
                "correct_choice": "a",
            
        
    
        
        
            
                "is_correct": false,
            
        
    
        
        
            
                "lose_reason": "none",
            
        
    
        
        
            
                "value_a": 7200000,
            
        
    
        
        
            
                "value_b": 8800000,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LeaderboardEntriesData = [
    
    {
    
        
        
            
                "board_type": "all_time",
            
        
    
        
        
            
                "seed_key": "all_time",
            
        
    
        
        
            
                "score": 7,
            
        
    
        
        
            
                "rounds_survived": 9,
            
        
    
        
        
            
                "best_streak": 7,
            
        
    
        
        
            
                "achieved_at": new Date('2026-05-05T18:34:12Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "board_type": "all_time",
            
        
    
        
        
            
                "seed_key": "all_time",
            
        
    
        
        
            
                "score": 5,
            
        
    
        
        
            
                "rounds_survived": 7,
            
        
    
        
        
            
                "best_streak": 5,
            
        
    
        
        
            
                "achieved_at": new Date('2026-05-05T19:08:42Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "board_type": "all_time",
            
        
    
        
        
            
                "seed_key": "2026-05-05",
            
        
    
        
        
            
                "score": 4,
            
        
    
        
        
            
                "rounds_survived": 6,
            
        
    
        
        
            
                "best_streak": 4,
            
        
    
        
        
            
                "achieved_at": new Date('2026-05-04T17:13:22Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "board_type": "daily_seed",
            
        
    
        
        
            
                "seed_key": "2026-05-06",
            
        
    
        
        
            
                "score": 1,
            
        
    
        
        
            
                "rounds_survived": 2,
            
        
    
        
        
            
                "best_streak": 1,
            
        
    
        
        
            
                "achieved_at": new Date('2026-05-06T09:00:30Z'),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DailySeedsData = [
    
    {
    
        
        
            
                "seed_key": "2026-05-02",
            
        
    
        
        
            
                "active_from": new Date('2026-05-02T00:00:00Z'),
            
        
    
        
        
            
                "active_to": new Date('2026-05-03T00:00:00Z'),
            
        
    
        
        
            
                "timer_profile": "insane",
            
        
    
        
        
            
                "mode_selection": "mixed",
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
    {
    
        
        
            
                "seed_key": "2026-05-03",
            
        
    
        
        
            
                "active_from": new Date('2026-05-03T00:00:00Z'),
            
        
    
        
        
            
                "active_to": new Date('2026-05-04T00:00:00Z'),
            
        
    
        
        
            
                "timer_profile": "normal",
            
        
    
        
        
            
                "mode_selection": "mapper_only",
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
    {
    
        
        
            
                "seed_key": "2026-05-04",
            
        
    
        
        
            
                "active_from": new Date('2026-05-04T00:00:00Z'),
            
        
    
        
        
            
                "active_to": new Date('2026-05-05T00:00:00Z'),
            
        
    
        
        
            
                "timer_profile": "normal",
            
        
    
        
        
            
                "mode_selection": "artist_only",
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
    {
    
        
        
            
                "seed_key": "2026-05-05",
            
        
    
        
        
            
                "active_from": new Date('2026-05-05T00:00:00Z'),
            
        
    
        
        
            
                "active_to": new Date('2026-05-06T00:00:00Z'),
            
        
    
        
        
            
                "timer_profile": "insane",
            
        
    
        
        
            
                "mode_selection": "artist_only",
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
];



const ServerCachesData = [
    
    {
    
        
        
            
                "cache_key": "osu_token_public",
            
        
    
        
        
            
                "cache_type": "redis",
            
        
    
        
        
            
                "namespace": "rate_limits",
            
        
    
        
        
            
                "expires_at": new Date('2026-05-05T09:10:00Z'),
            
        
    
        
        
            
                "refreshed_at": new Date('2026-05-05T08:10:00Z'),
            
        
    
        
        
            
                "value_hash": "sha256:tokenhash01",
            
        
    
    },
    
    {
    
        
        
            
                "cache_key": "mapper_totals_v1",
            
        
    
        
        
            
                "cache_type": "memory",
            
        
    
        
        
            
                "namespace": "artist_totals",
            
        
    
        
        
            
                "expires_at": new Date('2026-05-05T14:00:00Z'),
            
        
    
        
        
            
                "refreshed_at": new Date('2026-05-05T08:35:10Z'),
            
        
    
        
        
            
                "value_hash": "sha256:mappertotals01",
            
        
    
    },
    
    {
    
        
        
            
                "cache_key": "artist_totals_v1",
            
        
    
        
        
            
                "cache_type": "database",
            
        
    
        
        
            
                "namespace": "game_pool",
            
        
    
        
        
            
                "expires_at": new Date('2026-05-05T14:00:00Z'),
            
        
    
        
        
            
                "refreshed_at": new Date('2026-05-05T08:36:10Z'),
            
        
    
        
        
            
                "value_hash": "sha256:artisttotals01",
            
        
    
    },
    
    {
    
        
        
            
                "cache_key": "game_pool_ranked_loved_osu",
            
        
    
        
        
            
                "cache_type": "database",
            
        
    
        
        
            
                "namespace": "artist_totals",
            
        
    
        
        
            
                "expires_at": new Date('2026-05-05T12:00:00Z'),
            
        
    
        
        
            
                "refreshed_at": new Date('2026-05-05T08:26:30Z'),
            
        
    
        
        
            
                "value_hash": "sha256:poolhash01",
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
    
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateApiRequestLogWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ApiRequestLog0 = await ApiRequestLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ApiRequestLog0?.setUser)
                {
                    await
                    ApiRequestLog0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ApiRequestLog1 = await ApiRequestLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ApiRequestLog1?.setUser)
                {
                    await
                    ApiRequestLog1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ApiRequestLog2 = await ApiRequestLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ApiRequestLog2?.setUser)
                {
                    await
                    ApiRequestLog2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ApiRequestLog3 = await ApiRequestLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ApiRequestLog3?.setUser)
                {
                    await
                    ApiRequestLog3.
                    setUser(relatedUser3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSyncJobWithTriggered_by() {
            
                const relatedTriggered_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SyncJob0 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SyncJob0?.setTriggered_by)
                {
                    await
                    SyncJob0.
                    setTriggered_by(relatedTriggered_by0);
                }
            
                const relatedTriggered_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SyncJob1 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SyncJob1?.setTriggered_by)
                {
                    await
                    SyncJob1.
                    setTriggered_by(relatedTriggered_by1);
                }
            
                const relatedTriggered_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SyncJob2 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SyncJob2?.setTriggered_by)
                {
                    await
                    SyncJob2.
                    setTriggered_by(relatedTriggered_by2);
                }
            
                const relatedTriggered_by3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SyncJob3 = await SyncJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SyncJob3?.setTriggered_by)
                {
                    await
                    SyncJob3.
                    setTriggered_by(relatedTriggered_by3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBeatmapWithBeatmap_set() {
            
                const relatedBeatmap_set0 = await BeatmapSets.findOne({
                    offset: Math.floor(Math.random() * (await BeatmapSets.count())),
                });
                const Beatmap0 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Beatmap0?.setBeatmap_set)
                {
                    await
                    Beatmap0.
                    setBeatmap_set(relatedBeatmap_set0);
                }
            
                const relatedBeatmap_set1 = await BeatmapSets.findOne({
                    offset: Math.floor(Math.random() * (await BeatmapSets.count())),
                });
                const Beatmap1 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Beatmap1?.setBeatmap_set)
                {
                    await
                    Beatmap1.
                    setBeatmap_set(relatedBeatmap_set1);
                }
            
                const relatedBeatmap_set2 = await BeatmapSets.findOne({
                    offset: Math.floor(Math.random() * (await BeatmapSets.count())),
                });
                const Beatmap2 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Beatmap2?.setBeatmap_set)
                {
                    await
                    Beatmap2.
                    setBeatmap_set(relatedBeatmap_set2);
                }
            
                const relatedBeatmap_set3 = await BeatmapSets.findOne({
                    offset: Math.floor(Math.random() * (await BeatmapSets.count())),
                });
                const Beatmap3 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Beatmap3?.setBeatmap_set)
                {
                    await
                    Beatmap3.
                    setBeatmap_set(relatedBeatmap_set3);
                }
            
        }
        
    
        
            
            async function associateBeatmapWithMapper() {
            
                const relatedMapper0 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const Beatmap0 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Beatmap0?.setMapper)
                {
                    await
                    Beatmap0.
                    setMapper(relatedMapper0);
                }
            
                const relatedMapper1 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const Beatmap1 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Beatmap1?.setMapper)
                {
                    await
                    Beatmap1.
                    setMapper(relatedMapper1);
                }
            
                const relatedMapper2 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const Beatmap2 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Beatmap2?.setMapper)
                {
                    await
                    Beatmap2.
                    setMapper(relatedMapper2);
                }
            
                const relatedMapper3 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const Beatmap3 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Beatmap3?.setMapper)
                {
                    await
                    Beatmap3.
                    setMapper(relatedMapper3);
                }
            
        }
        
    
        
            
            async function associateBeatmapWithArtist() {
            
                const relatedArtist0 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const Beatmap0 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Beatmap0?.setArtist)
                {
                    await
                    Beatmap0.
                    setArtist(relatedArtist0);
                }
            
                const relatedArtist1 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const Beatmap1 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Beatmap1?.setArtist)
                {
                    await
                    Beatmap1.
                    setArtist(relatedArtist1);
                }
            
                const relatedArtist2 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const Beatmap2 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Beatmap2?.setArtist)
                {
                    await
                    Beatmap2.
                    setArtist(relatedArtist2);
                }
            
                const relatedArtist3 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const Beatmap3 = await Beatmaps.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Beatmap3?.setArtist)
                {
                    await
                    Beatmap3.
                    setArtist(relatedArtist3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateMapperStatWithMapper() {
            
                const relatedMapper0 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const MapperStat0 = await MapperStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MapperStat0?.setMapper)
                {
                    await
                    MapperStat0.
                    setMapper(relatedMapper0);
                }
            
                const relatedMapper1 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const MapperStat1 = await MapperStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MapperStat1?.setMapper)
                {
                    await
                    MapperStat1.
                    setMapper(relatedMapper1);
                }
            
                const relatedMapper2 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const MapperStat2 = await MapperStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MapperStat2?.setMapper)
                {
                    await
                    MapperStat2.
                    setMapper(relatedMapper2);
                }
            
                const relatedMapper3 = await Mappers.findOne({
                    offset: Math.floor(Math.random() * (await Mappers.count())),
                });
                const MapperStat3 = await MapperStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (MapperStat3?.setMapper)
                {
                    await
                    MapperStat3.
                    setMapper(relatedMapper3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateArtistStatWithArtist() {
            
                const relatedArtist0 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const ArtistStat0 = await ArtistStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ArtistStat0?.setArtist)
                {
                    await
                    ArtistStat0.
                    setArtist(relatedArtist0);
                }
            
                const relatedArtist1 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const ArtistStat1 = await ArtistStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ArtistStat1?.setArtist)
                {
                    await
                    ArtistStat1.
                    setArtist(relatedArtist1);
                }
            
                const relatedArtist2 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const ArtistStat2 = await ArtistStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ArtistStat2?.setArtist)
                {
                    await
                    ArtistStat2.
                    setArtist(relatedArtist2);
                }
            
                const relatedArtist3 = await Artists.findOne({
                    offset: Math.floor(Math.random() * (await Artists.count())),
                });
                const ArtistStat3 = await ArtistStats.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ArtistStat3?.setArtist)
                {
                    await
                    ArtistStat3.
                    setArtist(relatedArtist3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateGameSessionWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GameSession0 = await GameSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GameSession0?.setUser)
                {
                    await
                    GameSession0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GameSession1 = await GameSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GameSession1?.setUser)
                {
                    await
                    GameSession1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GameSession2 = await GameSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GameSession2?.setUser)
                {
                    await
                    GameSession2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const GameSession3 = await GameSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GameSession3?.setUser)
                {
                    await
                    GameSession3.
                    setUser(relatedUser3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateGameRoundWithSession() {
            
                const relatedSession0 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const GameRound0 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GameRound0?.setSession)
                {
                    await
                    GameRound0.
                    setSession(relatedSession0);
                }
            
                const relatedSession1 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const GameRound1 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GameRound1?.setSession)
                {
                    await
                    GameRound1.
                    setSession(relatedSession1);
                }
            
                const relatedSession2 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const GameRound2 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GameRound2?.setSession)
                {
                    await
                    GameRound2.
                    setSession(relatedSession2);
                }
            
                const relatedSession3 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const GameRound3 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GameRound3?.setSession)
                {
                    await
                    GameRound3.
                    setSession(relatedSession3);
                }
            
        }
        
    
        
            
            async function associateGameRoundWithOption_a_beatmap() {
            
                const relatedOption_a_beatmap0 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound0 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GameRound0?.setOption_a_beatmap)
                {
                    await
                    GameRound0.
                    setOption_a_beatmap(relatedOption_a_beatmap0);
                }
            
                const relatedOption_a_beatmap1 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound1 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GameRound1?.setOption_a_beatmap)
                {
                    await
                    GameRound1.
                    setOption_a_beatmap(relatedOption_a_beatmap1);
                }
            
                const relatedOption_a_beatmap2 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound2 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GameRound2?.setOption_a_beatmap)
                {
                    await
                    GameRound2.
                    setOption_a_beatmap(relatedOption_a_beatmap2);
                }
            
                const relatedOption_a_beatmap3 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound3 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GameRound3?.setOption_a_beatmap)
                {
                    await
                    GameRound3.
                    setOption_a_beatmap(relatedOption_a_beatmap3);
                }
            
        }
        
    
        
            
            async function associateGameRoundWithOption_b_beatmap() {
            
                const relatedOption_b_beatmap0 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound0 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (GameRound0?.setOption_b_beatmap)
                {
                    await
                    GameRound0.
                    setOption_b_beatmap(relatedOption_b_beatmap0);
                }
            
                const relatedOption_b_beatmap1 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound1 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (GameRound1?.setOption_b_beatmap)
                {
                    await
                    GameRound1.
                    setOption_b_beatmap(relatedOption_b_beatmap1);
                }
            
                const relatedOption_b_beatmap2 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound2 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (GameRound2?.setOption_b_beatmap)
                {
                    await
                    GameRound2.
                    setOption_b_beatmap(relatedOption_b_beatmap2);
                }
            
                const relatedOption_b_beatmap3 = await Beatmaps.findOne({
                    offset: Math.floor(Math.random() * (await Beatmaps.count())),
                });
                const GameRound3 = await GameRounds.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (GameRound3?.setOption_b_beatmap)
                {
                    await
                    GameRound3.
                    setOption_b_beatmap(relatedOption_b_beatmap3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateLeaderboardEntryWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LeaderboardEntry0 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaderboardEntry0?.setUser)
                {
                    await
                    LeaderboardEntry0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LeaderboardEntry1 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaderboardEntry1?.setUser)
                {
                    await
                    LeaderboardEntry1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LeaderboardEntry2 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaderboardEntry2?.setUser)
                {
                    await
                    LeaderboardEntry2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const LeaderboardEntry3 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LeaderboardEntry3?.setUser)
                {
                    await
                    LeaderboardEntry3.
                    setUser(relatedUser3);
                }
            
        }
        
    
        
            
            async function associateLeaderboardEntryWithSession() {
            
                const relatedSession0 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const LeaderboardEntry0 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LeaderboardEntry0?.setSession)
                {
                    await
                    LeaderboardEntry0.
                    setSession(relatedSession0);
                }
            
                const relatedSession1 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const LeaderboardEntry1 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LeaderboardEntry1?.setSession)
                {
                    await
                    LeaderboardEntry1.
                    setSession(relatedSession1);
                }
            
                const relatedSession2 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const LeaderboardEntry2 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LeaderboardEntry2?.setSession)
                {
                    await
                    LeaderboardEntry2.
                    setSession(relatedSession2);
                }
            
                const relatedSession3 = await GameSessions.findOne({
                    offset: Math.floor(Math.random() * (await GameSessions.count())),
                });
                const LeaderboardEntry3 = await LeaderboardEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LeaderboardEntry3?.setSession)
                {
                    await
                    LeaderboardEntry3.
                    setSession(relatedSession3);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await OsuApiCredentials.bulkCreate(OsuApiCredentialsData);
                
            
            
                
                await ApiRequestLogs.bulkCreate(ApiRequestLogsData);
                
            
            
                
                await SyncJobs.bulkCreate(SyncJobsData);
                
            
            
                
                await BeatmapSets.bulkCreate(BeatmapSetsData);
                
            
            
                
                await Mappers.bulkCreate(MappersData);
                
            
            
                
                await Artists.bulkCreate(ArtistsData);
                
            
            
                
                await Beatmaps.bulkCreate(BeatmapsData);
                
            
            
                
                await MapperStats.bulkCreate(MapperStatsData);
                
            
            
                
                await ArtistStats.bulkCreate(ArtistStatsData);
                
            
            
                
                await GameSessions.bulkCreate(GameSessionsData);
                
            
            
                
                await GameRounds.bulkCreate(GameRoundsData);
                
            
            
                
                await LeaderboardEntries.bulkCreate(LeaderboardEntriesData);
                
            
            
                
                await DailySeeds.bulkCreate(DailySeedsData);
                
            
            
                
                await ServerCaches.bulkCreate(ServerCachesData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateApiRequestLogWithUser(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSyncJobWithTriggered_by(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBeatmapWithBeatmap_set(),
                    
                
                    
                        
                        await associateBeatmapWithMapper(),
                    
                
                    
                        
                        await associateBeatmapWithArtist(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateMapperStatWithMapper(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateArtistStatWithArtist(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGameSessionWithUser(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateGameRoundWithSession(),
                    
                
                    
                        
                        await associateGameRoundWithOption_a_beatmap(),
                    
                
                    
                        
                        await associateGameRoundWithOption_b_beatmap(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLeaderboardEntryWithUser(),
                    
                
                    
                        
                        await associateLeaderboardEntryWithSession(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('osu_api_credentials', null, {});
            
            
            await queryInterface.bulkDelete('api_request_logs', null, {});
            
            
            await queryInterface.bulkDelete('sync_jobs', null, {});
            
            
            await queryInterface.bulkDelete('beatmap_sets', null, {});
            
            
            await queryInterface.bulkDelete('mappers', null, {});
            
            
            await queryInterface.bulkDelete('artists', null, {});
            
            
            await queryInterface.bulkDelete('beatmaps', null, {});
            
            
            await queryInterface.bulkDelete('mapper_stats', null, {});
            
            
            await queryInterface.bulkDelete('artist_stats', null, {});
            
            
            await queryInterface.bulkDelete('game_sessions', null, {});
            
            
            await queryInterface.bulkDelete('game_rounds', null, {});
            
            
            await queryInterface.bulkDelete('leaderboard_entries', null, {});
            
            
            await queryInterface.bulkDelete('daily_seeds', null, {});
            
            
            await queryInterface.bulkDelete('server_caches', null, {});
            
        
    },
};