





















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






const Organizations = db.organizations;

const OrganizationMemberships = db.organization_memberships;

const Projects = db.projects;

const Workspaces = db.workspaces;

const LlmProviders = db.llm_providers;

const LlmModels = db.llm_models;

const LlmApiKeys = db.llm_api_keys;

const KeyRotationPolicies = db.key_rotation_policies;

const PromptTemplates = db.prompt_templates;

const Chats = db.chats;

const ChatMessages = db.chat_messages;

const EncryptionSessions = db.encryption_sessions;

const CodeRepositories = db.code_repositories;

const CodeFiles = db.code_files;

const CodeChangeSets = db.code_change_sets;

const CodePatches = db.code_patches;

const BuildJobs = db.build_jobs;

const BuildPipelines = db.build_pipelines;

const BuildArtifacts = db.build_artifacts;

const WebSearchQueries = db.web_search_queries;

const WebSearchResults = db.web_search_results;

const SystemHealthChecks = db.system_health_checks;

const AuditEvents = db.audit_events;







const OrganizationsData = [
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
    },
    
];



const OrganizationMembershipsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "admin",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "owner",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "owner",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "member",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "member_role": "billing",
            
        
    
        
        
            
                "joined_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_active": false,
            
        
    
    },
    
];



const ProjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "visibility": "internal",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "last_activity_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "visibility": "public",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "last_activity_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "visibility": "private",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "last_activity_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "visibility": "public",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "last_activity_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "visibility": "public",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "last_activity_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const WorkspacesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "status": "paused",
            
        
    
        
        
            
                "last_opened_at": new Date(Date.now()),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "last_opened_at": new Date(Date.now()),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "last_opened_at": new Date(Date.now()),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "status": "active",
            
        
    
        
        
            
                "last_opened_at": new Date(Date.now()),
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "status": "archived",
            
        
    
        
        
            
                "last_opened_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LlmProvidersData = [
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "base_url": "Alan Turing",
            
        
    
        
        
            
                "provider_type": "openai_compatible",
            
        
    
        
        
            
                "region_policy": "unknown",
            
        
    
        
        
            
                "supports_streaming": true,
            
        
    
        
        
            
                "supports_tools": true,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "base_url": "Alan Turing",
            
        
    
        
        
            
                "provider_type": "deepseek",
            
        
    
        
        
            
                "region_policy": "blocked",
            
        
    
        
        
            
                "supports_streaming": true,
            
        
    
        
        
            
                "supports_tools": true,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "base_url": "Marie Curie",
            
        
    
        
        
            
                "provider_type": "custom",
            
        
    
        
        
            
                "region_policy": "blocked",
            
        
    
        
        
            
                "supports_streaming": true,
            
        
    
        
        
            
                "supports_tools": true,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "base_url": "Marie Curie",
            
        
    
        
        
            
                "provider_type": "queen",
            
        
    
        
        
            
                "region_policy": "blocked",
            
        
    
        
        
            
                "supports_streaming": true,
            
        
    
        
        
            
                "supports_tools": false,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "base_url": "Marie Curie",
            
        
    
        
        
            
                "provider_type": "queen",
            
        
    
        
        
            
                "region_policy": "allowed",
            
        
    
        
        
            
                "supports_streaming": false,
            
        
    
        
        
            
                "supports_tools": true,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LlmModelsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "model_code": "Alan Turing",
            
        
    
        
        
            
                "max_input_tokens": 1,
            
        
    
        
        
            
                "max_output_tokens": 2,
            
        
    
        
        
            
                "supports_vision": true,
            
        
    
        
        
            
                "supports_function_calling": true,
            
        
    
        
        
            
                "price_per_million_input_tokens": 8.03,
            
        
    
        
        
            
                "price_per_million_output_tokens": 5.62,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "model_code": "Marie Curie",
            
        
    
        
        
            
                "max_input_tokens": 7,
            
        
    
        
        
            
                "max_output_tokens": 7,
            
        
    
        
        
            
                "supports_vision": true,
            
        
    
        
        
            
                "supports_function_calling": true,
            
        
    
        
        
            
                "price_per_million_input_tokens": 5.43,
            
        
    
        
        
            
                "price_per_million_output_tokens": 9.34,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "model_code": "Ada Lovelace",
            
        
    
        
        
            
                "max_input_tokens": 7,
            
        
    
        
        
            
                "max_output_tokens": 8,
            
        
    
        
        
            
                "supports_vision": false,
            
        
    
        
        
            
                "supports_function_calling": true,
            
        
    
        
        
            
                "price_per_million_input_tokens": 7.55,
            
        
    
        
        
            
                "price_per_million_output_tokens": 1.55,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "model_code": "Grace Hopper",
            
        
    
        
        
            
                "max_input_tokens": 4,
            
        
    
        
        
            
                "max_output_tokens": 8,
            
        
    
        
        
            
                "supports_vision": false,
            
        
    
        
        
            
                "supports_function_calling": false,
            
        
    
        
        
            
                "price_per_million_input_tokens": 0.25,
            
        
    
        
        
            
                "price_per_million_output_tokens": 8.0,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "model_code": "Ada Lovelace",
            
        
    
        
        
            
                "max_input_tokens": 5,
            
        
    
        
        
            
                "max_output_tokens": 3,
            
        
    
        
        
            
                "supports_vision": true,
            
        
    
        
        
            
                "supports_function_calling": true,
            
        
    
        
        
            
                "price_per_million_input_tokens": 2.63,
            
        
    
        
        
            
                "price_per_million_output_tokens": 5.7,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const LlmApiKeysData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "label": "Marie Curie",
            
        
    
        
        
            
                "key_fingerprint": "Ada Lovelace",
            
        
    
        
        
            
                "key_status": "rate_limited",
            
        
    
        
        
            
                "last_rotated_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_primary": true,
            
        
    
        
        
            
                "requests_per_minute_limit": 1,
            
        
    
        
        
            
                "daily_request_limit": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "label": "Alan Turing",
            
        
    
        
        
            
                "key_fingerprint": "Marie Curie",
            
        
    
        
        
            
                "key_status": "disabled",
            
        
    
        
        
            
                "last_rotated_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_primary": true,
            
        
    
        
        
            
                "requests_per_minute_limit": 7,
            
        
    
        
        
            
                "daily_request_limit": 6,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "label": "Alan Turing",
            
        
    
        
        
            
                "key_fingerprint": "Marie Curie",
            
        
    
        
        
            
                "key_status": "disabled",
            
        
    
        
        
            
                "last_rotated_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_primary": true,
            
        
    
        
        
            
                "requests_per_minute_limit": 8,
            
        
    
        
        
            
                "daily_request_limit": 6,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "label": "Marie Curie",
            
        
    
        
        
            
                "key_fingerprint": "Grace Hopper",
            
        
    
        
        
            
                "key_status": "compromised",
            
        
    
        
        
            
                "last_rotated_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_primary": true,
            
        
    
        
        
            
                "requests_per_minute_limit": 4,
            
        
    
        
        
            
                "daily_request_limit": 9,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "label": "Marie Curie",
            
        
    
        
        
            
                "key_fingerprint": "Alan Turing",
            
        
    
        
        
            
                "key_status": "disabled",
            
        
    
        
        
            
                "last_rotated_at": new Date(Date.now()),
            
        
    
        
        
            
                "expires_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_primary": false,
            
        
    
        
        
            
                "requests_per_minute_limit": 6,
            
        
    
        
        
            
                "daily_request_limit": 3,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const KeyRotationPoliciesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "strategy": "health_based",
            
        
    
        
        
            
                "rotate_every_seconds": 5,
            
        
    
        
        
            
                "auto_disable_on_errors": true,
            
        
    
        
        
            
                "error_threshold": 1,
            
        
    
        
        
            
                "cooldown_seconds": 6,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "strategy": "health_based",
            
        
    
        
        
            
                "rotate_every_seconds": 8,
            
        
    
        
        
            
                "auto_disable_on_errors": false,
            
        
    
        
        
            
                "error_threshold": 1,
            
        
    
        
        
            
                "cooldown_seconds": 6,
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "strategy": "health_based",
            
        
    
        
        
            
                "rotate_every_seconds": 9,
            
        
    
        
        
            
                "auto_disable_on_errors": false,
            
        
    
        
        
            
                "error_threshold": 5,
            
        
    
        
        
            
                "cooldown_seconds": 1,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "strategy": "round_robin",
            
        
    
        
        
            
                "rotate_every_seconds": 7,
            
        
    
        
        
            
                "auto_disable_on_errors": false,
            
        
    
        
        
            
                "error_threshold": 7,
            
        
    
        
        
            
                "cooldown_seconds": 9,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "strategy": "round_robin",
            
        
    
        
        
            
                "rotate_every_seconds": 9,
            
        
    
        
        
            
                "auto_disable_on_errors": true,
            
        
    
        
        
            
                "error_threshold": 7,
            
        
    
        
        
            
                "cooldown_seconds": 8,
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PromptTemplatesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "category": "safety",
            
        
    
        
        
            
                "content": "Grace Hopper",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "version": 3,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "category": "developer",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "version": 6,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "category": "debug",
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "version": 2,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "category": "debug",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "version": 6,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "category": "codegen",
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "version": 5,
            
        
    
        
        
            
                "published_at": new Date(Date.now()),
            
        
    
    },
    
];



const ChatsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "chat_status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_encrypted_e2ee": false,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_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",
            
        
    
        
        
            
                "chat_status": "closed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_encrypted_e2ee": false,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_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",
            
        
    
        
        
            
                "chat_status": "archived",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_encrypted_e2ee": false,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_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",
            
        
    
        
        
            
                "chat_status": "active",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_encrypted_e2ee": false,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_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",
            
        
    
        
        
            
                "chat_status": "closed",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "is_encrypted_e2ee": true,
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "last_message_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ChatMessagesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sender_type": "system",
            
        
    
        
        
            
                "sender_label": "Marie Curie",
            
        
    
        
        
            
                "content_ciphertext": "Ada Lovelace",
            
        
    
        
        
            
                "content_preview": "Grace Hopper",
            
        
    
        
        
            
                "encryption_key_id": "Marie Curie",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "token_count_input": 4,
            
        
    
        
        
            
                "token_count_output": 5,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sender_type": "assistant",
            
        
    
        
        
            
                "sender_label": "Alan Turing",
            
        
    
        
        
            
                "content_ciphertext": "Alan Turing",
            
        
    
        
        
            
                "content_preview": "Marie Curie",
            
        
    
        
        
            
                "encryption_key_id": "Grace Hopper",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "token_count_input": 2,
            
        
    
        
        
            
                "token_count_output": 6,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sender_type": "user",
            
        
    
        
        
            
                "sender_label": "Grace Hopper",
            
        
    
        
        
            
                "content_ciphertext": "Ada Lovelace",
            
        
    
        
        
            
                "content_preview": "Ada Lovelace",
            
        
    
        
        
            
                "encryption_key_id": "Ada Lovelace",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "token_count_input": 9,
            
        
    
        
        
            
                "token_count_output": 8,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sender_type": "assistant",
            
        
    
        
        
            
                "sender_label": "Alan Turing",
            
        
    
        
        
            
                "content_ciphertext": "Alan Turing",
            
        
    
        
        
            
                "content_preview": "Alan Turing",
            
        
    
        
        
            
                "encryption_key_id": "Grace Hopper",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "token_count_input": 7,
            
        
    
        
        
            
                "token_count_output": 8,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "sender_type": "tool",
            
        
    
        
        
            
                "sender_label": "Marie Curie",
            
        
    
        
        
            
                "content_ciphertext": "Grace Hopper",
            
        
    
        
        
            
                "content_preview": "Grace Hopper",
            
        
    
        
        
            
                "encryption_key_id": "Alan Turing",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "token_count_input": 2,
            
        
    
        
        
            
                "token_count_output": 9,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const EncryptionSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_key_id": "Marie Curie",
            
        
    
        
        
            
                "algorithm": "rsa",
            
        
    
        
        
            
                "key_length_bits": 3,
            
        
    
        
        
            
                "valid_from": new Date(Date.now()),
            
        
    
        
        
            
                "valid_until": new Date(Date.now()),
            
        
    
        
        
            
                "is_discarded": true,
            
        
    
        
        
            
                "discarded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_key_id": "Alan Turing",
            
        
    
        
        
            
                "algorithm": "aes_gcm",
            
        
    
        
        
            
                "key_length_bits": 4,
            
        
    
        
        
            
                "valid_from": new Date(Date.now()),
            
        
    
        
        
            
                "valid_until": new Date(Date.now()),
            
        
    
        
        
            
                "is_discarded": true,
            
        
    
        
        
            
                "discarded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_key_id": "Alan Turing",
            
        
    
        
        
            
                "algorithm": "aes_gcm",
            
        
    
        
        
            
                "key_length_bits": 6,
            
        
    
        
        
            
                "valid_from": new Date(Date.now()),
            
        
    
        
        
            
                "valid_until": new Date(Date.now()),
            
        
    
        
        
            
                "is_discarded": true,
            
        
    
        
        
            
                "discarded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_key_id": "Grace Hopper",
            
        
    
        
        
            
                "algorithm": "rsa",
            
        
    
        
        
            
                "key_length_bits": 1,
            
        
    
        
        
            
                "valid_from": new Date(Date.now()),
            
        
    
        
        
            
                "valid_until": new Date(Date.now()),
            
        
    
        
        
            
                "is_discarded": false,
            
        
    
        
        
            
                "discarded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "session_key_id": "Grace Hopper",
            
        
    
        
        
            
                "algorithm": "xchacha20_poly1305",
            
        
    
        
        
            
                "key_length_bits": 9,
            
        
    
        
        
            
                "valid_from": new Date(Date.now()),
            
        
    
        
        
            
                "valid_until": new Date(Date.now()),
            
        
    
        
        
            
                "is_discarded": true,
            
        
    
        
        
            
                "discarded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CodeRepositoriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "repo_type": "git",
            
        
    
        
        
            
                "remote_url": "Ada Lovelace",
            
        
    
        
        
            
                "default_branch": "Grace Hopper",
            
        
    
        
        
            
                "status": "syncing",
            
        
    
        
        
            
                "last_sync_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
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "repo_type": "generated",
            
        
    
        
        
            
                "remote_url": "Ada Lovelace",
            
        
    
        
        
            
                "default_branch": "Marie Curie",
            
        
    
        
        
            
                "status": "error",
            
        
    
        
        
            
                "last_sync_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
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "repo_type": "generated",
            
        
    
        
        
            
                "remote_url": "Grace Hopper",
            
        
    
        
        
            
                "default_branch": "Ada Lovelace",
            
        
    
        
        
            
                "status": "error",
            
        
    
        
        
            
                "last_sync_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
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "repo_type": "local",
            
        
    
        
        
            
                "remote_url": "Alan Turing",
            
        
    
        
        
            
                "default_branch": "Grace Hopper",
            
        
    
        
        
            
                "status": "ready",
            
        
    
        
        
            
                "last_sync_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
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "repo_type": "git",
            
        
    
        
        
            
                "remote_url": "Grace Hopper",
            
        
    
        
        
            
                "default_branch": "Alan Turing",
            
        
    
        
        
            
                "status": "syncing",
            
        
    
        
        
            
                "last_sync_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CodeFilesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "path": "Alan Turing",
            
        
    
        
        
            
                "language": "Grace Hopper",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "content_hash": "Marie Curie",
            
        
    
        
        
            
                "last_modified_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_binary": false,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "path": "Grace Hopper",
            
        
    
        
        
            
                "language": "Alan Turing",
            
        
    
        
        
            
                "content": "Grace Hopper",
            
        
    
        
        
            
                "content_hash": "Grace Hopper",
            
        
    
        
        
            
                "last_modified_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_binary": true,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "path": "Grace Hopper",
            
        
    
        
        
            
                "language": "Grace Hopper",
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "content_hash": "Marie Curie",
            
        
    
        
        
            
                "last_modified_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_binary": false,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "path": "Grace Hopper",
            
        
    
        
        
            
                "language": "Alan Turing",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "content_hash": "Marie Curie",
            
        
    
        
        
            
                "last_modified_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_binary": true,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "path": "Ada Lovelace",
            
        
    
        
        
            
                "language": "Marie Curie",
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "content_hash": "Alan Turing",
            
        
    
        
        
            
                "last_modified_at": new Date(Date.now()),
            
        
    
        
        
            
                "is_binary": false,
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CodeChangeSetsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "summary": "Ada Lovelace",
            
        
    
        
        
            
                "status": "rolled_back",
            
        
    
        
        
            
                "created_at_time": new Date(Date.now()),
            
        
    
        
        
            
                "applied_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",
            
        
    
        
        
            
                "summary": "Alan Turing",
            
        
    
        
        
            
                "status": "draft",
            
        
    
        
        
            
                "created_at_time": new Date(Date.now()),
            
        
    
        
        
            
                "applied_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",
            
        
    
        
        
            
                "summary": "Marie Curie",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "created_at_time": new Date(Date.now()),
            
        
    
        
        
            
                "applied_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": "Marie Curie",
            
        
    
        
        
            
                "summary": "Marie Curie",
            
        
    
        
        
            
                "status": "proposed",
            
        
    
        
        
            
                "created_at_time": new Date(Date.now()),
            
        
    
        
        
            
                "applied_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",
            
        
    
        
        
            
                "summary": "Alan Turing",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "created_at_time": new Date(Date.now()),
            
        
    
        
        
            
                "applied_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const CodePatchesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_path": "Alan Turing",
            
        
    
        
        
            
                "change_type": "rename",
            
        
    
        
        
            
                "diff_text": "Marie Curie",
            
        
    
        
        
            
                "applied_successfully": false,
            
        
    
        
        
            
                "error_message": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_path": "Ada Lovelace",
            
        
    
        
        
            
                "change_type": "update",
            
        
    
        
        
            
                "diff_text": "Alan Turing",
            
        
    
        
        
            
                "applied_successfully": false,
            
        
    
        
        
            
                "error_message": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_path": "Alan Turing",
            
        
    
        
        
            
                "change_type": "update",
            
        
    
        
        
            
                "diff_text": "Marie Curie",
            
        
    
        
        
            
                "applied_successfully": true,
            
        
    
        
        
            
                "error_message": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_path": "Ada Lovelace",
            
        
    
        
        
            
                "change_type": "rename",
            
        
    
        
        
            
                "diff_text": "Alan Turing",
            
        
    
        
        
            
                "applied_successfully": true,
            
        
    
        
        
            
                "error_message": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "file_path": "Marie Curie",
            
        
    
        
        
            
                "change_type": "rename",
            
        
    
        
        
            
                "diff_text": "Marie Curie",
            
        
    
        
        
            
                "applied_successfully": true,
            
        
    
        
        
            
                "error_message": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const BuildJobsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "target_platform": "docker_image",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "queued_at": new Date(Date.now()),
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "finished_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
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "target_platform": "web_preview",
            
        
    
        
        
            
                "status": "canceled",
            
        
    
        
        
            
                "queued_at": new Date(Date.now()),
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "finished_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
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "target_platform": "android_apk",
            
        
    
        
        
            
                "status": "succeeded",
            
        
    
        
        
            
                "queued_at": new Date(Date.now()),
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "finished_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
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "target_platform": "web_preview",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "queued_at": new Date(Date.now()),
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "finished_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
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "target_platform": "docker_image",
            
        
    
        
        
            
                "status": "canceled",
            
        
    
        
        
            
                "queued_at": new Date(Date.now()),
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "finished_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
            
        
    
    },
    
];



const BuildPipelinesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Grace Hopper",
            
        
    
        
        
            
                "pipeline_type": "deploy",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "config_yaml": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "description": "Alan Turing",
            
        
    
        
        
            
                "pipeline_type": "test",
            
        
    
        
        
            
                "is_active": false,
            
        
    
        
        
            
                "config_yaml": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "pipeline_type": "full_ci_cd",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "config_yaml": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Ada Lovelace",
            
        
    
        
        
            
                "pipeline_type": "deploy",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "config_yaml": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "pipeline_type": "full_ci_cd",
            
        
    
        
        
            
                "is_active": true,
            
        
    
        
        
            
                "config_yaml": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_many" field
            
        
    
    },
    
];



const BuildArtifactsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "artifact_type": "aab",
            
        
    
        
        
            
                "file_name": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "download_url": "Alan Turing",
            
        
    
        
        
            
                "checksum_sha256": "Grace Hopper",
            
        
    
        
        
            
                "generated_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "artifact_type": "aab",
            
        
    
        
        
            
                "file_name": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "download_url": "Alan Turing",
            
        
    
        
        
            
                "checksum_sha256": "Grace Hopper",
            
        
    
        
        
            
                "generated_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "artifact_type": "log",
            
        
    
        
        
            
                "file_name": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "download_url": "Grace Hopper",
            
        
    
        
        
            
                "checksum_sha256": "Marie Curie",
            
        
    
        
        
            
                "generated_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "artifact_type": "apk",
            
        
    
        
        
            
                "file_name": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "download_url": "Grace Hopper",
            
        
    
        
        
            
                "checksum_sha256": "Alan Turing",
            
        
    
        
        
            
                "generated_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "artifact_type": "aab",
            
        
    
        
        
            
                "file_name": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "download_url": "Ada Lovelace",
            
        
    
        
        
            
                "checksum_sha256": "Marie Curie",
            
        
    
        
        
            
                "generated_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const WebSearchQueriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "query_text": "Ada Lovelace",
            
        
    
        
        
            
                "status": "succeeded",
            
        
    
        
        
            
                "requested_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
            
        
    
        
        
            
                "query_text": "Alan Turing",
            
        
    
        
        
            
                "status": "running",
            
        
    
        
        
            
                "requested_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
            
        
    
        
        
            
                "query_text": "Grace Hopper",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "requested_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
            
        
    
        
        
            
                "query_text": "Ada Lovelace",
            
        
    
        
        
            
                "status": "queued",
            
        
    
        
        
            
                "requested_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
            
        
    
        
        
            
                "query_text": "Alan Turing",
            
        
    
        
        
            
                "status": "failed",
            
        
    
        
        
            
                "requested_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 WebSearchResultsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "url": "Grace Hopper",
            
        
    
        
        
            
                "snippet": "Grace Hopper",
            
        
    
        
        
            
                "fetched_at": new Date(Date.now()),
            
        
    
        
        
            
                "rank": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "url": "Marie Curie",
            
        
    
        
        
            
                "snippet": "Ada Lovelace",
            
        
    
        
        
            
                "fetched_at": new Date(Date.now()),
            
        
    
        
        
            
                "rank": 6,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "url": "Alan Turing",
            
        
    
        
        
            
                "snippet": "Ada Lovelace",
            
        
    
        
        
            
                "fetched_at": new Date(Date.now()),
            
        
    
        
        
            
                "rank": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "url": "Ada Lovelace",
            
        
    
        
        
            
                "snippet": "Alan Turing",
            
        
    
        
        
            
                "fetched_at": new Date(Date.now()),
            
        
    
        
        
            
                "rank": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "url": "Ada Lovelace",
            
        
    
        
        
            
                "snippet": "Marie Curie",
            
        
    
        
        
            
                "fetched_at": new Date(Date.now()),
            
        
    
        
        
            
                "rank": 6,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SystemHealthChecksData = [
    
    {
    
        
        
            
                "component": "Ada Lovelace",
            
        
    
        
        
            
                "status": "healthy",
            
        
    
        
        
            
                "latency_ms": 4.07,
            
        
    
        
        
            
                "error_rate_percent": 8.55,
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "component": "Grace Hopper",
            
        
    
        
        
            
                "status": "healthy",
            
        
    
        
        
            
                "latency_ms": 4.1,
            
        
    
        
        
            
                "error_rate_percent": 9.96,
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "component": "Marie Curie",
            
        
    
        
        
            
                "status": "healthy",
            
        
    
        
        
            
                "latency_ms": 7.51,
            
        
    
        
        
            
                "error_rate_percent": 0.17,
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "component": "Ada Lovelace",
            
        
    
        
        
            
                "status": "down",
            
        
    
        
        
            
                "latency_ms": 1.63,
            
        
    
        
        
            
                "error_rate_percent": 6.25,
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                "component": "Alan Turing",
            
        
    
        
        
            
                "status": "down",
            
        
    
        
        
            
                "latency_ms": 6.84,
            
        
    
        
        
            
                "error_rate_percent": 4.08,
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                "details": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AuditEventsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Grace Hopper",
            
        
    
        
        
            
                "entity_name": "Ada Lovelace",
            
        
    
        
        
            
                "entity_key": "Grace Hopper",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "metadata_json": "Marie Curie",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Marie Curie",
            
        
    
        
        
            
                "entity_name": "Grace Hopper",
            
        
    
        
        
            
                "entity_key": "Marie Curie",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "metadata_json": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Marie Curie",
            
        
    
        
        
            
                "entity_name": "Marie Curie",
            
        
    
        
        
            
                "entity_key": "Alan Turing",
            
        
    
        
        
            
                "severity": "warning",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "metadata_json": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Ada Lovelace",
            
        
    
        
        
            
                "entity_name": "Grace Hopper",
            
        
    
        
        
            
                "entity_key": "Grace Hopper",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "metadata_json": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "action": "Marie Curie",
            
        
    
        
        
            
                "entity_name": "Alan Turing",
            
        
    
        
        
            
                "entity_key": "Grace Hopper",
            
        
    
        
        
            
                "severity": "critical",
            
        
    
        
        
            
                "occurred_at": new Date(Date.now()),
            
        
    
        
        
            
                "metadata_json": "Marie Curie",
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // 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);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User3 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (User3?.setOrganization)
                {
                    await
                    User3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const User4 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (User4?.setOrganization)
                {
                    await
                    User4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
    
    
        
    

    
    
    
        
            
            async function associateOrganizationMembershipWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership0 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrganizationMembership0?.setOrganization)
                {
                    await
                    OrganizationMembership0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership1 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrganizationMembership1?.setOrganization)
                {
                    await
                    OrganizationMembership1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership2 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrganizationMembership2?.setOrganization)
                {
                    await
                    OrganizationMembership2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership3 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrganizationMembership3?.setOrganization)
                {
                    await
                    OrganizationMembership3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const OrganizationMembership4 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (OrganizationMembership4?.setOrganization)
                {
                    await
                    OrganizationMembership4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    
        
            
            async function associateOrganizationMembershipWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership0 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (OrganizationMembership0?.setUser)
                {
                    await
                    OrganizationMembership0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership1 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (OrganizationMembership1?.setUser)
                {
                    await
                    OrganizationMembership1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership2 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (OrganizationMembership2?.setUser)
                {
                    await
                    OrganizationMembership2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership3 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (OrganizationMembership3?.setUser)
                {
                    await
                    OrganizationMembership3.
                    setUser(relatedUser3);
                }
            
                const relatedUser4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const OrganizationMembership4 = await OrganizationMemberships.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (OrganizationMembership4?.setUser)
                {
                    await
                    OrganizationMembership4.
                    setUser(relatedUser4);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateProjectWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project0 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Project0?.setOrganization)
                {
                    await
                    Project0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project1 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Project1?.setOrganization)
                {
                    await
                    Project1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project2 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Project2?.setOrganization)
                {
                    await
                    Project2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project3 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Project3?.setOrganization)
                {
                    await
                    Project3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Project4 = await Projects.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Project4?.setOrganization)
                {
                    await
                    Project4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
            
            async function associateWorkspaceWithProject() {
            
                const relatedProject0 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Workspace0 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Workspace0?.setProject)
                {
                    await
                    Workspace0.
                    setProject(relatedProject0);
                }
            
                const relatedProject1 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Workspace1 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Workspace1?.setProject)
                {
                    await
                    Workspace1.
                    setProject(relatedProject1);
                }
            
                const relatedProject2 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Workspace2 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Workspace2?.setProject)
                {
                    await
                    Workspace2.
                    setProject(relatedProject2);
                }
            
                const relatedProject3 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Workspace3 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Workspace3?.setProject)
                {
                    await
                    Workspace3.
                    setProject(relatedProject3);
                }
            
                const relatedProject4 = await Projects.findOne({
                    offset: Math.floor(Math.random() * (await Projects.count())),
                });
                const Workspace4 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Workspace4?.setProject)
                {
                    await
                    Workspace4.
                    setProject(relatedProject4);
                }
            
        }
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateWorkspaceWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace0 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Workspace0?.setOrganization)
                {
                    await
                    Workspace0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace1 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Workspace1?.setOrganization)
                {
                    await
                    Workspace1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace2 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Workspace2?.setOrganization)
                {
                    await
                    Workspace2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace3 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Workspace3?.setOrganization)
                {
                    await
                    Workspace3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Workspace4 = await Workspaces.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Workspace4?.setOrganization)
                {
                    await
                    Workspace4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateLlmProviderWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmProvider0 = await LlmProviders.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LlmProvider0?.setOrganization)
                {
                    await
                    LlmProvider0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmProvider1 = await LlmProviders.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LlmProvider1?.setOrganization)
                {
                    await
                    LlmProvider1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmProvider2 = await LlmProviders.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LlmProvider2?.setOrganization)
                {
                    await
                    LlmProvider2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmProvider3 = await LlmProviders.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LlmProvider3?.setOrganization)
                {
                    await
                    LlmProvider3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmProvider4 = await LlmProviders.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (LlmProvider4?.setOrganization)
                {
                    await
                    LlmProvider4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateLlmModelWithProvider() {
            
                const relatedProvider0 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmModel0 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LlmModel0?.setProvider)
                {
                    await
                    LlmModel0.
                    setProvider(relatedProvider0);
                }
            
                const relatedProvider1 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmModel1 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LlmModel1?.setProvider)
                {
                    await
                    LlmModel1.
                    setProvider(relatedProvider1);
                }
            
                const relatedProvider2 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmModel2 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LlmModel2?.setProvider)
                {
                    await
                    LlmModel2.
                    setProvider(relatedProvider2);
                }
            
                const relatedProvider3 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmModel3 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LlmModel3?.setProvider)
                {
                    await
                    LlmModel3.
                    setProvider(relatedProvider3);
                }
            
                const relatedProvider4 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmModel4 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (LlmModel4?.setProvider)
                {
                    await
                    LlmModel4.
                    setProvider(relatedProvider4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateLlmModelWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmModel0 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LlmModel0?.setOrganization)
                {
                    await
                    LlmModel0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmModel1 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LlmModel1?.setOrganization)
                {
                    await
                    LlmModel1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmModel2 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LlmModel2?.setOrganization)
                {
                    await
                    LlmModel2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmModel3 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LlmModel3?.setOrganization)
                {
                    await
                    LlmModel3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmModel4 = await LlmModels.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (LlmModel4?.setOrganization)
                {
                    await
                    LlmModel4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateLlmApiKeyWithProvider() {
            
                const relatedProvider0 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmApiKey0 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LlmApiKey0?.setProvider)
                {
                    await
                    LlmApiKey0.
                    setProvider(relatedProvider0);
                }
            
                const relatedProvider1 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmApiKey1 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LlmApiKey1?.setProvider)
                {
                    await
                    LlmApiKey1.
                    setProvider(relatedProvider1);
                }
            
                const relatedProvider2 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmApiKey2 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LlmApiKey2?.setProvider)
                {
                    await
                    LlmApiKey2.
                    setProvider(relatedProvider2);
                }
            
                const relatedProvider3 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmApiKey3 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LlmApiKey3?.setProvider)
                {
                    await
                    LlmApiKey3.
                    setProvider(relatedProvider3);
                }
            
                const relatedProvider4 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const LlmApiKey4 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (LlmApiKey4?.setProvider)
                {
                    await
                    LlmApiKey4.
                    setProvider(relatedProvider4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateLlmApiKeyWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmApiKey0 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (LlmApiKey0?.setOrganization)
                {
                    await
                    LlmApiKey0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmApiKey1 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (LlmApiKey1?.setOrganization)
                {
                    await
                    LlmApiKey1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmApiKey2 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (LlmApiKey2?.setOrganization)
                {
                    await
                    LlmApiKey2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmApiKey3 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (LlmApiKey3?.setOrganization)
                {
                    await
                    LlmApiKey3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const LlmApiKey4 = await LlmApiKeys.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (LlmApiKey4?.setOrganization)
                {
                    await
                    LlmApiKey4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateKeyRotationPolicyWithProvider() {
            
                const relatedProvider0 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const KeyRotationPolicy0 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KeyRotationPolicy0?.setProvider)
                {
                    await
                    KeyRotationPolicy0.
                    setProvider(relatedProvider0);
                }
            
                const relatedProvider1 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const KeyRotationPolicy1 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KeyRotationPolicy1?.setProvider)
                {
                    await
                    KeyRotationPolicy1.
                    setProvider(relatedProvider1);
                }
            
                const relatedProvider2 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const KeyRotationPolicy2 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KeyRotationPolicy2?.setProvider)
                {
                    await
                    KeyRotationPolicy2.
                    setProvider(relatedProvider2);
                }
            
                const relatedProvider3 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const KeyRotationPolicy3 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KeyRotationPolicy3?.setProvider)
                {
                    await
                    KeyRotationPolicy3.
                    setProvider(relatedProvider3);
                }
            
                const relatedProvider4 = await LlmProviders.findOne({
                    offset: Math.floor(Math.random() * (await LlmProviders.count())),
                });
                const KeyRotationPolicy4 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (KeyRotationPolicy4?.setProvider)
                {
                    await
                    KeyRotationPolicy4.
                    setProvider(relatedProvider4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateKeyRotationPolicyWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KeyRotationPolicy0 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (KeyRotationPolicy0?.setOrganization)
                {
                    await
                    KeyRotationPolicy0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KeyRotationPolicy1 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (KeyRotationPolicy1?.setOrganization)
                {
                    await
                    KeyRotationPolicy1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KeyRotationPolicy2 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (KeyRotationPolicy2?.setOrganization)
                {
                    await
                    KeyRotationPolicy2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KeyRotationPolicy3 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (KeyRotationPolicy3?.setOrganization)
                {
                    await
                    KeyRotationPolicy3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const KeyRotationPolicy4 = await KeyRotationPolicies.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (KeyRotationPolicy4?.setOrganization)
                {
                    await
                    KeyRotationPolicy4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePromptTemplateWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromptTemplate0 = await PromptTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (PromptTemplate0?.setOrganization)
                {
                    await
                    PromptTemplate0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromptTemplate1 = await PromptTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (PromptTemplate1?.setOrganization)
                {
                    await
                    PromptTemplate1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromptTemplate2 = await PromptTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (PromptTemplate2?.setOrganization)
                {
                    await
                    PromptTemplate2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromptTemplate3 = await PromptTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (PromptTemplate3?.setOrganization)
                {
                    await
                    PromptTemplate3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const PromptTemplate4 = await PromptTemplates.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (PromptTemplate4?.setOrganization)
                {
                    await
                    PromptTemplate4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateChatWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Chat0 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Chat0?.setWorkspace)
                {
                    await
                    Chat0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Chat1 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Chat1?.setWorkspace)
                {
                    await
                    Chat1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Chat2 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Chat2?.setWorkspace)
                {
                    await
                    Chat2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Chat3 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Chat3?.setWorkspace)
                {
                    await
                    Chat3.
                    setWorkspace(relatedWorkspace3);
                }
            
                const relatedWorkspace4 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const Chat4 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Chat4?.setWorkspace)
                {
                    await
                    Chat4.
                    setWorkspace(relatedWorkspace4);
                }
            
        }
        
    
        
            
            async function associateChatWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Chat0 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Chat0?.setUser)
                {
                    await
                    Chat0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Chat1 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Chat1?.setUser)
                {
                    await
                    Chat1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Chat2 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Chat2?.setUser)
                {
                    await
                    Chat2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Chat3 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Chat3?.setUser)
                {
                    await
                    Chat3.
                    setUser(relatedUser3);
                }
            
                const relatedUser4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Chat4 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Chat4?.setUser)
                {
                    await
                    Chat4.
                    setUser(relatedUser4);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateChatWithModel() {
            
                const relatedModel0 = await LlmModels.findOne({
                    offset: Math.floor(Math.random() * (await LlmModels.count())),
                });
                const Chat0 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Chat0?.setModel)
                {
                    await
                    Chat0.
                    setModel(relatedModel0);
                }
            
                const relatedModel1 = await LlmModels.findOne({
                    offset: Math.floor(Math.random() * (await LlmModels.count())),
                });
                const Chat1 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Chat1?.setModel)
                {
                    await
                    Chat1.
                    setModel(relatedModel1);
                }
            
                const relatedModel2 = await LlmModels.findOne({
                    offset: Math.floor(Math.random() * (await LlmModels.count())),
                });
                const Chat2 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Chat2?.setModel)
                {
                    await
                    Chat2.
                    setModel(relatedModel2);
                }
            
                const relatedModel3 = await LlmModels.findOne({
                    offset: Math.floor(Math.random() * (await LlmModels.count())),
                });
                const Chat3 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Chat3?.setModel)
                {
                    await
                    Chat3.
                    setModel(relatedModel3);
                }
            
                const relatedModel4 = await LlmModels.findOne({
                    offset: Math.floor(Math.random() * (await LlmModels.count())),
                });
                const Chat4 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Chat4?.setModel)
                {
                    await
                    Chat4.
                    setModel(relatedModel4);
                }
            
        }
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateChatWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Chat0 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Chat0?.setOrganization)
                {
                    await
                    Chat0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Chat1 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Chat1?.setOrganization)
                {
                    await
                    Chat1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Chat2 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Chat2?.setOrganization)
                {
                    await
                    Chat2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Chat3 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (Chat3?.setOrganization)
                {
                    await
                    Chat3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const Chat4 = await Chats.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (Chat4?.setOrganization)
                {
                    await
                    Chat4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateChatMessageWithChat() {
            
                const relatedChat0 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const ChatMessage0 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatMessage0?.setChat)
                {
                    await
                    ChatMessage0.
                    setChat(relatedChat0);
                }
            
                const relatedChat1 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const ChatMessage1 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatMessage1?.setChat)
                {
                    await
                    ChatMessage1.
                    setChat(relatedChat1);
                }
            
                const relatedChat2 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const ChatMessage2 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatMessage2?.setChat)
                {
                    await
                    ChatMessage2.
                    setChat(relatedChat2);
                }
            
                const relatedChat3 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const ChatMessage3 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatMessage3?.setChat)
                {
                    await
                    ChatMessage3.
                    setChat(relatedChat3);
                }
            
                const relatedChat4 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const ChatMessage4 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ChatMessage4?.setChat)
                {
                    await
                    ChatMessage4.
                    setChat(relatedChat4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateChatMessageWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage0 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ChatMessage0?.setOrganization)
                {
                    await
                    ChatMessage0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage1 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ChatMessage1?.setOrganization)
                {
                    await
                    ChatMessage1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage2 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ChatMessage2?.setOrganization)
                {
                    await
                    ChatMessage2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage3 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (ChatMessage3?.setOrganization)
                {
                    await
                    ChatMessage3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const ChatMessage4 = await ChatMessages.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (ChatMessage4?.setOrganization)
                {
                    await
                    ChatMessage4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateEncryptionSessionWithChat() {
            
                const relatedChat0 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const EncryptionSession0 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EncryptionSession0?.setChat)
                {
                    await
                    EncryptionSession0.
                    setChat(relatedChat0);
                }
            
                const relatedChat1 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const EncryptionSession1 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EncryptionSession1?.setChat)
                {
                    await
                    EncryptionSession1.
                    setChat(relatedChat1);
                }
            
                const relatedChat2 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const EncryptionSession2 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EncryptionSession2?.setChat)
                {
                    await
                    EncryptionSession2.
                    setChat(relatedChat2);
                }
            
                const relatedChat3 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const EncryptionSession3 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (EncryptionSession3?.setChat)
                {
                    await
                    EncryptionSession3.
                    setChat(relatedChat3);
                }
            
                const relatedChat4 = await Chats.findOne({
                    offset: Math.floor(Math.random() * (await Chats.count())),
                });
                const EncryptionSession4 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (EncryptionSession4?.setChat)
                {
                    await
                    EncryptionSession4.
                    setChat(relatedChat4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateEncryptionSessionWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EncryptionSession0 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EncryptionSession0?.setOrganization)
                {
                    await
                    EncryptionSession0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EncryptionSession1 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EncryptionSession1?.setOrganization)
                {
                    await
                    EncryptionSession1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EncryptionSession2 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EncryptionSession2?.setOrganization)
                {
                    await
                    EncryptionSession2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EncryptionSession3 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (EncryptionSession3?.setOrganization)
                {
                    await
                    EncryptionSession3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const EncryptionSession4 = await EncryptionSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (EncryptionSession4?.setOrganization)
                {
                    await
                    EncryptionSession4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCodeRepositoryWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeRepository0 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodeRepository0?.setWorkspace)
                {
                    await
                    CodeRepository0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeRepository1 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodeRepository1?.setWorkspace)
                {
                    await
                    CodeRepository1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeRepository2 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodeRepository2?.setWorkspace)
                {
                    await
                    CodeRepository2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeRepository3 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodeRepository3?.setWorkspace)
                {
                    await
                    CodeRepository3.
                    setWorkspace(relatedWorkspace3);
                }
            
                const relatedWorkspace4 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeRepository4 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodeRepository4?.setWorkspace)
                {
                    await
                    CodeRepository4.
                    setWorkspace(relatedWorkspace4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateCodeRepositoryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeRepository0 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodeRepository0?.setOrganization)
                {
                    await
                    CodeRepository0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeRepository1 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodeRepository1?.setOrganization)
                {
                    await
                    CodeRepository1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeRepository2 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodeRepository2?.setOrganization)
                {
                    await
                    CodeRepository2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeRepository3 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodeRepository3?.setOrganization)
                {
                    await
                    CodeRepository3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeRepository4 = await CodeRepositories.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodeRepository4?.setOrganization)
                {
                    await
                    CodeRepository4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCodeFileWithRepository() {
            
                const relatedRepository0 = await CodeRepositories.findOne({
                    offset: Math.floor(Math.random() * (await CodeRepositories.count())),
                });
                const CodeFile0 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodeFile0?.setRepository)
                {
                    await
                    CodeFile0.
                    setRepository(relatedRepository0);
                }
            
                const relatedRepository1 = await CodeRepositories.findOne({
                    offset: Math.floor(Math.random() * (await CodeRepositories.count())),
                });
                const CodeFile1 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodeFile1?.setRepository)
                {
                    await
                    CodeFile1.
                    setRepository(relatedRepository1);
                }
            
                const relatedRepository2 = await CodeRepositories.findOne({
                    offset: Math.floor(Math.random() * (await CodeRepositories.count())),
                });
                const CodeFile2 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodeFile2?.setRepository)
                {
                    await
                    CodeFile2.
                    setRepository(relatedRepository2);
                }
            
                const relatedRepository3 = await CodeRepositories.findOne({
                    offset: Math.floor(Math.random() * (await CodeRepositories.count())),
                });
                const CodeFile3 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodeFile3?.setRepository)
                {
                    await
                    CodeFile3.
                    setRepository(relatedRepository3);
                }
            
                const relatedRepository4 = await CodeRepositories.findOne({
                    offset: Math.floor(Math.random() * (await CodeRepositories.count())),
                });
                const CodeFile4 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodeFile4?.setRepository)
                {
                    await
                    CodeFile4.
                    setRepository(relatedRepository4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCodeFileWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeFile0 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodeFile0?.setOrganization)
                {
                    await
                    CodeFile0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeFile1 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodeFile1?.setOrganization)
                {
                    await
                    CodeFile1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeFile2 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodeFile2?.setOrganization)
                {
                    await
                    CodeFile2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeFile3 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodeFile3?.setOrganization)
                {
                    await
                    CodeFile3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeFile4 = await CodeFiles.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodeFile4?.setOrganization)
                {
                    await
                    CodeFile4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCodeChangeSetWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeChangeSet0 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodeChangeSet0?.setWorkspace)
                {
                    await
                    CodeChangeSet0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeChangeSet1 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodeChangeSet1?.setWorkspace)
                {
                    await
                    CodeChangeSet1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeChangeSet2 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodeChangeSet2?.setWorkspace)
                {
                    await
                    CodeChangeSet2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeChangeSet3 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodeChangeSet3?.setWorkspace)
                {
                    await
                    CodeChangeSet3.
                    setWorkspace(relatedWorkspace3);
                }
            
                const relatedWorkspace4 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const CodeChangeSet4 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodeChangeSet4?.setWorkspace)
                {
                    await
                    CodeChangeSet4.
                    setWorkspace(relatedWorkspace4);
                }
            
        }
        
    
        
            
            async function associateCodeChangeSetWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CodeChangeSet0 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodeChangeSet0?.setUser)
                {
                    await
                    CodeChangeSet0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CodeChangeSet1 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodeChangeSet1?.setUser)
                {
                    await
                    CodeChangeSet1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CodeChangeSet2 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodeChangeSet2?.setUser)
                {
                    await
                    CodeChangeSet2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CodeChangeSet3 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodeChangeSet3?.setUser)
                {
                    await
                    CodeChangeSet3.
                    setUser(relatedUser3);
                }
            
                const relatedUser4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const CodeChangeSet4 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodeChangeSet4?.setUser)
                {
                    await
                    CodeChangeSet4.
                    setUser(relatedUser4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateCodeChangeSetWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeChangeSet0 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodeChangeSet0?.setOrganization)
                {
                    await
                    CodeChangeSet0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeChangeSet1 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodeChangeSet1?.setOrganization)
                {
                    await
                    CodeChangeSet1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeChangeSet2 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodeChangeSet2?.setOrganization)
                {
                    await
                    CodeChangeSet2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeChangeSet3 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodeChangeSet3?.setOrganization)
                {
                    await
                    CodeChangeSet3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodeChangeSet4 = await CodeChangeSets.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodeChangeSet4?.setOrganization)
                {
                    await
                    CodeChangeSet4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateCodePatcheWithChange_set() {
            
                const relatedChange_set0 = await CodeChangeSets.findOne({
                    offset: Math.floor(Math.random() * (await CodeChangeSets.count())),
                });
                const CodePatche0 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodePatche0?.setChange_set)
                {
                    await
                    CodePatche0.
                    setChange_set(relatedChange_set0);
                }
            
                const relatedChange_set1 = await CodeChangeSets.findOne({
                    offset: Math.floor(Math.random() * (await CodeChangeSets.count())),
                });
                const CodePatche1 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodePatche1?.setChange_set)
                {
                    await
                    CodePatche1.
                    setChange_set(relatedChange_set1);
                }
            
                const relatedChange_set2 = await CodeChangeSets.findOne({
                    offset: Math.floor(Math.random() * (await CodeChangeSets.count())),
                });
                const CodePatche2 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodePatche2?.setChange_set)
                {
                    await
                    CodePatche2.
                    setChange_set(relatedChange_set2);
                }
            
                const relatedChange_set3 = await CodeChangeSets.findOne({
                    offset: Math.floor(Math.random() * (await CodeChangeSets.count())),
                });
                const CodePatche3 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodePatche3?.setChange_set)
                {
                    await
                    CodePatche3.
                    setChange_set(relatedChange_set3);
                }
            
                const relatedChange_set4 = await CodeChangeSets.findOne({
                    offset: Math.floor(Math.random() * (await CodeChangeSets.count())),
                });
                const CodePatche4 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodePatche4?.setChange_set)
                {
                    await
                    CodePatche4.
                    setChange_set(relatedChange_set4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateCodePatcheWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodePatche0 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (CodePatche0?.setOrganization)
                {
                    await
                    CodePatche0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodePatche1 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (CodePatche1?.setOrganization)
                {
                    await
                    CodePatche1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodePatche2 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (CodePatche2?.setOrganization)
                {
                    await
                    CodePatche2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodePatche3 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (CodePatche3?.setOrganization)
                {
                    await
                    CodePatche3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const CodePatche4 = await CodePatches.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (CodePatche4?.setOrganization)
                {
                    await
                    CodePatche4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBuildJobWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const BuildJob0 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BuildJob0?.setWorkspace)
                {
                    await
                    BuildJob0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const BuildJob1 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BuildJob1?.setWorkspace)
                {
                    await
                    BuildJob1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const BuildJob2 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BuildJob2?.setWorkspace)
                {
                    await
                    BuildJob2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const BuildJob3 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BuildJob3?.setWorkspace)
                {
                    await
                    BuildJob3.
                    setWorkspace(relatedWorkspace3);
                }
            
                const relatedWorkspace4 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const BuildJob4 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (BuildJob4?.setWorkspace)
                {
                    await
                    BuildJob4.
                    setWorkspace(relatedWorkspace4);
                }
            
        }
        
    
        
            
            async function associateBuildJobWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const BuildJob0 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BuildJob0?.setUser)
                {
                    await
                    BuildJob0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const BuildJob1 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BuildJob1?.setUser)
                {
                    await
                    BuildJob1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const BuildJob2 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BuildJob2?.setUser)
                {
                    await
                    BuildJob2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const BuildJob3 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BuildJob3?.setUser)
                {
                    await
                    BuildJob3.
                    setUser(relatedUser3);
                }
            
                const relatedUser4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const BuildJob4 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (BuildJob4?.setUser)
                {
                    await
                    BuildJob4.
                    setUser(relatedUser4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateBuildJobWithPipeline() {
            
                const relatedPipeline0 = await BuildPipelines.findOne({
                    offset: Math.floor(Math.random() * (await BuildPipelines.count())),
                });
                const BuildJob0 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BuildJob0?.setPipeline)
                {
                    await
                    BuildJob0.
                    setPipeline(relatedPipeline0);
                }
            
                const relatedPipeline1 = await BuildPipelines.findOne({
                    offset: Math.floor(Math.random() * (await BuildPipelines.count())),
                });
                const BuildJob1 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BuildJob1?.setPipeline)
                {
                    await
                    BuildJob1.
                    setPipeline(relatedPipeline1);
                }
            
                const relatedPipeline2 = await BuildPipelines.findOne({
                    offset: Math.floor(Math.random() * (await BuildPipelines.count())),
                });
                const BuildJob2 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BuildJob2?.setPipeline)
                {
                    await
                    BuildJob2.
                    setPipeline(relatedPipeline2);
                }
            
                const relatedPipeline3 = await BuildPipelines.findOne({
                    offset: Math.floor(Math.random() * (await BuildPipelines.count())),
                });
                const BuildJob3 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BuildJob3?.setPipeline)
                {
                    await
                    BuildJob3.
                    setPipeline(relatedPipeline3);
                }
            
                const relatedPipeline4 = await BuildPipelines.findOne({
                    offset: Math.floor(Math.random() * (await BuildPipelines.count())),
                });
                const BuildJob4 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (BuildJob4?.setPipeline)
                {
                    await
                    BuildJob4.
                    setPipeline(relatedPipeline4);
                }
            
        }
        
    
        
            
            async function associateBuildJobWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildJob0 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BuildJob0?.setOrganization)
                {
                    await
                    BuildJob0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildJob1 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BuildJob1?.setOrganization)
                {
                    await
                    BuildJob1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildJob2 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BuildJob2?.setOrganization)
                {
                    await
                    BuildJob2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildJob3 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BuildJob3?.setOrganization)
                {
                    await
                    BuildJob3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildJob4 = await BuildJobs.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (BuildJob4?.setOrganization)
                {
                    await
                    BuildJob4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateBuildPipelineWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildPipeline0 = await BuildPipelines.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BuildPipeline0?.setOrganization)
                {
                    await
                    BuildPipeline0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildPipeline1 = await BuildPipelines.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BuildPipeline1?.setOrganization)
                {
                    await
                    BuildPipeline1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildPipeline2 = await BuildPipelines.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BuildPipeline2?.setOrganization)
                {
                    await
                    BuildPipeline2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildPipeline3 = await BuildPipelines.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BuildPipeline3?.setOrganization)
                {
                    await
                    BuildPipeline3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildPipeline4 = await BuildPipelines.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (BuildPipeline4?.setOrganization)
                {
                    await
                    BuildPipeline4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    

    
    
    
        
            
            async function associateBuildArtifactWithBuild_job() {
            
                const relatedBuild_job0 = await BuildJobs.findOne({
                    offset: Math.floor(Math.random() * (await BuildJobs.count())),
                });
                const BuildArtifact0 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BuildArtifact0?.setBuild_job)
                {
                    await
                    BuildArtifact0.
                    setBuild_job(relatedBuild_job0);
                }
            
                const relatedBuild_job1 = await BuildJobs.findOne({
                    offset: Math.floor(Math.random() * (await BuildJobs.count())),
                });
                const BuildArtifact1 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BuildArtifact1?.setBuild_job)
                {
                    await
                    BuildArtifact1.
                    setBuild_job(relatedBuild_job1);
                }
            
                const relatedBuild_job2 = await BuildJobs.findOne({
                    offset: Math.floor(Math.random() * (await BuildJobs.count())),
                });
                const BuildArtifact2 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BuildArtifact2?.setBuild_job)
                {
                    await
                    BuildArtifact2.
                    setBuild_job(relatedBuild_job2);
                }
            
                const relatedBuild_job3 = await BuildJobs.findOne({
                    offset: Math.floor(Math.random() * (await BuildJobs.count())),
                });
                const BuildArtifact3 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BuildArtifact3?.setBuild_job)
                {
                    await
                    BuildArtifact3.
                    setBuild_job(relatedBuild_job3);
                }
            
                const relatedBuild_job4 = await BuildJobs.findOne({
                    offset: Math.floor(Math.random() * (await BuildJobs.count())),
                });
                const BuildArtifact4 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (BuildArtifact4?.setBuild_job)
                {
                    await
                    BuildArtifact4.
                    setBuild_job(relatedBuild_job4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBuildArtifactWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildArtifact0 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BuildArtifact0?.setOrganization)
                {
                    await
                    BuildArtifact0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildArtifact1 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BuildArtifact1?.setOrganization)
                {
                    await
                    BuildArtifact1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildArtifact2 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BuildArtifact2?.setOrganization)
                {
                    await
                    BuildArtifact2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildArtifact3 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (BuildArtifact3?.setOrganization)
                {
                    await
                    BuildArtifact3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const BuildArtifact4 = await BuildArtifacts.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (BuildArtifact4?.setOrganization)
                {
                    await
                    BuildArtifact4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateWebSearchQueryWithWorkspace() {
            
                const relatedWorkspace0 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WebSearchQuery0 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WebSearchQuery0?.setWorkspace)
                {
                    await
                    WebSearchQuery0.
                    setWorkspace(relatedWorkspace0);
                }
            
                const relatedWorkspace1 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WebSearchQuery1 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WebSearchQuery1?.setWorkspace)
                {
                    await
                    WebSearchQuery1.
                    setWorkspace(relatedWorkspace1);
                }
            
                const relatedWorkspace2 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WebSearchQuery2 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WebSearchQuery2?.setWorkspace)
                {
                    await
                    WebSearchQuery2.
                    setWorkspace(relatedWorkspace2);
                }
            
                const relatedWorkspace3 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WebSearchQuery3 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WebSearchQuery3?.setWorkspace)
                {
                    await
                    WebSearchQuery3.
                    setWorkspace(relatedWorkspace3);
                }
            
                const relatedWorkspace4 = await Workspaces.findOne({
                    offset: Math.floor(Math.random() * (await Workspaces.count())),
                });
                const WebSearchQuery4 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (WebSearchQuery4?.setWorkspace)
                {
                    await
                    WebSearchQuery4.
                    setWorkspace(relatedWorkspace4);
                }
            
        }
        
    
        
            
            async function associateWebSearchQueryWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WebSearchQuery0 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WebSearchQuery0?.setUser)
                {
                    await
                    WebSearchQuery0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WebSearchQuery1 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WebSearchQuery1?.setUser)
                {
                    await
                    WebSearchQuery1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WebSearchQuery2 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WebSearchQuery2?.setUser)
                {
                    await
                    WebSearchQuery2.
                    setUser(relatedUser2);
                }
            
                const relatedUser3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WebSearchQuery3 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WebSearchQuery3?.setUser)
                {
                    await
                    WebSearchQuery3.
                    setUser(relatedUser3);
                }
            
                const relatedUser4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const WebSearchQuery4 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (WebSearchQuery4?.setUser)
                {
                    await
                    WebSearchQuery4.
                    setUser(relatedUser4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateWebSearchQueryWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchQuery0 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WebSearchQuery0?.setOrganization)
                {
                    await
                    WebSearchQuery0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchQuery1 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WebSearchQuery1?.setOrganization)
                {
                    await
                    WebSearchQuery1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchQuery2 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WebSearchQuery2?.setOrganization)
                {
                    await
                    WebSearchQuery2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchQuery3 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WebSearchQuery3?.setOrganization)
                {
                    await
                    WebSearchQuery3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchQuery4 = await WebSearchQueries.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (WebSearchQuery4?.setOrganization)
                {
                    await
                    WebSearchQuery4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateWebSearchResultWithQuery() {
            
                const relatedQuery0 = await WebSearchQueries.findOne({
                    offset: Math.floor(Math.random() * (await WebSearchQueries.count())),
                });
                const WebSearchResult0 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WebSearchResult0?.setQuery)
                {
                    await
                    WebSearchResult0.
                    setQuery(relatedQuery0);
                }
            
                const relatedQuery1 = await WebSearchQueries.findOne({
                    offset: Math.floor(Math.random() * (await WebSearchQueries.count())),
                });
                const WebSearchResult1 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WebSearchResult1?.setQuery)
                {
                    await
                    WebSearchResult1.
                    setQuery(relatedQuery1);
                }
            
                const relatedQuery2 = await WebSearchQueries.findOne({
                    offset: Math.floor(Math.random() * (await WebSearchQueries.count())),
                });
                const WebSearchResult2 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WebSearchResult2?.setQuery)
                {
                    await
                    WebSearchResult2.
                    setQuery(relatedQuery2);
                }
            
                const relatedQuery3 = await WebSearchQueries.findOne({
                    offset: Math.floor(Math.random() * (await WebSearchQueries.count())),
                });
                const WebSearchResult3 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WebSearchResult3?.setQuery)
                {
                    await
                    WebSearchResult3.
                    setQuery(relatedQuery3);
                }
            
                const relatedQuery4 = await WebSearchQueries.findOne({
                    offset: Math.floor(Math.random() * (await WebSearchQueries.count())),
                });
                const WebSearchResult4 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (WebSearchResult4?.setQuery)
                {
                    await
                    WebSearchResult4.
                    setQuery(relatedQuery4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateWebSearchResultWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchResult0 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (WebSearchResult0?.setOrganization)
                {
                    await
                    WebSearchResult0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchResult1 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (WebSearchResult1?.setOrganization)
                {
                    await
                    WebSearchResult1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchResult2 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (WebSearchResult2?.setOrganization)
                {
                    await
                    WebSearchResult2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchResult3 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (WebSearchResult3?.setOrganization)
                {
                    await
                    WebSearchResult3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const WebSearchResult4 = await WebSearchResults.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (WebSearchResult4?.setOrganization)
                {
                    await
                    WebSearchResult4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateSystemHealthCheckWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SystemHealthCheck0 = await SystemHealthChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (SystemHealthCheck0?.setOrganization)
                {
                    await
                    SystemHealthCheck0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SystemHealthCheck1 = await SystemHealthChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (SystemHealthCheck1?.setOrganization)
                {
                    await
                    SystemHealthCheck1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SystemHealthCheck2 = await SystemHealthChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (SystemHealthCheck2?.setOrganization)
                {
                    await
                    SystemHealthCheck2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SystemHealthCheck3 = await SystemHealthChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (SystemHealthCheck3?.setOrganization)
                {
                    await
                    SystemHealthCheck3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const SystemHealthCheck4 = await SystemHealthChecks.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (SystemHealthCheck4?.setOrganization)
                {
                    await
                    SystemHealthCheck4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAuditEventWithOrganization() {
            
                const relatedOrganization0 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent0 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditEvent0?.setOrganization)
                {
                    await
                    AuditEvent0.
                    setOrganization(relatedOrganization0);
                }
            
                const relatedOrganization1 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent1 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditEvent1?.setOrganization)
                {
                    await
                    AuditEvent1.
                    setOrganization(relatedOrganization1);
                }
            
                const relatedOrganization2 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent2 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditEvent2?.setOrganization)
                {
                    await
                    AuditEvent2.
                    setOrganization(relatedOrganization2);
                }
            
                const relatedOrganization3 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent3 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditEvent3?.setOrganization)
                {
                    await
                    AuditEvent3.
                    setOrganization(relatedOrganization3);
                }
            
                const relatedOrganization4 = await Organizations.findOne({
                    offset: Math.floor(Math.random() * (await Organizations.count())),
                });
                const AuditEvent4 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (AuditEvent4?.setOrganization)
                {
                    await
                    AuditEvent4.
                    setOrganization(relatedOrganization4);
                }
            
        }
        
    
        
            
            async function associateAuditEventWithActor() {
            
                const relatedActor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent0 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AuditEvent0?.setActor)
                {
                    await
                    AuditEvent0.
                    setActor(relatedActor0);
                }
            
                const relatedActor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent1 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AuditEvent1?.setActor)
                {
                    await
                    AuditEvent1.
                    setActor(relatedActor1);
                }
            
                const relatedActor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent2 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AuditEvent2?.setActor)
                {
                    await
                    AuditEvent2.
                    setActor(relatedActor2);
                }
            
                const relatedActor3 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent3 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 3
                });
                if (AuditEvent3?.setActor)
                {
                    await
                    AuditEvent3.
                    setActor(relatedActor3);
                }
            
                const relatedActor4 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AuditEvent4 = await AuditEvents.findOne({
                    order: [['id', 'ASC']],
                    offset: 4
                });
                if (AuditEvent4?.setActor)
                {
                    await
                    AuditEvent4.
                    setActor(relatedActor4);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Organizations.bulkCreate(OrganizationsData);
                
            
            
                
                await OrganizationMemberships.bulkCreate(OrganizationMembershipsData);
                
            
            
                
                await Projects.bulkCreate(ProjectsData);
                
            
            
                
                await Workspaces.bulkCreate(WorkspacesData);
                
            
            
                
                await LlmProviders.bulkCreate(LlmProvidersData);
                
            
            
                
                await LlmModels.bulkCreate(LlmModelsData);
                
            
            
                
                await LlmApiKeys.bulkCreate(LlmApiKeysData);
                
            
            
                
                await KeyRotationPolicies.bulkCreate(KeyRotationPoliciesData);
                
            
            
                
                await PromptTemplates.bulkCreate(PromptTemplatesData);
                
            
            
                
                await Chats.bulkCreate(ChatsData);
                
            
            
                
                await ChatMessages.bulkCreate(ChatMessagesData);
                
            
            
                
                await EncryptionSessions.bulkCreate(EncryptionSessionsData);
                
            
            
                
                await CodeRepositories.bulkCreate(CodeRepositoriesData);
                
            
            
                
                await CodeFiles.bulkCreate(CodeFilesData);
                
            
            
                
                await CodeChangeSets.bulkCreate(CodeChangeSetsData);
                
            
            
                
                await CodePatches.bulkCreate(CodePatchesData);
                
            
            
                
                await BuildJobs.bulkCreate(BuildJobsData);
                
            
            
                
                await BuildPipelines.bulkCreate(BuildPipelinesData);
                
            
            
                
                await BuildArtifacts.bulkCreate(BuildArtifactsData);
                
            
            
                
                await WebSearchQueries.bulkCreate(WebSearchQueriesData);
                
            
            
                
                await WebSearchResults.bulkCreate(WebSearchResultsData);
                
            
            
                
                await SystemHealthChecks.bulkCreate(SystemHealthChecksData);
                
            
            
                
                await AuditEvents.bulkCreate(AuditEventsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithOrganization(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                        
                        await associateOrganizationMembershipWithOrganization(),
                    
                
                    
                        
                        await associateOrganizationMembershipWithUser(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateProjectWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                        
                        await associateWorkspaceWithProject(),
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateWorkspaceWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateLlmProviderWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateLlmModelWithProvider(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLlmModelWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateLlmApiKeyWithProvider(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateLlmApiKeyWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateKeyRotationPolicyWithProvider(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateKeyRotationPolicyWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associatePromptTemplateWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateChatWithWorkspace(),
                    
                
                    
                        
                        await associateChatWithUser(),
                    
                
                    
                
                    
                
                    
                        
                        await associateChatWithModel(),
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateChatWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateChatMessageWithChat(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateChatMessageWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateEncryptionSessionWithChat(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateEncryptionSessionWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCodeRepositoryWithWorkspace(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateCodeRepositoryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCodeFileWithRepository(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCodeFileWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCodeChangeSetWithWorkspace(),
                    
                
                    
                        
                        await associateCodeChangeSetWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateCodeChangeSetWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateCodePatcheWithChange_set(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateCodePatcheWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBuildJobWithWorkspace(),
                    
                
                    
                        
                        await associateBuildJobWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateBuildJobWithPipeline(),
                    
                
                    
                        
                        await associateBuildJobWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateBuildPipelineWithOrganization(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
            
                
                
                    
                        
                        await associateBuildArtifactWithBuild_job(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBuildArtifactWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWebSearchQueryWithWorkspace(),
                    
                
                    
                        
                        await associateWebSearchQueryWithUser(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateWebSearchQueryWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateWebSearchResultWithQuery(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateWebSearchResultWithOrganization(),
                    
                
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateSystemHealthCheckWithOrganization(),
                    
                
            
                
                
                    
                        
                        await associateAuditEventWithOrganization(),
                    
                
                    
                        
                        await associateAuditEventWithActor(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('organizations', null, {});
            
            
            await queryInterface.bulkDelete('organization_memberships', null, {});
            
            
            await queryInterface.bulkDelete('projects', null, {});
            
            
            await queryInterface.bulkDelete('workspaces', null, {});
            
            
            await queryInterface.bulkDelete('llm_providers', null, {});
            
            
            await queryInterface.bulkDelete('llm_models', null, {});
            
            
            await queryInterface.bulkDelete('llm_api_keys', null, {});
            
            
            await queryInterface.bulkDelete('key_rotation_policies', null, {});
            
            
            await queryInterface.bulkDelete('prompt_templates', null, {});
            
            
            await queryInterface.bulkDelete('chats', null, {});
            
            
            await queryInterface.bulkDelete('chat_messages', null, {});
            
            
            await queryInterface.bulkDelete('encryption_sessions', null, {});
            
            
            await queryInterface.bulkDelete('code_repositories', null, {});
            
            
            await queryInterface.bulkDelete('code_files', null, {});
            
            
            await queryInterface.bulkDelete('code_change_sets', null, {});
            
            
            await queryInterface.bulkDelete('code_patches', null, {});
            
            
            await queryInterface.bulkDelete('build_jobs', null, {});
            
            
            await queryInterface.bulkDelete('build_pipelines', null, {});
            
            
            await queryInterface.bulkDelete('build_artifacts', null, {});
            
            
            await queryInterface.bulkDelete('web_search_queries', null, {});
            
            
            await queryInterface.bulkDelete('web_search_results', null, {});
            
            
            await queryInterface.bulkDelete('system_health_checks', null, {});
            
            
            await queryInterface.bulkDelete('audit_events', null, {});
            
        
    },
};