





















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






const Organizations = db.organizations;

const RolePermissions = db.role_permissions;

const Memberships = db.memberships;

const Events = db.events;

const Albums = db.albums;

const AlbumCollaborators = db.album_collaborators;

const AccessRules = db.access_rules;

const MediaItems = db.media_items;

const StorageBuckets = db.storage_buckets;

const StorageObjects = db.storage_objects;

const UploadSessions = db.upload_sessions;

const UploadFiles = db.upload_files;

const Tags = db.tags;

const MediaAiTags = db.media_ai_tags;

const MediaUserTags = db.media_user_tags;

const Likes = db.likes;

const Favourites = db.favourites;

const Comments = db.comments;

const Mentions = db.mentions;

const Notifications = db.notifications;

const NotificationPreferences = db.notification_preferences;

const Shares = db.shares;

const DownloadJobs = db.download_jobs;

const WatermarkProfiles = db.watermark_profiles;

const AiModels = db.ai_models;

const AiEmbeddings = db.ai_embeddings;

const FaceDetections = db.face_detections;

const SelfieReferences = db.selfie_references;

const FaceMatches = db.face_matches;

const AiCaptions = db.ai_captions;

const ModerationFlags = db.moderation_flags;

const Stories = db.stories;

const StoryItems = db.story_items;

const AnalyticsEvents = db.analytics_events;

const OauthAccounts = db.oauth_accounts;







const OrganizationsData = [
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
    },
    
];



const RolePermissionsData = [
    
    {
    
        
        
            
                "resource": "albums",
            
        
    
        
        
            
                "action": "delete",
            
        
    
        
        
            
                "allowed": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "resource": "notifications",
            
        
    
        
        
            
                "action": "moderate",
            
        
    
        
        
            
                "allowed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "resource": "comments",
            
        
    
        
        
            
                "action": "moderate",
            
        
    
        
        
            
                "allowed": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MembershipsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "invited",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "removed",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "invited",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
    },
    
];



const EventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "category": "fest",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "privacy": "unlisted",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "category": "workshop",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "privacy": "unlisted",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "category": "photoshoot",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "privacy": "private",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const AlbumsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "privacy": "private",
            
        
    
        
        
            
                "collaboration_mode": "members_can_add",
            
        
    
        
        
            
                "allow_downloads": true,
            
        
    
        
        
            
                "allow_comments": true,
            
        
    
        
        
            
                "allow_likes": false,
            
        
    
        
        
            
                "allow_tagging": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "privacy": "private",
            
        
    
        
        
            
                "collaboration_mode": "members_can_add",
            
        
    
        
        
            
                "allow_downloads": true,
            
        
    
        
        
            
                "allow_comments": false,
            
        
    
        
        
            
                "allow_likes": true,
            
        
    
        
        
            
                "allow_tagging": true,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "privacy": "unlisted",
            
        
    
        
        
            
                "collaboration_mode": "members_can_add",
            
        
    
        
        
            
                "allow_downloads": false,
            
        
    
        
        
            
                "allow_comments": true,
            
        
    
        
        
            
                "allow_likes": false,
            
        
    
        
        
            
                "allow_tagging": true,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AlbumCollaboratorsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "viewer",
            
        
    
        
        
            
                "status": "invited",
            
        
    
        
        
            
                "invited_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "viewer",
            
        
    
        
        
            
                "status": "invited",
            
        
    
        
        
            
                "invited_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "role": "viewer",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "invited_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AccessRulesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject_type": "role",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "permission": "view",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject_type": "membership",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "permission": "upload",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "subject_type": "role",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "permission": "download",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MediaItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "media_type": "video",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "caption": "Marie Curie",
            
        
    
        
        
            
                "captured_at": new Date(Date.now()),
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                "width": 9,
            
        
    
        
        
            
                "height": 4,
            
        
    
        
        
            
                "duration_seconds": 4.7,
            
        
    
        
        
            
                "camera_make": "Ada Lovelace",
            
        
    
        
        
            
                "camera_model": "Ada Lovelace",
            
        
    
        
        
            
                "gps_latitude": 2.0,
            
        
    
        
        
            
                "gps_longitude": 1.79,
            
        
    
        
        
            
                "visibility": "deleted",
            
        
    
        
        
            
                "is_duplicate": true,
            
        
    
        
        
            
                "duplicate_group_key": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "media_type": "video",
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "caption": "Ada Lovelace",
            
        
    
        
        
            
                "captured_at": new Date(Date.now()),
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                "width": 6,
            
        
    
        
        
            
                "height": 6,
            
        
    
        
        
            
                "duration_seconds": 2.48,
            
        
    
        
        
            
                "camera_make": "Ada Lovelace",
            
        
    
        
        
            
                "camera_model": "Ada Lovelace",
            
        
    
        
        
            
                "gps_latitude": 8.95,
            
        
    
        
        
            
                "gps_longitude": 2.62,
            
        
    
        
        
            
                "visibility": "deleted",
            
        
    
        
        
            
                "is_duplicate": false,
            
        
    
        
        
            
                "duplicate_group_key": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "media_type": "video",
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "caption": "Alan Turing",
            
        
    
        
        
            
                "captured_at": new Date(Date.now()),
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                "width": 3,
            
        
    
        
        
            
                "height": 7,
            
        
    
        
        
            
                "duration_seconds": 1.47,
            
        
    
        
        
            
                "camera_make": "Alan Turing",
            
        
    
        
        
            
                "camera_model": "Grace Hopper",
            
        
    
        
        
            
                "gps_latitude": 4.26,
            
        
    
        
        
            
                "gps_longitude": 5.13,
            
        
    
        
        
            
                "visibility": "visible",
            
        
    
        
        
            
                "is_duplicate": false,
            
        
    
        
        
            
                "duplicate_group_key": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StorageBucketsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "Marie Curie",
            
        
    
        
        
            
                "bucket_name": "Marie Curie",
            
        
    
        
        
            
                "region": "Ada Lovelace",
            
        
    
        
        
            
                "cdn_domain": "Grace Hopper",
            
        
    
        
        
            
                "default_bucket": false,
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "Marie Curie",
            
        
    
        
        
            
                "bucket_name": "Marie Curie",
            
        
    
        
        
            
                "region": "Grace Hopper",
            
        
    
        
        
            
                "cdn_domain": "Alan Turing",
            
        
    
        
        
            
                "default_bucket": true,
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "Ada Lovelace",
            
        
    
        
        
            
                "bucket_name": "Marie Curie",
            
        
    
        
        
            
                "region": "Marie Curie",
            
        
    
        
        
            
                "cdn_domain": "Marie Curie",
            
        
    
        
        
            
                "default_bucket": false,
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const StorageObjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "object_key": "Grace Hopper",
            
        
    
        
        
            
                "content_type": "Ada Lovelace",
            
        
    
        
        
            
                "size_bytes": 3,
            
        
    
        
        
            
                "etag": "Grace Hopper",
            
        
    
        
        
            
                "sha256": "Marie Curie",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "compression_ratio": 8.11,
            
        
    
        
        
            
                "status": "ready",
            
        
    
        
        
            
                "trashed_at": new Date(Date.now()),
            
        
    
        
        
            
                "purge_after": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "object_key": "Alan Turing",
            
        
    
        
        
            
                "content_type": "Ada Lovelace",
            
        
    
        
        
            
                "size_bytes": 8,
            
        
    
        
        
            
                "etag": "Marie Curie",
            
        
    
        
        
            
                "sha256": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "compression_ratio": 2.36,
            
        
    
        
        
            
                "status": "ready",
            
        
    
        
        
            
                "trashed_at": new Date(Date.now()),
            
        
    
        
        
            
                "purge_after": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "object_key": "Ada Lovelace",
            
        
    
        
        
            
                "content_type": "Grace Hopper",
            
        
    
        
        
            
                "size_bytes": 3,
            
        
    
        
        
            
                "etag": "Grace Hopper",
            
        
    
        
        
            
                "sha256": "Alan Turing",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "compression_ratio": 2.42,
            
        
    
        
        
            
                "status": "ready",
            
        
    
        
        
            
                "trashed_at": new Date(Date.now()),
            
        
    
        
        
            
                "purge_after": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const UploadSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "total_files": 4,
            
        
    
        
        
            
                "completed_files": 7,
            
        
    
        
        
            
                "failed_files": 4,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "in_progress",
            
        
    
        
        
            
                "total_files": 8,
            
        
    
        
        
            
                "completed_files": 7,
            
        
    
        
        
            
                "failed_files": 1,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "completed",
            
        
    
        
        
            
                "total_files": 9,
            
        
    
        
        
            
                "completed_files": 1,
            
        
    
        
        
            
                "failed_files": 6,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const UploadFilesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_name": "Grace Hopper",
            
        
    
        
        
            
                "content_type": "Grace Hopper",
            
        
    
        
        
            
                "size_bytes": 8,
            
        
    
        
        
            
                "status": "processing",
            
        
    
        
        
            
                "progress_percent": 6,
            
        
    
        
        
            
                "error_message": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_name": "Ada Lovelace",
            
        
    
        
        
            
                "content_type": "Marie Curie",
            
        
    
        
        
            
                "size_bytes": 5,
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "progress_percent": 6,
            
        
    
        
        
            
                "error_message": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_name": "Grace Hopper",
            
        
    
        
        
            
                "content_type": "Ada Lovelace",
            
        
    
        
        
            
                "size_bytes": 3,
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "progress_percent": 5,
            
        
    
        
        
            
                "error_message": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TagsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "tag_type": "ai",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "tag_type": "system",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "tag_type": "system",
            
        
    
    },
    
];



const MediaAiTagsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "confidence": 7.94,
            
        
    
        
        
            
                "source": "manual_review",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "confidence": 1.16,
            
        
    
        
        
            
                "source": "manual_review",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "confidence": 2.76,
            
        
    
        
        
            
                "source": "custom_model",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MediaUserTagsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LikesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "liked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "liked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "liked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const FavouritesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "saved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "saved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "saved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CommentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "content": "Grace Hopper",
            
        
    
        
        
            
                "status": "deleted",
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "status": "deleted",
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "status": "flagged",
            
        
    
        
        
            
                "posted_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const MentionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const NotificationsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "upload_complete",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "body": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "mention",
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "body": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "type": "upload_complete",
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "body": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_read": true,
            
        
    
        
        
            
                "read_at": new Date(Date.now()),
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const NotificationPreferencesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "in_app",
            
        
    
        
        
            
                "likes_enabled": true,
            
        
    
        
        
            
                "comments_enabled": false,
            
        
    
        
        
            
                "tags_enabled": false,
            
        
    
        
        
            
                "mentions_enabled": true,
            
        
    
        
        
            
                "shares_enabled": true,
            
        
    
        
        
            
                "uploads_enabled": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "email",
            
        
    
        
        
            
                "likes_enabled": false,
            
        
    
        
        
            
                "comments_enabled": true,
            
        
    
        
        
            
                "tags_enabled": false,
            
        
    
        
        
            
                "mentions_enabled": true,
            
        
    
        
        
            
                "shares_enabled": false,
            
        
    
        
        
            
                "uploads_enabled": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "in_app",
            
        
    
        
        
            
                "likes_enabled": true,
            
        
    
        
        
            
                "comments_enabled": true,
            
        
    
        
        
            
                "tags_enabled": false,
            
        
    
        
        
            
                "mentions_enabled": true,
            
        
    
        
        
            
                "shares_enabled": true,
            
        
    
        
        
            
                "uploads_enabled": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SharesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "share_type": "public_link",
            
        
    
        
        
            
                "token": "Marie Curie",
            
        
    
        
        
            
                "access_level": "comment",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "max_uses": 9,
            
        
    
        
        
            
                "uses_count": 5,
            
        
    
        
        
            
                "revoked": true,
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "share_type": "public_link",
            
        
    
        
        
            
                "token": "Alan Turing",
            
        
    
        
        
            
                "access_level": "upload",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "max_uses": 2,
            
        
    
        
        
            
                "uses_count": 6,
            
        
    
        
        
            
                "revoked": false,
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "share_type": "public_link",
            
        
    
        
        
            
                "token": "Grace Hopper",
            
        
    
        
        
            
                "access_level": "download",
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "max_uses": 2,
            
        
    
        
        
            
                "uses_count": 4,
            
        
    
        
        
            
                "revoked": true,
            
        
    
        
        
            
                "revoked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const DownloadJobsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "watermark_text": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "error_message": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "watermark_text": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "error_message": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "watermark_text": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "requested_at": new Date(Date.now()),
            
        
    
        
        
            
                "completed_at": new Date(Date.now()),
            
        
    
        
        
            
                "error_message": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WatermarkProfilesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "mode": "text",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "default_text_template": "Marie Curie",
            
        
    
        
        
            
                "opacity": 3.86,
            
        
    
        
        
            
                "position": "top_right",
            
        
    
        
        
            
                "scale": 4.43,
            
        
    
        
        
            
                "enabled": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "mode": "text",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "default_text_template": "Ada Lovelace",
            
        
    
        
        
            
                "opacity": 1.02,
            
        
    
        
        
            
                "position": "center",
            
        
    
        
        
            
                "scale": 3.04,
            
        
    
        
        
            
                "enabled": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "mode": "text",
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                "default_text_template": "Grace Hopper",
            
        
    
        
        
            
                "opacity": 2.33,
            
        
    
        
        
            
                "position": "bottom_left",
            
        
    
        
        
            
                "scale": 4.16,
            
        
    
        
        
            
                "enabled": true,
            
        
    
    },
    
];



const AiModelsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "model_type": "captioning",
            
        
    
        
        
            
                "provider": "Alan Turing",
            
        
    
        
        
            
                "version": "Grace Hopper",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "model_type": "captioning",
            
        
    
        
        
            
                "provider": "Alan Turing",
            
        
    
        
        
            
                "version": "Grace Hopper",
            
        
    
        
        
            
                "status": "active",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "model_type": "duplicate_detection",
            
        
    
        
        
            
                "provider": "Ada Lovelace",
            
        
    
        
        
            
                "version": "Ada Lovelace",
            
        
    
        
        
            
                "status": "disabled",
            
        
    
    },
    
];



const AiEmbeddingsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vector_ref": "Alan Turing",
            
        
    
        
        
            
                "dimensions": 6,
            
        
    
        
        
            
                "embedding_type": "text",
            
        
    
        
        
            
                "quality_score": 2.99,
            
        
    
        
        
            
                "indexed_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vector_ref": "Ada Lovelace",
            
        
    
        
        
            
                "dimensions": 9,
            
        
    
        
        
            
                "embedding_type": "image",
            
        
    
        
        
            
                "quality_score": 2.94,
            
        
    
        
        
            
                "indexed_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "vector_ref": "Alan Turing",
            
        
    
        
        
            
                "dimensions": 5,
            
        
    
        
        
            
                "embedding_type": "face",
            
        
    
        
        
            
                "quality_score": 5.48,
            
        
    
        
        
            
                "indexed_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const FaceDetectionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bbox_x": 8.07,
            
        
    
        
        
            
                "bbox_y": 7.14,
            
        
    
        
        
            
                "bbox_width": 1.28,
            
        
    
        
        
            
                "bbox_height": 8.18,
            
        
    
        
        
            
                "confidence": 5.4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bbox_x": 7.5,
            
        
    
        
        
            
                "bbox_y": 8.03,
            
        
    
        
        
            
                "bbox_width": 1.23,
            
        
    
        
        
            
                "bbox_height": 3.7,
            
        
    
        
        
            
                "confidence": 1.39,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bbox_x": 4.77,
            
        
    
        
        
            
                "bbox_y": 3.47,
            
        
    
        
        
            
                "bbox_width": 5.81,
            
        
    
        
        
            
                "bbox_height": 8.87,
            
        
    
        
        
            
                "confidence": 5.23,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SelfieReferencesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "images" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "uploaded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const FaceMatchesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "match_score": 3.81,
            
        
    
        
        
            
                "confidence_badge": "very_high",
            
        
    
        
        
            
                "matched_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "match_score": 3.85,
            
        
    
        
        
            
                "confidence_badge": "low",
            
        
    
        
        
            
                "matched_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "match_score": 9.06,
            
        
    
        
        
            
                "confidence_badge": "high",
            
        
    
        
        
            
                "matched_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AiCaptionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "caption_text": "Grace Hopper",
            
        
    
        
        
            
                "confidence": 3.35,
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "caption_text": "Grace Hopper",
            
        
    
        
        
            
                "confidence": 1.98,
            
        
    
        
        
            
                "status": "edited",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "caption_text": "Marie Curie",
            
        
    
        
        
            
                "confidence": 3.35,
            
        
    
        
        
            
                "status": "approved",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ModerationFlagsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reason": "other",
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                "status": "dismissed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reported_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reason": "hate",
            
        
    
        
        
            
                "details": "Grace Hopper",
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reported_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reason": "copyright",
            
        
    
        
        
            
                "details": "Grace Hopper",
            
        
    
        
        
            
                "status": "resolved",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "reported_at": new Date(Date.now()),
            
        
    
        
        
            
                "resolved_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StoriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "status": "published",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "starts_at": new Date(Date.now()),
            
        
    
        
        
            
                "ends_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const StoryItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sort_order": 7,
            
        
    
        
        
            
                "layout": "full",
            
        
    
        
        
            
                "overlay_text": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sort_order": 9,
            
        
    
        
        
            
                "layout": "full",
            
        
    
        
        
            
                "overlay_text": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sort_order": 4,
            
        
    
        
        
            
                "layout": "full",
            
        
    
        
        
            
                "overlay_text": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AnalyticsEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "view",
            
        
    
        
        
            
                "metadata_json": "Marie Curie",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "view",
            
        
    
        
        
            
                "metadata_json": "Ada Lovelace",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "event_type": "like",
            
        
    
        
        
            
                "metadata_json": "Grace Hopper",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
    },
    
];



const OauthAccountsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "facebook",
            
        
    
        
        
            
                "provider_user_key": "Marie Curie",
            
        
    
        
        
            
                "access_token": "Marie Curie",
            
        
    
        
        
            
                "refresh_token": "Grace Hopper",
            
        
    
        
        
            
                "token_expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "facebook",
            
        
    
        
        
            
                "provider_user_key": "Marie Curie",
            
        
    
        
        
            
                "access_token": "Ada Lovelace",
            
        
    
        
        
            
                "refresh_token": "Ada Lovelace",
            
        
    
        
        
            
                "token_expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "provider": "apple",
            
        
    
        
        
            
                "provider_user_key": "Grace Hopper",
            
        
    
        
        
            
                "access_token": "Ada Lovelace",
            
        
    
        
        
            
                "refresh_token": "Grace Hopper",
            
        
    
        
        
            
                "token_expires_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateUserWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User0 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (User0?.setOrganization)
                {
                    await
                    User0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User1 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (User1?.setOrganization)
                {
                    await
                    User1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User2 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (User2?.setOrganization)
                {
                    await
                    User2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
    
    
        
    

    
    
    
        
    
        
    
        
    
        
            
            async function associateRolePermissionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermission0 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (RolePermission0?.setOrganization)
                {
                    await
                    RolePermission0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermission1 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (RolePermission1?.setOrganization)
                {
                    await
                    RolePermission1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const RolePermission2 = await RolePermissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (RolePermission2?.setOrganization)
                {
                    await
                    RolePermission2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMembershipWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Membership0 = await Memberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Membership0?.setOrganization)
                {
                    await
                    Membership0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Membership1 = await Memberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Membership1?.setOrganization)
                {
                    await
                    Membership1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Membership2 = await Memberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Membership2?.setOrganization)
                {
                    await
                    Membership2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    
        
            
            async function associateMembershipWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Membership0 = await Memberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Membership0?.setUser)
                {
                    await
                    Membership0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Membership1 = await Memberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Membership1?.setUser)
                {
                    await
                    Membership1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Membership2 = await Memberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Membership2?.setUser)
                {
                    await
                    Membership2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateEventWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Event0 = await Events.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Event0?.setOrganization)
                {
                    await
                    Event0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Event1 = await Events.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Event1?.setOrganization)
                {
                    await
                    Event1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Event2 = await Events.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Event2?.setOrganization)
                {
                    await
                    Event2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateEventWithDefault_album() {
            
                const relatedDefault_album0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Event0 = await Events.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Event0?.setDefault_album)
                {
                    await
                    Event0.
                    setDefault_album(relatedDefault_album0);
                }
            
                const relatedDefault_album1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Event1 = await Events.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Event1?.setDefault_album)
                {
                    await
                    Event1.
                    setDefault_album(relatedDefault_album1);
                }
            
                const relatedDefault_album2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Event2 = await Events.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Event2?.setDefault_album)
                {
                    await
                    Event2.
                    setDefault_album(relatedDefault_album2);
                }
            
        }
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
            
            async function associateAlbumWithEvent() {
            
                const relatedEvent0 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const Album0 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Album0?.setEvent)
                {
                    await
                    Album0.
                    setEvent(relatedEvent0);
                }
            
                const relatedEvent1 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const Album1 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Album1?.setEvent)
                {
                    await
                    Album1.
                    setEvent(relatedEvent1);
                }
            
                const relatedEvent2 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const Album2 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Album2?.setEvent)
                {
                    await
                    Album2.
                    setEvent(relatedEvent2);
                }
            
        }
        
    
        
            
            async function associateAlbumWithOwner() {
            
                const relatedOwner0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Album0 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Album0?.setOwner)
                {
                    await
                    Album0.
                    setOwner(relatedOwner0);
                }
            
                const relatedOwner1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Album1 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Album1?.setOwner)
                {
                    await
                    Album1.
                    setOwner(relatedOwner1);
                }
            
                const relatedOwner2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Album2 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Album2?.setOwner)
                {
                    await
                    Album2.
                    setOwner(relatedOwner2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateAlbumWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Album0 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Album0?.setOrganization)
                {
                    await
                    Album0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Album1 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Album1?.setOrganization)
                {
                    await
                    Album1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Album2 = await Albums.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Album2?.setOrganization)
                {
                    await
                    Album2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAlbumCollaboratorWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AlbumCollaborator0 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AlbumCollaborator0?.setAlbum)
                {
                    await
                    AlbumCollaborator0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AlbumCollaborator1 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AlbumCollaborator1?.setAlbum)
                {
                    await
                    AlbumCollaborator1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AlbumCollaborator2 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AlbumCollaborator2?.setAlbum)
                {
                    await
                    AlbumCollaborator2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
            
            async function associateAlbumCollaboratorWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlbumCollaborator0 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AlbumCollaborator0?.setUser)
                {
                    await
                    AlbumCollaborator0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlbumCollaborator1 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AlbumCollaborator1?.setUser)
                {
                    await
                    AlbumCollaborator1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AlbumCollaborator2 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AlbumCollaborator2?.setUser)
                {
                    await
                    AlbumCollaborator2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateAlbumCollaboratorWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AlbumCollaborator0 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AlbumCollaborator0?.setOrganization)
                {
                    await
                    AlbumCollaborator0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AlbumCollaborator1 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AlbumCollaborator1?.setOrganization)
                {
                    await
                    AlbumCollaborator1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AlbumCollaborator2 = await AlbumCollaborators.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AlbumCollaborator2?.setOrganization)
                {
                    await
                    AlbumCollaborator2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAccessRuleWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AccessRule0 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccessRule0?.setAlbum)
                {
                    await
                    AccessRule0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AccessRule1 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccessRule1?.setAlbum)
                {
                    await
                    AccessRule1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AccessRule2 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccessRule2?.setAlbum)
                {
                    await
                    AccessRule2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateAccessRuleWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccessRule0 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccessRule0?.setUser)
                {
                    await
                    AccessRule0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccessRule1 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccessRule1?.setUser)
                {
                    await
                    AccessRule1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AccessRule2 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccessRule2?.setUser)
                {
                    await
                    AccessRule2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
            
            async function associateAccessRuleWithMembership() {
            
                const relatedMembership0 = await Memberships.findOne({
                    offset: Math.floor(Math.random() * (await Memberships.count())),
                });
                const AccessRule0 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccessRule0?.setMembership)
                {
                    await
                    AccessRule0.
                    setMembership(relatedMembership0);
                }
            
                const relatedMembership1 = await Memberships.findOne({
                    offset: Math.floor(Math.random() * (await Memberships.count())),
                });
                const AccessRule1 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccessRule1?.setMembership)
                {
                    await
                    AccessRule1.
                    setMembership(relatedMembership1);
                }
            
                const relatedMembership2 = await Memberships.findOne({
                    offset: Math.floor(Math.random() * (await Memberships.count())),
                });
                const AccessRule2 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccessRule2?.setMembership)
                {
                    await
                    AccessRule2.
                    setMembership(relatedMembership2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateAccessRuleWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AccessRule0 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AccessRule0?.setOrganization)
                {
                    await
                    AccessRule0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AccessRule1 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AccessRule1?.setOrganization)
                {
                    await
                    AccessRule1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AccessRule2 = await AccessRules.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AccessRule2?.setOrganization)
                {
                    await
                    AccessRule2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMediaItemWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const MediaItem0 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaItem0?.setAlbum)
                {
                    await
                    MediaItem0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const MediaItem1 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaItem1?.setAlbum)
                {
                    await
                    MediaItem1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const MediaItem2 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaItem2?.setAlbum)
                {
                    await
                    MediaItem2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
            
            async function associateMediaItemWithUploader() {
            
                const relatedUploader0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaItem0 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaItem0?.setUploader)
                {
                    await
                    MediaItem0.
                    setUploader(relatedUploader0);
                }
            
                const relatedUploader1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaItem1 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaItem1?.setUploader)
                {
                    await
                    MediaItem1.
                    setUploader(relatedUploader1);
                }
            
                const relatedUploader2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaItem2 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaItem2?.setUploader)
                {
                    await
                    MediaItem2.
                    setUploader(relatedUploader2);
                }
            
        }
        
    
        
            
            async function associateMediaItemWithStorage_object() {
            
                const relatedStorage_object0 = await StorageObjects.findOne({
                    offset: Math.floor(Math.random() * (await StorageObjects.count())),
                });
                const MediaItem0 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaItem0?.setStorage_object)
                {
                    await
                    MediaItem0.
                    setStorage_object(relatedStorage_object0);
                }
            
                const relatedStorage_object1 = await StorageObjects.findOne({
                    offset: Math.floor(Math.random() * (await StorageObjects.count())),
                });
                const MediaItem1 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaItem1?.setStorage_object)
                {
                    await
                    MediaItem1.
                    setStorage_object(relatedStorage_object1);
                }
            
                const relatedStorage_object2 = await StorageObjects.findOne({
                    offset: Math.floor(Math.random() * (await StorageObjects.count())),
                });
                const MediaItem2 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaItem2?.setStorage_object)
                {
                    await
                    MediaItem2.
                    setStorage_object(relatedStorage_object2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateMediaItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaItem0 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaItem0?.setOrganization)
                {
                    await
                    MediaItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaItem1 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaItem1?.setOrganization)
                {
                    await
                    MediaItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaItem2 = await MediaItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaItem2?.setOrganization)
                {
                    await
                    MediaItem2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStorageBucketWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StorageBucket0 = await StorageBuckets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StorageBucket0?.setOrganization)
                {
                    await
                    StorageBucket0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StorageBucket1 = await StorageBuckets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StorageBucket1?.setOrganization)
                {
                    await
                    StorageBucket1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StorageBucket2 = await StorageBuckets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StorageBucket2?.setOrganization)
                {
                    await
                    StorageBucket2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
            
            async function associateStorageObjectWithBucket() {
            
                const relatedBucket0 = await StorageBuckets.findOne({
                    offset: Math.floor(Math.random() * (await StorageBuckets.count())),
                });
                const StorageObject0 = await StorageObjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StorageObject0?.setBucket)
                {
                    await
                    StorageObject0.
                    setBucket(relatedBucket0);
                }
            
                const relatedBucket1 = await StorageBuckets.findOne({
                    offset: Math.floor(Math.random() * (await StorageBuckets.count())),
                });
                const StorageObject1 = await StorageObjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StorageObject1?.setBucket)
                {
                    await
                    StorageObject1.
                    setBucket(relatedBucket1);
                }
            
                const relatedBucket2 = await StorageBuckets.findOne({
                    offset: Math.floor(Math.random() * (await StorageBuckets.count())),
                });
                const StorageObject2 = await StorageObjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StorageObject2?.setBucket)
                {
                    await
                    StorageObject2.
                    setBucket(relatedBucket2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateStorageObjectWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StorageObject0 = await StorageObjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StorageObject0?.setOrganization)
                {
                    await
                    StorageObject0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StorageObject1 = await StorageObjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StorageObject1?.setOrganization)
                {
                    await
                    StorageObject1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StorageObject2 = await StorageObjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StorageObject2?.setOrganization)
                {
                    await
                    StorageObject2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateUploadSessionWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const UploadSession0 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UploadSession0?.setAlbum)
                {
                    await
                    UploadSession0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const UploadSession1 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UploadSession1?.setAlbum)
                {
                    await
                    UploadSession1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const UploadSession2 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UploadSession2?.setAlbum)
                {
                    await
                    UploadSession2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
            
            async function associateUploadSessionWithInitiator() {
            
                const relatedInitiator0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UploadSession0 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UploadSession0?.setInitiator)
                {
                    await
                    UploadSession0.
                    setInitiator(relatedInitiator0);
                }
            
                const relatedInitiator1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UploadSession1 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UploadSession1?.setInitiator)
                {
                    await
                    UploadSession1.
                    setInitiator(relatedInitiator1);
                }
            
                const relatedInitiator2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const UploadSession2 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UploadSession2?.setInitiator)
                {
                    await
                    UploadSession2.
                    setInitiator(relatedInitiator2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateUploadSessionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UploadSession0 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UploadSession0?.setOrganization)
                {
                    await
                    UploadSession0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UploadSession1 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UploadSession1?.setOrganization)
                {
                    await
                    UploadSession1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UploadSession2 = await UploadSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UploadSession2?.setOrganization)
                {
                    await
                    UploadSession2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateUploadFileWithUpload_session() {
            
                const relatedUpload_session0 = await UploadSessions.findOne({
                    offset: Math.floor(Math.random() * (await UploadSessions.count())),
                });
                const UploadFile0 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UploadFile0?.setUpload_session)
                {
                    await
                    UploadFile0.
                    setUpload_session(relatedUpload_session0);
                }
            
                const relatedUpload_session1 = await UploadSessions.findOne({
                    offset: Math.floor(Math.random() * (await UploadSessions.count())),
                });
                const UploadFile1 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UploadFile1?.setUpload_session)
                {
                    await
                    UploadFile1.
                    setUpload_session(relatedUpload_session1);
                }
            
                const relatedUpload_session2 = await UploadSessions.findOne({
                    offset: Math.floor(Math.random() * (await UploadSessions.count())),
                });
                const UploadFile2 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UploadFile2?.setUpload_session)
                {
                    await
                    UploadFile2.
                    setUpload_session(relatedUpload_session2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateUploadFileWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const UploadFile0 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UploadFile0?.setMedia_item)
                {
                    await
                    UploadFile0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const UploadFile1 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UploadFile1?.setMedia_item)
                {
                    await
                    UploadFile1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const UploadFile2 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UploadFile2?.setMedia_item)
                {
                    await
                    UploadFile2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateUploadFileWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UploadFile0 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (UploadFile0?.setOrganization)
                {
                    await
                    UploadFile0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UploadFile1 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (UploadFile1?.setOrganization)
                {
                    await
                    UploadFile1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const UploadFile2 = await UploadFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (UploadFile2?.setOrganization)
                {
                    await
                    UploadFile2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTagWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Tag0 = await Tags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Tag0?.setOrganization)
                {
                    await
                    Tag0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Tag1 = await Tags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Tag1?.setOrganization)
                {
                    await
                    Tag1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Tag2 = await Tags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Tag2?.setOrganization)
                {
                    await
                    Tag2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    
        
    
        
    

    
    
    
        
            
            async function associateMediaAiTagWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const MediaAiTag0 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaAiTag0?.setMedia_item)
                {
                    await
                    MediaAiTag0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const MediaAiTag1 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaAiTag1?.setMedia_item)
                {
                    await
                    MediaAiTag1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const MediaAiTag2 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaAiTag2?.setMedia_item)
                {
                    await
                    MediaAiTag2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateMediaAiTagWithTag() {
            
                const relatedTag0 = await Tags.findOne({
                    offset: Math.floor(Math.random() * (await Tags.count())),
                });
                const MediaAiTag0 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaAiTag0?.setTag)
                {
                    await
                    MediaAiTag0.
                    setTag(relatedTag0);
                }
            
                const relatedTag1 = await Tags.findOne({
                    offset: Math.floor(Math.random() * (await Tags.count())),
                });
                const MediaAiTag1 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaAiTag1?.setTag)
                {
                    await
                    MediaAiTag1.
                    setTag(relatedTag1);
                }
            
                const relatedTag2 = await Tags.findOne({
                    offset: Math.floor(Math.random() * (await Tags.count())),
                });
                const MediaAiTag2 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaAiTag2?.setTag)
                {
                    await
                    MediaAiTag2.
                    setTag(relatedTag2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateMediaAiTagWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaAiTag0 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaAiTag0?.setOrganization)
                {
                    await
                    MediaAiTag0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaAiTag1 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaAiTag1?.setOrganization)
                {
                    await
                    MediaAiTag1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaAiTag2 = await MediaAiTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaAiTag2?.setOrganization)
                {
                    await
                    MediaAiTag2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMediaUserTagWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const MediaUserTag0 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaUserTag0?.setMedia_item)
                {
                    await
                    MediaUserTag0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const MediaUserTag1 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaUserTag1?.setMedia_item)
                {
                    await
                    MediaUserTag1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const MediaUserTag2 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaUserTag2?.setMedia_item)
                {
                    await
                    MediaUserTag2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateMediaUserTagWithTag() {
            
                const relatedTag0 = await Tags.findOne({
                    offset: Math.floor(Math.random() * (await Tags.count())),
                });
                const MediaUserTag0 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaUserTag0?.setTag)
                {
                    await
                    MediaUserTag0.
                    setTag(relatedTag0);
                }
            
                const relatedTag1 = await Tags.findOne({
                    offset: Math.floor(Math.random() * (await Tags.count())),
                });
                const MediaUserTag1 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaUserTag1?.setTag)
                {
                    await
                    MediaUserTag1.
                    setTag(relatedTag1);
                }
            
                const relatedTag2 = await Tags.findOne({
                    offset: Math.floor(Math.random() * (await Tags.count())),
                });
                const MediaUserTag2 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaUserTag2?.setTag)
                {
                    await
                    MediaUserTag2.
                    setTag(relatedTag2);
                }
            
        }
        
    
        
            
            async function associateMediaUserTagWithTagged_by() {
            
                const relatedTagged_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaUserTag0 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaUserTag0?.setTagged_by)
                {
                    await
                    MediaUserTag0.
                    setTagged_by(relatedTagged_by0);
                }
            
                const relatedTagged_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaUserTag1 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaUserTag1?.setTagged_by)
                {
                    await
                    MediaUserTag1.
                    setTagged_by(relatedTagged_by1);
                }
            
                const relatedTagged_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const MediaUserTag2 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaUserTag2?.setTagged_by)
                {
                    await
                    MediaUserTag2.
                    setTagged_by(relatedTagged_by2);
                }
            
        }
        
    
        
            
            async function associateMediaUserTagWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaUserTag0 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (MediaUserTag0?.setOrganization)
                {
                    await
                    MediaUserTag0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaUserTag1 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (MediaUserTag1?.setOrganization)
                {
                    await
                    MediaUserTag1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const MediaUserTag2 = await MediaUserTags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (MediaUserTag2?.setOrganization)
                {
                    await
                    MediaUserTag2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateLikeWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Like0 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Like0?.setMedia_item)
                {
                    await
                    Like0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Like1 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Like1?.setMedia_item)
                {
                    await
                    Like1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Like2 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Like2?.setMedia_item)
                {
                    await
                    Like2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateLikeWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Like0 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Like0?.setUser)
                {
                    await
                    Like0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Like1 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Like1?.setUser)
                {
                    await
                    Like1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Like2 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Like2?.setUser)
                {
                    await
                    Like2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
            
            async function associateLikeWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Like0 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Like0?.setOrganization)
                {
                    await
                    Like0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Like1 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Like1?.setOrganization)
                {
                    await
                    Like1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Like2 = await Likes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Like2?.setOrganization)
                {
                    await
                    Like2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateFavouriteWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Favourite0 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Favourite0?.setMedia_item)
                {
                    await
                    Favourite0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Favourite1 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Favourite1?.setMedia_item)
                {
                    await
                    Favourite1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Favourite2 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Favourite2?.setMedia_item)
                {
                    await
                    Favourite2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateFavouriteWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Favourite0 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Favourite0?.setUser)
                {
                    await
                    Favourite0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Favourite1 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Favourite1?.setUser)
                {
                    await
                    Favourite1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Favourite2 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Favourite2?.setUser)
                {
                    await
                    Favourite2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
            
            async function associateFavouriteWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Favourite0 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Favourite0?.setOrganization)
                {
                    await
                    Favourite0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Favourite1 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Favourite1?.setOrganization)
                {
                    await
                    Favourite1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Favourite2 = await Favourites.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Favourite2?.setOrganization)
                {
                    await
                    Favourite2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCommentWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Comment0 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Comment0?.setMedia_item)
                {
                    await
                    Comment0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Comment1 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Comment1?.setMedia_item)
                {
                    await
                    Comment1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Comment2 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Comment2?.setMedia_item)
                {
                    await
                    Comment2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateCommentWithAuthor() {
            
                const relatedAuthor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Comment0 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Comment0?.setAuthor)
                {
                    await
                    Comment0.
                    setAuthor(relatedAuthor0);
                }
            
                const relatedAuthor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Comment1 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Comment1?.setAuthor)
                {
                    await
                    Comment1.
                    setAuthor(relatedAuthor1);
                }
            
                const relatedAuthor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Comment2 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Comment2?.setAuthor)
                {
                    await
                    Comment2.
                    setAuthor(relatedAuthor2);
                }
            
        }
        
    
        
            
            async function associateCommentWithParent_comment() {
            
                const relatedParent_comment0 = await Comments.findOne({
                    offset: Math.floor(Math.random() * (await Comments.count())),
                });
                const Comment0 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Comment0?.setParent_comment)
                {
                    await
                    Comment0.
                    setParent_comment(relatedParent_comment0);
                }
            
                const relatedParent_comment1 = await Comments.findOne({
                    offset: Math.floor(Math.random() * (await Comments.count())),
                });
                const Comment1 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Comment1?.setParent_comment)
                {
                    await
                    Comment1.
                    setParent_comment(relatedParent_comment1);
                }
            
                const relatedParent_comment2 = await Comments.findOne({
                    offset: Math.floor(Math.random() * (await Comments.count())),
                });
                const Comment2 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Comment2?.setParent_comment)
                {
                    await
                    Comment2.
                    setParent_comment(relatedParent_comment2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateCommentWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Comment0 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Comment0?.setOrganization)
                {
                    await
                    Comment0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Comment1 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Comment1?.setOrganization)
                {
                    await
                    Comment1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Comment2 = await Comments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Comment2?.setOrganization)
                {
                    await
                    Comment2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateMentionWithComment() {
            
                const relatedComment0 = await Comments.findOne({
                    offset: Math.floor(Math.random() * (await Comments.count())),
                });
                const Mention0 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Mention0?.setComment)
                {
                    await
                    Mention0.
                    setComment(relatedComment0);
                }
            
                const relatedComment1 = await Comments.findOne({
                    offset: Math.floor(Math.random() * (await Comments.count())),
                });
                const Mention1 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Mention1?.setComment)
                {
                    await
                    Mention1.
                    setComment(relatedComment1);
                }
            
                const relatedComment2 = await Comments.findOne({
                    offset: Math.floor(Math.random() * (await Comments.count())),
                });
                const Mention2 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Mention2?.setComment)
                {
                    await
                    Mention2.
                    setComment(relatedComment2);
                }
            
        }
        
    
        
            
            async function associateMentionWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Mention0 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Mention0?.setMedia_item)
                {
                    await
                    Mention0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Mention1 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Mention1?.setMedia_item)
                {
                    await
                    Mention1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Mention2 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Mention2?.setMedia_item)
                {
                    await
                    Mention2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateMentionWithMentioned_user() {
            
                const relatedMentioned_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Mention0 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Mention0?.setMentioned_user)
                {
                    await
                    Mention0.
                    setMentioned_user(relatedMentioned_user0);
                }
            
                const relatedMentioned_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Mention1 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Mention1?.setMentioned_user)
                {
                    await
                    Mention1.
                    setMentioned_user(relatedMentioned_user1);
                }
            
                const relatedMentioned_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Mention2 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Mention2?.setMentioned_user)
                {
                    await
                    Mention2.
                    setMentioned_user(relatedMentioned_user2);
                }
            
        }
        
    
        
            
            async function associateMentionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Mention0 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Mention0?.setOrganization)
                {
                    await
                    Mention0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Mention1 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Mention1?.setOrganization)
                {
                    await
                    Mention1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Mention2 = await Mentions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Mention2?.setOrganization)
                {
                    await
                    Mention2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateNotificationWithRecipient() {
            
                const relatedRecipient0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setRecipient)
                {
                    await
                    Notification0.
                    setRecipient(relatedRecipient0);
                }
            
                const relatedRecipient1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setRecipient)
                {
                    await
                    Notification1.
                    setRecipient(relatedRecipient1);
                }
            
                const relatedRecipient2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setRecipient)
                {
                    await
                    Notification2.
                    setRecipient(relatedRecipient2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateNotificationWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setMedia_item)
                {
                    await
                    Notification0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setMedia_item)
                {
                    await
                    Notification1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setMedia_item)
                {
                    await
                    Notification2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateNotificationWithEvent() {
            
                const relatedEvent0 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setEvent)
                {
                    await
                    Notification0.
                    setEvent(relatedEvent0);
                }
            
                const relatedEvent1 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setEvent)
                {
                    await
                    Notification1.
                    setEvent(relatedEvent1);
                }
            
                const relatedEvent2 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setEvent)
                {
                    await
                    Notification2.
                    setEvent(relatedEvent2);
                }
            
        }
        
    
        
            
            async function associateNotificationWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setAlbum)
                {
                    await
                    Notification0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setAlbum)
                {
                    await
                    Notification1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setAlbum)
                {
                    await
                    Notification2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateNotificationWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Notification0 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Notification0?.setOrganization)
                {
                    await
                    Notification0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Notification1 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Notification1?.setOrganization)
                {
                    await
                    Notification1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Notification2 = await Notifications.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Notification2?.setOrganization)
                {
                    await
                    Notification2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateNotificationPreferenceWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationPreference0 = await NotificationPreferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationPreference0?.setUser)
                {
                    await
                    NotificationPreference0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationPreference1 = await NotificationPreferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationPreference1?.setUser)
                {
                    await
                    NotificationPreference1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationPreference2 = await NotificationPreferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationPreference2?.setUser)
                {
                    await
                    NotificationPreference2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateNotificationPreferenceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationPreference0 = await NotificationPreferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationPreference0?.setOrganization)
                {
                    await
                    NotificationPreference0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationPreference1 = await NotificationPreferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationPreference1?.setOrganization)
                {
                    await
                    NotificationPreference1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const NotificationPreference2 = await NotificationPreferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationPreference2?.setOrganization)
                {
                    await
                    NotificationPreference2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateShareWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Share0 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Share0?.setAlbum)
                {
                    await
                    Share0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Share1 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Share1?.setAlbum)
                {
                    await
                    Share1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Share2 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Share2?.setAlbum)
                {
                    await
                    Share2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
            
            async function associateShareWithCreated_by() {
            
                const relatedCreated_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Share0 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Share0?.setCreated_by)
                {
                    await
                    Share0.
                    setCreated_by(relatedCreated_by0);
                }
            
                const relatedCreated_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Share1 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Share1?.setCreated_by)
                {
                    await
                    Share1.
                    setCreated_by(relatedCreated_by1);
                }
            
                const relatedCreated_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Share2 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Share2?.setCreated_by)
                {
                    await
                    Share2.
                    setCreated_by(relatedCreated_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateShareWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Share0 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Share0?.setOrganization)
                {
                    await
                    Share0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Share1 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Share1?.setOrganization)
                {
                    await
                    Share1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Share2 = await Shares.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Share2?.setOrganization)
                {
                    await
                    Share2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateDownloadJobWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const DownloadJob0 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DownloadJob0?.setMedia_item)
                {
                    await
                    DownloadJob0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const DownloadJob1 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DownloadJob1?.setMedia_item)
                {
                    await
                    DownloadJob1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const DownloadJob2 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DownloadJob2?.setMedia_item)
                {
                    await
                    DownloadJob2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateDownloadJobWithRequested_by() {
            
                const relatedRequested_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const DownloadJob0 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DownloadJob0?.setRequested_by)
                {
                    await
                    DownloadJob0.
                    setRequested_by(relatedRequested_by0);
                }
            
                const relatedRequested_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const DownloadJob1 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DownloadJob1?.setRequested_by)
                {
                    await
                    DownloadJob1.
                    setRequested_by(relatedRequested_by1);
                }
            
                const relatedRequested_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const DownloadJob2 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DownloadJob2?.setRequested_by)
                {
                    await
                    DownloadJob2.
                    setRequested_by(relatedRequested_by2);
                }
            
        }
        
    
        
            
            async function associateDownloadJobWithWatermark_profile() {
            
                const relatedWatermark_profile0 = await WatermarkProfiles.findOne({
                    offset: Math.floor(Math.random() * (await WatermarkProfiles.count())),
                });
                const DownloadJob0 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DownloadJob0?.setWatermark_profile)
                {
                    await
                    DownloadJob0.
                    setWatermark_profile(relatedWatermark_profile0);
                }
            
                const relatedWatermark_profile1 = await WatermarkProfiles.findOne({
                    offset: Math.floor(Math.random() * (await WatermarkProfiles.count())),
                });
                const DownloadJob1 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DownloadJob1?.setWatermark_profile)
                {
                    await
                    DownloadJob1.
                    setWatermark_profile(relatedWatermark_profile1);
                }
            
                const relatedWatermark_profile2 = await WatermarkProfiles.findOne({
                    offset: Math.floor(Math.random() * (await WatermarkProfiles.count())),
                });
                const DownloadJob2 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DownloadJob2?.setWatermark_profile)
                {
                    await
                    DownloadJob2.
                    setWatermark_profile(relatedWatermark_profile2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateDownloadJobWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DownloadJob0 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (DownloadJob0?.setOrganization)
                {
                    await
                    DownloadJob0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DownloadJob1 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (DownloadJob1?.setOrganization)
                {
                    await
                    DownloadJob1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const DownloadJob2 = await DownloadJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (DownloadJob2?.setOrganization)
                {
                    await
                    DownloadJob2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateWatermarkProfileWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WatermarkProfile0 = await WatermarkProfiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WatermarkProfile0?.setOrganization)
                {
                    await
                    WatermarkProfile0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WatermarkProfile1 = await WatermarkProfiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WatermarkProfile1?.setOrganization)
                {
                    await
                    WatermarkProfile1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WatermarkProfile2 = await WatermarkProfiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WatermarkProfile2?.setOrganization)
                {
                    await
                    WatermarkProfile2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAiModelWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiModel0 = await AiModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiModel0?.setOrganization)
                {
                    await
                    AiModel0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiModel1 = await AiModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiModel1?.setOrganization)
                {
                    await
                    AiModel1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiModel2 = await AiModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiModel2?.setOrganization)
                {
                    await
                    AiModel2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateAiEmbeddingWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AiEmbedding0 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiEmbedding0?.setMedia_item)
                {
                    await
                    AiEmbedding0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AiEmbedding1 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiEmbedding1?.setMedia_item)
                {
                    await
                    AiEmbedding1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AiEmbedding2 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiEmbedding2?.setMedia_item)
                {
                    await
                    AiEmbedding2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateAiEmbeddingWithAi_model() {
            
                const relatedAi_model0 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const AiEmbedding0 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiEmbedding0?.setAi_model)
                {
                    await
                    AiEmbedding0.
                    setAi_model(relatedAi_model0);
                }
            
                const relatedAi_model1 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const AiEmbedding1 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiEmbedding1?.setAi_model)
                {
                    await
                    AiEmbedding1.
                    setAi_model(relatedAi_model1);
                }
            
                const relatedAi_model2 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const AiEmbedding2 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiEmbedding2?.setAi_model)
                {
                    await
                    AiEmbedding2.
                    setAi_model(relatedAi_model2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAiEmbeddingWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiEmbedding0 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiEmbedding0?.setOrganization)
                {
                    await
                    AiEmbedding0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiEmbedding1 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiEmbedding1?.setOrganization)
                {
                    await
                    AiEmbedding1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiEmbedding2 = await AiEmbeddings.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiEmbedding2?.setOrganization)
                {
                    await
                    AiEmbedding2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateFaceDetectionWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const FaceDetection0 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FaceDetection0?.setMedia_item)
                {
                    await
                    FaceDetection0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const FaceDetection1 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FaceDetection1?.setMedia_item)
                {
                    await
                    FaceDetection1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const FaceDetection2 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FaceDetection2?.setMedia_item)
                {
                    await
                    FaceDetection2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateFaceDetectionWithAi_model() {
            
                const relatedAi_model0 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const FaceDetection0 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FaceDetection0?.setAi_model)
                {
                    await
                    FaceDetection0.
                    setAi_model(relatedAi_model0);
                }
            
                const relatedAi_model1 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const FaceDetection1 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FaceDetection1?.setAi_model)
                {
                    await
                    FaceDetection1.
                    setAi_model(relatedAi_model1);
                }
            
                const relatedAi_model2 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const FaceDetection2 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FaceDetection2?.setAi_model)
                {
                    await
                    FaceDetection2.
                    setAi_model(relatedAi_model2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateFaceDetectionWithFace_embedding() {
            
                const relatedFace_embedding0 = await AiEmbeddings.findOne({
                    offset: Math.floor(Math.random() * (await AiEmbeddings.count())),
                });
                const FaceDetection0 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FaceDetection0?.setFace_embedding)
                {
                    await
                    FaceDetection0.
                    setFace_embedding(relatedFace_embedding0);
                }
            
                const relatedFace_embedding1 = await AiEmbeddings.findOne({
                    offset: Math.floor(Math.random() * (await AiEmbeddings.count())),
                });
                const FaceDetection1 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FaceDetection1?.setFace_embedding)
                {
                    await
                    FaceDetection1.
                    setFace_embedding(relatedFace_embedding1);
                }
            
                const relatedFace_embedding2 = await AiEmbeddings.findOne({
                    offset: Math.floor(Math.random() * (await AiEmbeddings.count())),
                });
                const FaceDetection2 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FaceDetection2?.setFace_embedding)
                {
                    await
                    FaceDetection2.
                    setFace_embedding(relatedFace_embedding2);
                }
            
        }
        
    
        
            
            async function associateFaceDetectionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FaceDetection0 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FaceDetection0?.setOrganization)
                {
                    await
                    FaceDetection0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FaceDetection1 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FaceDetection1?.setOrganization)
                {
                    await
                    FaceDetection1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FaceDetection2 = await FaceDetections.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FaceDetection2?.setOrganization)
                {
                    await
                    FaceDetection2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSelfieReferenceWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SelfieReference0 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SelfieReference0?.setUser)
                {
                    await
                    SelfieReference0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SelfieReference1 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SelfieReference1?.setUser)
                {
                    await
                    SelfieReference1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const SelfieReference2 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SelfieReference2?.setUser)
                {
                    await
                    SelfieReference2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
            
            async function associateSelfieReferenceWithAi_model() {
            
                const relatedAi_model0 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const SelfieReference0 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SelfieReference0?.setAi_model)
                {
                    await
                    SelfieReference0.
                    setAi_model(relatedAi_model0);
                }
            
                const relatedAi_model1 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const SelfieReference1 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SelfieReference1?.setAi_model)
                {
                    await
                    SelfieReference1.
                    setAi_model(relatedAi_model1);
                }
            
                const relatedAi_model2 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const SelfieReference2 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SelfieReference2?.setAi_model)
                {
                    await
                    SelfieReference2.
                    setAi_model(relatedAi_model2);
                }
            
        }
        
    
        
            
            async function associateSelfieReferenceWithSelfie_embedding() {
            
                const relatedSelfie_embedding0 = await AiEmbeddings.findOne({
                    offset: Math.floor(Math.random() * (await AiEmbeddings.count())),
                });
                const SelfieReference0 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SelfieReference0?.setSelfie_embedding)
                {
                    await
                    SelfieReference0.
                    setSelfie_embedding(relatedSelfie_embedding0);
                }
            
                const relatedSelfie_embedding1 = await AiEmbeddings.findOne({
                    offset: Math.floor(Math.random() * (await AiEmbeddings.count())),
                });
                const SelfieReference1 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SelfieReference1?.setSelfie_embedding)
                {
                    await
                    SelfieReference1.
                    setSelfie_embedding(relatedSelfie_embedding1);
                }
            
                const relatedSelfie_embedding2 = await AiEmbeddings.findOne({
                    offset: Math.floor(Math.random() * (await AiEmbeddings.count())),
                });
                const SelfieReference2 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SelfieReference2?.setSelfie_embedding)
                {
                    await
                    SelfieReference2.
                    setSelfie_embedding(relatedSelfie_embedding2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateSelfieReferenceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SelfieReference0 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SelfieReference0?.setOrganization)
                {
                    await
                    SelfieReference0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SelfieReference1 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SelfieReference1?.setOrganization)
                {
                    await
                    SelfieReference1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SelfieReference2 = await SelfieReferences.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SelfieReference2?.setOrganization)
                {
                    await
                    SelfieReference2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateFaceMatcheWithSelfie_reference() {
            
                const relatedSelfie_reference0 = await SelfieReferences.findOne({
                    offset: Math.floor(Math.random() * (await SelfieReferences.count())),
                });
                const FaceMatche0 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FaceMatche0?.setSelfie_reference)
                {
                    await
                    FaceMatche0.
                    setSelfie_reference(relatedSelfie_reference0);
                }
            
                const relatedSelfie_reference1 = await SelfieReferences.findOne({
                    offset: Math.floor(Math.random() * (await SelfieReferences.count())),
                });
                const FaceMatche1 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FaceMatche1?.setSelfie_reference)
                {
                    await
                    FaceMatche1.
                    setSelfie_reference(relatedSelfie_reference1);
                }
            
                const relatedSelfie_reference2 = await SelfieReferences.findOne({
                    offset: Math.floor(Math.random() * (await SelfieReferences.count())),
                });
                const FaceMatche2 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FaceMatche2?.setSelfie_reference)
                {
                    await
                    FaceMatche2.
                    setSelfie_reference(relatedSelfie_reference2);
                }
            
        }
        
    
        
            
            async function associateFaceMatcheWithFace_detection() {
            
                const relatedFace_detection0 = await FaceDetections.findOne({
                    offset: Math.floor(Math.random() * (await FaceDetections.count())),
                });
                const FaceMatche0 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FaceMatche0?.setFace_detection)
                {
                    await
                    FaceMatche0.
                    setFace_detection(relatedFace_detection0);
                }
            
                const relatedFace_detection1 = await FaceDetections.findOne({
                    offset: Math.floor(Math.random() * (await FaceDetections.count())),
                });
                const FaceMatche1 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FaceMatche1?.setFace_detection)
                {
                    await
                    FaceMatche1.
                    setFace_detection(relatedFace_detection1);
                }
            
                const relatedFace_detection2 = await FaceDetections.findOne({
                    offset: Math.floor(Math.random() * (await FaceDetections.count())),
                });
                const FaceMatche2 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FaceMatche2?.setFace_detection)
                {
                    await
                    FaceMatche2.
                    setFace_detection(relatedFace_detection2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateFaceMatcheWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FaceMatche0 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FaceMatche0?.setOrganization)
                {
                    await
                    FaceMatche0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FaceMatche1 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FaceMatche1?.setOrganization)
                {
                    await
                    FaceMatche1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const FaceMatche2 = await FaceMatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FaceMatche2?.setOrganization)
                {
                    await
                    FaceMatche2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAiCaptionWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AiCaption0 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiCaption0?.setMedia_item)
                {
                    await
                    AiCaption0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AiCaption1 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiCaption1?.setMedia_item)
                {
                    await
                    AiCaption1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AiCaption2 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiCaption2?.setMedia_item)
                {
                    await
                    AiCaption2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateAiCaptionWithAi_model() {
            
                const relatedAi_model0 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const AiCaption0 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiCaption0?.setAi_model)
                {
                    await
                    AiCaption0.
                    setAi_model(relatedAi_model0);
                }
            
                const relatedAi_model1 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const AiCaption1 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiCaption1?.setAi_model)
                {
                    await
                    AiCaption1.
                    setAi_model(relatedAi_model1);
                }
            
                const relatedAi_model2 = await AiModels.findOne({
                    offset: Math.floor(Math.random() * (await AiModels.count())),
                });
                const AiCaption2 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiCaption2?.setAi_model)
                {
                    await
                    AiCaption2.
                    setAi_model(relatedAi_model2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateAiCaptionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiCaption0 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AiCaption0?.setOrganization)
                {
                    await
                    AiCaption0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiCaption1 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AiCaption1?.setOrganization)
                {
                    await
                    AiCaption1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AiCaption2 = await AiCaptions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AiCaption2?.setOrganization)
                {
                    await
                    AiCaption2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateModerationFlagWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const ModerationFlag0 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ModerationFlag0?.setMedia_item)
                {
                    await
                    ModerationFlag0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const ModerationFlag1 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ModerationFlag1?.setMedia_item)
                {
                    await
                    ModerationFlag1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const ModerationFlag2 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ModerationFlag2?.setMedia_item)
                {
                    await
                    ModerationFlag2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
            
            async function associateModerationFlagWithReported_by() {
            
                const relatedReported_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ModerationFlag0 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ModerationFlag0?.setReported_by)
                {
                    await
                    ModerationFlag0.
                    setReported_by(relatedReported_by0);
                }
            
                const relatedReported_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ModerationFlag1 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ModerationFlag1?.setReported_by)
                {
                    await
                    ModerationFlag1.
                    setReported_by(relatedReported_by1);
                }
            
                const relatedReported_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ModerationFlag2 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ModerationFlag2?.setReported_by)
                {
                    await
                    ModerationFlag2.
                    setReported_by(relatedReported_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateModerationFlagWithReviewed_by() {
            
                const relatedReviewed_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ModerationFlag0 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ModerationFlag0?.setReviewed_by)
                {
                    await
                    ModerationFlag0.
                    setReviewed_by(relatedReviewed_by0);
                }
            
                const relatedReviewed_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ModerationFlag1 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ModerationFlag1?.setReviewed_by)
                {
                    await
                    ModerationFlag1.
                    setReviewed_by(relatedReviewed_by1);
                }
            
                const relatedReviewed_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ModerationFlag2 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ModerationFlag2?.setReviewed_by)
                {
                    await
                    ModerationFlag2.
                    setReviewed_by(relatedReviewed_by2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateModerationFlagWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ModerationFlag0 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ModerationFlag0?.setOrganization)
                {
                    await
                    ModerationFlag0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ModerationFlag1 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ModerationFlag1?.setOrganization)
                {
                    await
                    ModerationFlag1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ModerationFlag2 = await ModerationFlags.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ModerationFlag2?.setOrganization)
                {
                    await
                    ModerationFlag2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStoryWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Story0 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Story0?.setAlbum)
                {
                    await
                    Story0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Story1 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Story1?.setAlbum)
                {
                    await
                    Story1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const Story2 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Story2?.setAlbum)
                {
                    await
                    Story2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
            
            async function associateStoryWithCreated_by() {
            
                const relatedCreated_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Story0 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Story0?.setCreated_by)
                {
                    await
                    Story0.
                    setCreated_by(relatedCreated_by0);
                }
            
                const relatedCreated_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Story1 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Story1?.setCreated_by)
                {
                    await
                    Story1.
                    setCreated_by(relatedCreated_by1);
                }
            
                const relatedCreated_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Story2 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Story2?.setCreated_by)
                {
                    await
                    Story2.
                    setCreated_by(relatedCreated_by2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateStoryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Story0 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Story0?.setOrganization)
                {
                    await
                    Story0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Story1 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Story1?.setOrganization)
                {
                    await
                    Story1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Story2 = await Stories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Story2?.setOrganization)
                {
                    await
                    Story2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateStoryItemWithStory() {
            
                const relatedStory0 = await Stories.findOne({
                    offset: Math.floor(Math.random() * (await Stories.count())),
                });
                const StoryItem0 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StoryItem0?.setStory)
                {
                    await
                    StoryItem0.
                    setStory(relatedStory0);
                }
            
                const relatedStory1 = await Stories.findOne({
                    offset: Math.floor(Math.random() * (await Stories.count())),
                });
                const StoryItem1 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StoryItem1?.setStory)
                {
                    await
                    StoryItem1.
                    setStory(relatedStory1);
                }
            
                const relatedStory2 = await Stories.findOne({
                    offset: Math.floor(Math.random() * (await Stories.count())),
                });
                const StoryItem2 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StoryItem2?.setStory)
                {
                    await
                    StoryItem2.
                    setStory(relatedStory2);
                }
            
        }
        
    
        
            
            async function associateStoryItemWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const StoryItem0 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StoryItem0?.setMedia_item)
                {
                    await
                    StoryItem0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const StoryItem1 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StoryItem1?.setMedia_item)
                {
                    await
                    StoryItem1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const StoryItem2 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StoryItem2?.setMedia_item)
                {
                    await
                    StoryItem2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateStoryItemWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StoryItem0 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (StoryItem0?.setOrganization)
                {
                    await
                    StoryItem0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StoryItem1 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (StoryItem1?.setOrganization)
                {
                    await
                    StoryItem1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const StoryItem2 = await StoryItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (StoryItem2?.setOrganization)
                {
                    await
                    StoryItem2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAnalyticsEventWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AnalyticsEvent0 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AnalyticsEvent0?.setOrganization)
                {
                    await
                    AnalyticsEvent0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AnalyticsEvent1 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AnalyticsEvent1?.setOrganization)
                {
                    await
                    AnalyticsEvent1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AnalyticsEvent2 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AnalyticsEvent2?.setOrganization)
                {
                    await
                    AnalyticsEvent2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    
        
            
            async function associateAnalyticsEventWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AnalyticsEvent0 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AnalyticsEvent0?.setUser)
                {
                    await
                    AnalyticsEvent0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AnalyticsEvent1 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AnalyticsEvent1?.setUser)
                {
                    await
                    AnalyticsEvent1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AnalyticsEvent2 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AnalyticsEvent2?.setUser)
                {
                    await
                    AnalyticsEvent2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
            
            async function associateAnalyticsEventWithEvent() {
            
                const relatedEvent0 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const AnalyticsEvent0 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AnalyticsEvent0?.setEvent)
                {
                    await
                    AnalyticsEvent0.
                    setEvent(relatedEvent0);
                }
            
                const relatedEvent1 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const AnalyticsEvent1 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AnalyticsEvent1?.setEvent)
                {
                    await
                    AnalyticsEvent1.
                    setEvent(relatedEvent1);
                }
            
                const relatedEvent2 = await Events.findOne({
                    offset: Math.floor(Math.random() * (await Events.count())),
                });
                const AnalyticsEvent2 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AnalyticsEvent2?.setEvent)
                {
                    await
                    AnalyticsEvent2.
                    setEvent(relatedEvent2);
                }
            
        }
        
    
        
            
            async function associateAnalyticsEventWithAlbum() {
            
                const relatedAlbum0 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AnalyticsEvent0 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AnalyticsEvent0?.setAlbum)
                {
                    await
                    AnalyticsEvent0.
                    setAlbum(relatedAlbum0);
                }
            
                const relatedAlbum1 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AnalyticsEvent1 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AnalyticsEvent1?.setAlbum)
                {
                    await
                    AnalyticsEvent1.
                    setAlbum(relatedAlbum1);
                }
            
                const relatedAlbum2 = await Albums.findOne({
                    offset: Math.floor(Math.random() * (await Albums.count())),
                });
                const AnalyticsEvent2 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AnalyticsEvent2?.setAlbum)
                {
                    await
                    AnalyticsEvent2.
                    setAlbum(relatedAlbum2);
                }
            
        }
        
    
        
            
            async function associateAnalyticsEventWithMedia_item() {
            
                const relatedMedia_item0 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AnalyticsEvent0 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AnalyticsEvent0?.setMedia_item)
                {
                    await
                    AnalyticsEvent0.
                    setMedia_item(relatedMedia_item0);
                }
            
                const relatedMedia_item1 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AnalyticsEvent1 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AnalyticsEvent1?.setMedia_item)
                {
                    await
                    AnalyticsEvent1.
                    setMedia_item(relatedMedia_item1);
                }
            
                const relatedMedia_item2 = await MediaItems.findOne({
                    offset: Math.floor(Math.random() * (await MediaItems.count())),
                });
                const AnalyticsEvent2 = await AnalyticsEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AnalyticsEvent2?.setMedia_item)
                {
                    await
                    AnalyticsEvent2.
                    setMedia_item(relatedMedia_item2);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateOauthAccountWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OauthAccount0 = await OauthAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OauthAccount0?.setUser)
                {
                    await
                    OauthAccount0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OauthAccount1 = await OauthAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OauthAccount1?.setUser)
                {
                    await
                    OauthAccount1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OauthAccount2 = await OauthAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OauthAccount2?.setUser)
                {
                    await
                    OauthAccount2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateOauthAccountWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OauthAccount0 = await OauthAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OauthAccount0?.setOrganization)
                {
                    await
                    OauthAccount0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OauthAccount1 = await OauthAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OauthAccount1?.setOrganization)
                {
                    await
                    OauthAccount1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OauthAccount2 = await OauthAccounts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OauthAccount2?.setOrganization)
                {
                    await
                    OauthAccount2.
                    setOrganization(relatedOrganization2);
                }
            
        }
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await RolePermissions.bulkCreate(RolePermissionsData);
                
            
            
                
                await Memberships.bulkCreate(MembershipsData);
                
            
            
                
                await Events.bulkCreate(EventsData);
                
            
            
                
                await Albums.bulkCreate(AlbumsData);
                
            
            
                
                await AlbumCollaborators.bulkCreate(AlbumCollaboratorsData);
                
            
            
                
                await AccessRules.bulkCreate(AccessRulesData);
                
            
            
                
                await MediaItems.bulkCreate(MediaItemsData);
                
            
            
                
                await StorageBuckets.bulkCreate(StorageBucketsData);
                
            
            
                
                await StorageObjects.bulkCreate(StorageObjectsData);
                
            
            
                
                await UploadSessions.bulkCreate(UploadSessionsData);
                
            
            
                
                await UploadFiles.bulkCreate(UploadFilesData);
                
            
            
                
                await Tags.bulkCreate(TagsData);
                
            
            
                
                await MediaAiTags.bulkCreate(MediaAiTagsData);
                
            
            
                
                await MediaUserTags.bulkCreate(MediaUserTagsData);
                
            
            
                
                await Likes.bulkCreate(LikesData);
                
            
            
                
                await Favourites.bulkCreate(FavouritesData);
                
            
            
                
                await Comments.bulkCreate(CommentsData);
                
            
            
                
                await Mentions.bulkCreate(MentionsData);
                
            
            
                
                await Notifications.bulkCreate(NotificationsData);
                
            
            
                
                await NotificationPreferences.bulkCreate(NotificationPreferencesData);
                
            
            
                
                await Shares.bulkCreate(SharesData);
                
            
            
                
                await DownloadJobs.bulkCreate(DownloadJobsData);
                
            
            
                
                await WatermarkProfiles.bulkCreate(WatermarkProfilesData);
                
            
            
                
                await AiModels.bulkCreate(AiModelsData);
                
            
            
                
                await AiEmbeddings.bulkCreate(AiEmbeddingsData);
                
            
            
                
                await FaceDetections.bulkCreate(FaceDetectionsData);
                
            
            
                
                await SelfieReferences.bulkCreate(SelfieReferencesData);
                
            
            
                
                await FaceMatches.bulkCreate(FaceMatchesData);
                
            
            
                
                await AiCaptions.bulkCreate(AiCaptionsData);
                
            
            
                
                await ModerationFlags.bulkCreate(ModerationFlagsData);
                
            
            
                
                await Stories.bulkCreate(StoriesData);
                
            
            
                
                await StoryItems.bulkCreate(StoryItemsData);
                
            
            
                
                await AnalyticsEvents.bulkCreate(AnalyticsEventsData);
                
            
            
                
                await OauthAccounts.bulkCreate(OauthAccountsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                        
                        await associateRolePermissionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMembershipWithOrganization(),
                    
                
                    
                        
                        await associateMembershipWithUser(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateEventWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEventWithDefault_album(),
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                        
                        await associateAlbumWithEvent(),
                    
                
                    
                        
                        await associateAlbumWithOwner(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateAlbumWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAlbumCollaboratorWithAlbum(),
                    
                
                    
                        
                        await associateAlbumCollaboratorWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAlbumCollaboratorWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAccessRuleWithAlbum(),
                    
                
                    
                
                    
                
                    
                        
                        await associateAccessRuleWithUser(),
                    
                
                    
                        
                        await associateAccessRuleWithMembership(),
                    
                
                    
                
                    
                
                    
                        
                        await associateAccessRuleWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMediaItemWithAlbum(),
                    
                
                    
                        
                        await associateMediaItemWithUploader(),
                    
                
                    
                        
                        await associateMediaItemWithStorage_object(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateMediaItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateStorageBucketWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                        
                        await associateStorageObjectWithBucket(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateStorageObjectWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateUploadSessionWithAlbum(),
                    
                
                    
                        
                        await associateUploadSessionWithInitiator(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUploadSessionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateUploadFileWithUpload_session(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateUploadFileWithMedia_item(),
                    
                
                    
                        
                        await associateUploadFileWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateTagWithOrganization(),
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateMediaAiTagWithMedia_item(),
                    
                
                    
                        
                        await associateMediaAiTagWithTag(),
                    
                
                    
                
                    
                
                    
                        
                        await associateMediaAiTagWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMediaUserTagWithMedia_item(),
                    
                
                    
                        
                        await associateMediaUserTagWithTag(),
                    
                
                    
                        
                        await associateMediaUserTagWithTagged_by(),
                    
                
                    
                        
                        await associateMediaUserTagWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateLikeWithMedia_item(),
                    
                
                    
                        
                        await associateLikeWithUser(),
                    
                
                    
                
                    
                        
                        await associateLikeWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateFavouriteWithMedia_item(),
                    
                
                    
                        
                        await associateFavouriteWithUser(),
                    
                
                    
                
                    
                        
                        await associateFavouriteWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCommentWithMedia_item(),
                    
                
                    
                        
                        await associateCommentWithAuthor(),
                    
                
                    
                        
                        await associateCommentWithParent_comment(),
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateCommentWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateMentionWithComment(),
                    
                
                    
                        
                        await associateMentionWithMedia_item(),
                    
                
                    
                        
                        await associateMentionWithMentioned_user(),
                    
                
                    
                        
                        await associateMentionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateNotificationWithRecipient(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNotificationWithMedia_item(),
                    
                
                    
                        
                        await associateNotificationWithEvent(),
                    
                
                    
                        
                        await associateNotificationWithAlbum(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNotificationWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateNotificationPreferenceWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateNotificationPreferenceWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateShareWithAlbum(),
                    
                
                    
                        
                        await associateShareWithCreated_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateShareWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateDownloadJobWithMedia_item(),
                    
                
                    
                        
                        await associateDownloadJobWithRequested_by(),
                    
                
                    
                        
                        await associateDownloadJobWithWatermark_profile(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateDownloadJobWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWatermarkProfileWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAiModelWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateAiEmbeddingWithMedia_item(),
                    
                
                    
                        
                        await associateAiEmbeddingWithAi_model(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAiEmbeddingWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateFaceDetectionWithMedia_item(),
                    
                
                    
                        
                        await associateFaceDetectionWithAi_model(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateFaceDetectionWithFace_embedding(),
                    
                
                    
                        
                        await associateFaceDetectionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateSelfieReferenceWithUser(),
                    
                
                    
                
                    
                        
                        await associateSelfieReferenceWithAi_model(),
                    
                
                    
                        
                        await associateSelfieReferenceWithSelfie_embedding(),
                    
                
                    
                
                    
                
                    
                        
                        await associateSelfieReferenceWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateFaceMatcheWithSelfie_reference(),
                    
                
                    
                        
                        await associateFaceMatcheWithFace_detection(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateFaceMatcheWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAiCaptionWithMedia_item(),
                    
                
                    
                        
                        await associateAiCaptionWithAi_model(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAiCaptionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateModerationFlagWithMedia_item(),
                    
                
                    
                        
                        await associateModerationFlagWithReported_by(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateModerationFlagWithReviewed_by(),
                    
                
                    
                
                    
                
                    
                        
                        await associateModerationFlagWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateStoryWithAlbum(),
                    
                
                    
                        
                        await associateStoryWithCreated_by(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateStoryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateStoryItemWithStory(),
                    
                
                    
                        
                        await associateStoryItemWithMedia_item(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateStoryItemWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAnalyticsEventWithOrganization(),
                    
                
                    
                        
                        await associateAnalyticsEventWithUser(),
                    
                
                    
                        
                        await associateAnalyticsEventWithEvent(),
                    
                
                    
                        
                        await associateAnalyticsEventWithAlbum(),
                    
                
                    
                        
                        await associateAnalyticsEventWithMedia_item(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateOauthAccountWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateOauthAccountWithOrganization(),
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('role_permissions', null, {});
            
            
            await queryInterface.bulkDelete('memberships', null, {});
            
            
            await queryInterface.bulkDelete('events', null, {});
            
            
            await queryInterface.bulkDelete('albums', null, {});
            
            
            await queryInterface.bulkDelete('album_collaborators', null, {});
            
            
            await queryInterface.bulkDelete('access_rules', null, {});
            
            
            await queryInterface.bulkDelete('media_items', null, {});
            
            
            await queryInterface.bulkDelete('storage_buckets', null, {});
            
            
            await queryInterface.bulkDelete('storage_objects', null, {});
            
            
            await queryInterface.bulkDelete('upload_sessions', null, {});
            
            
            await queryInterface.bulkDelete('upload_files', null, {});
            
            
            await queryInterface.bulkDelete('tags', null, {});
            
            
            await queryInterface.bulkDelete('media_ai_tags', null, {});
            
            
            await queryInterface.bulkDelete('media_user_tags', null, {});
            
            
            await queryInterface.bulkDelete('likes', null, {});
            
            
            await queryInterface.bulkDelete('favourites', null, {});
            
            
            await queryInterface.bulkDelete('comments', null, {});
            
            
            await queryInterface.bulkDelete('mentions', null, {});
            
            
            await queryInterface.bulkDelete('notifications', null, {});
            
            
            await queryInterface.bulkDelete('notification_preferences', null, {});
            
            
            await queryInterface.bulkDelete('shares', null, {});
            
            
            await queryInterface.bulkDelete('download_jobs', null, {});
            
            
            await queryInterface.bulkDelete('watermark_profiles', null, {});
            
            
            await queryInterface.bulkDelete('ai_models', null, {});
            
            
            await queryInterface.bulkDelete('ai_embeddings', null, {});
            
            
            await queryInterface.bulkDelete('face_detections', null, {});
            
            
            await queryInterface.bulkDelete('selfie_references', null, {});
            
            
            await queryInterface.bulkDelete('face_matches', null, {});
            
            
            await queryInterface.bulkDelete('ai_captions', null, {});
            
            
            await queryInterface.bulkDelete('moderation_flags', null, {});
            
            
            await queryInterface.bulkDelete('stories', null, {});
            
            
            await queryInterface.bulkDelete('story_items', null, {});
            
            
            await queryInterface.bulkDelete('analytics_events', null, {});
            
            
            await queryInterface.bulkDelete('oauth_accounts', null, {});
            
        
    },
};