





















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






const Schools = db.schools;

const AcademicYears = db.academic_years;

const EducationLevels = db.education_levels;

const Classes = db.classes;

const Students = db.students;

const ParentStudentLinks = db.parent_student_links;

const Subjects = db.subjects;

const ClassSubjects = db.class_subjects;

const TimetableEntries = db.timetable_entries;

const AttendanceSessions = db.attendance_sessions;

const AttendanceRecords = db.attendance_records;

const Announcements = db.announcements;

const Assignments = db.assignments;

const AssignmentSubmissions = db.assignment_submissions;

const ExamCategories = db.exam_categories;

const Exams = db.exams;

const ExamQuestions = db.exam_questions;

const ExamQuestionChoices = db.exam_question_choices;

const ExamAttempts = db.exam_attempts;

const ExamAnswers = db.exam_answers;

const FeeDefinitions = db.fee_definitions;

const BillingItems = db.billing_items;

const Payments = db.payments;

const NotificationLogs = db.notification_logs;







const SchoolsData = [
    
    {
    
        
        
            
                "name": "Grace Hopper",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
    },
    
    {
    
        
        
            
                "name": "Marie Curie",
            
        
    
    },
    
];



const AcademicYearsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "start_date": new Date(Date.now()),
            
        
    
        
        
            
                "end_date": new Date(Date.now()),
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
];



const EducationLevelsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "smp",
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "grade_start": 4,
            
        
    
        
        
            
                "grade_end": 5,
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "sd",
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "grade_start": 8,
            
        
    
        
        
            
                "grade_end": 4,
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "level": "sd",
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "grade_start": 1,
            
        
    
        
        
            
                "grade_end": 5,
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
];



const ClassesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "grade": 6,
            
        
    
        
        
            
                "homeroom_label": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "grade": 7,
            
        
    
        
        
            
                "homeroom_label": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "grade": 7,
            
        
    
        
        
            
                "homeroom_label": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
];



const StudentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "nis": "Marie Curie",
            
        
    
        
        
            
                "nisn": "Ada Lovelace",
            
        
    
        
        
            
                "birth_place": "Marie Curie",
            
        
    
        
        
            
                "birth_date": new Date(Date.now()),
            
        
    
        
        
            
                "gender": "perempuan",
            
        
    
        
        
            
                "address": "Alan Turing",
            
        
    
        
        
            
                "enrollment_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "nonaktif",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "nis": "Marie Curie",
            
        
    
        
        
            
                "nisn": "Ada Lovelace",
            
        
    
        
        
            
                "birth_place": "Marie Curie",
            
        
    
        
        
            
                "birth_date": new Date(Date.now()),
            
        
    
        
        
            
                "gender": "laki_laki",
            
        
    
        
        
            
                "address": "Marie Curie",
            
        
    
        
        
            
                "enrollment_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "aktif",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "nis": "Marie Curie",
            
        
    
        
        
            
                "nisn": "Grace Hopper",
            
        
    
        
        
            
                "birth_place": "Marie Curie",
            
        
    
        
        
            
                "birth_date": new Date(Date.now()),
            
        
    
        
        
            
                "gender": "laki_laki",
            
        
    
        
        
            
                "address": "Ada Lovelace",
            
        
    
        
        
            
                "enrollment_date": new Date(Date.now()),
            
        
    
        
        
            
                "status": "pindah",
            
        
    
    },
    
];



const ParentStudentLinksData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "relationship": "ibu",
            
        
    
        
        
            
                "is_primary": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "relationship": "wali",
            
        
    
        
        
            
                "is_primary": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "relationship": "wali",
            
        
    
        
        
            
                "is_primary": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const SubjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                "code": "Ada Lovelace",
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "code": "Ada Lovelace",
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Ada Lovelace",
            
        
    
        
        
            
                "code": "Grace Hopper",
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
];



const ClassSubjectsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "weekly_sessions": 5,
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "weekly_sessions": 6,
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                // 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
            
        
    
        
        
            
                "weekly_sessions": 2,
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const TimetableEntriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "day_of_week": "senin",
            
        
    
        
        
            
                "period_number": 7,
            
        
    
        
        
            
                "start_time": "Ada Lovelace",
            
        
    
        
        
            
                "end_time": "Grace Hopper",
            
        
    
        
        
            
                "room": "Grace Hopper",
            
        
    
        
        
            
                "active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "day_of_week": "rabu",
            
        
    
        
        
            
                "period_number": 7,
            
        
    
        
        
            
                "start_time": "Marie Curie",
            
        
    
        
        
            
                "end_time": "Alan Turing",
            
        
    
        
        
            
                "room": "Alan Turing",
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "day_of_week": "sabtu",
            
        
    
        
        
            
                "period_number": 8,
            
        
    
        
        
            
                "start_time": "Marie Curie",
            
        
    
        
        
            
                "end_time": "Alan Turing",
            
        
    
        
        
            
                "room": "Ada Lovelace",
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AttendanceSessionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attendance_date": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attendance_date": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "attendance_date": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AttendanceRecordsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "izin",
            
        
    
        
        
            
                "remarks": "Marie Curie",
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "sakit",
            
        
    
        
        
            
                "remarks": "Ada Lovelace",
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "status": "izin",
            
        
    
        
        
            
                "remarks": "Ada Lovelace",
            
        
    
        
        
            
                "checked_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AnnouncementsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "content": "Marie Curie",
            
        
    
        
        
            
                "audience": "kelas_tertentu",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "publish_at": new Date(Date.now()),
            
        
    
        
        
            
                "expire_at": new Date(Date.now()),
            
        
    
        
        
            
                "pinned": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "content": "Alan Turing",
            
        
    
        
        
            
                "audience": "guru",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "publish_at": new Date(Date.now()),
            
        
    
        
        
            
                "expire_at": new Date(Date.now()),
            
        
    
        
        
            
                "pinned": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "content": "Ada Lovelace",
            
        
    
        
        
            
                "audience": "orang_tua",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "publish_at": new Date(Date.now()),
            
        
    
        
        
            
                "expire_at": new Date(Date.now()),
            
        
    
        
        
            
                "pinned": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
    },
    
];



const AssignmentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "assigned_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "submission_type": "online",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "published": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "assigned_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "submission_type": "offline",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "published": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Alan Turing",
            
        
    
        
        
            
                "description": "Marie Curie",
            
        
    
        
        
            
                "assigned_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "submission_type": "offline",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "published": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const AssignmentSubmissionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "sudah",
            
        
    
        
        
            
                "answer_text": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "score": 8.25,
            
        
    
        
        
            
                "teacher_feedback": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "graded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "belum",
            
        
    
        
        
            
                "answer_text": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "score": 2.99,
            
        
    
        
        
            
                "teacher_feedback": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "graded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "terlambat",
            
        
    
        
        
            
                "answer_text": "Alan Turing",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "score": 6.49,
            
        
    
        
        
            
                "teacher_feedback": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "graded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExamCategoriesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "type": "lainnya",
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                "type": "lainnya",
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "name": "Grace Hopper",
            
        
    
        
        
            
                "type": "uas",
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
];



const ExamsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "mode": "paper",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "duration_minutes": 9,
            
        
    
        
        
            
                "randomize_questions": false,
            
        
    
        
        
            
                "passing_score": 9.41,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "published": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "mode": "paper",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "duration_minutes": 1,
            
        
    
        
        
            
                "randomize_questions": true,
            
        
    
        
        
            
                "passing_score": 2.25,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "published": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "title": "Marie Curie",
            
        
    
        
        
            
                "mode": "paper",
            
        
    
        
        
            
                "start_at": new Date(Date.now()),
            
        
    
        
        
            
                "end_at": new Date(Date.now()),
            
        
    
        
        
            
                "duration_minutes": 5,
            
        
    
        
        
            
                "randomize_questions": false,
            
        
    
        
        
            
                "passing_score": 5.01,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "published": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExamQuestionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "question_type": "pilihan_ganda",
            
        
    
        
        
            
                "question_text": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "points": 7.09,
            
        
    
        
        
            
                "order_number": 7,
            
        
    
        
        
            
                "active": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "question_type": "pilihan_ganda",
            
        
    
        
        
            
                "question_text": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "points": 4.87,
            
        
    
        
        
            
                "order_number": 7,
            
        
    
        
        
            
                "active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "question_type": "pilihan_ganda",
            
        
    
        
        
            
                "question_text": "Marie Curie",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "points": 0.69,
            
        
    
        
        
            
                "order_number": 8,
            
        
    
        
        
            
                "active": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExamQuestionChoicesData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "choice_label": "Marie Curie",
            
        
    
        
        
            
                "choice_text": "Ada Lovelace",
            
        
    
        
        
            
                "is_correct": false,
            
        
    
        
        
            
                "order_number": 1,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "choice_label": "Grace Hopper",
            
        
    
        
        
            
                "choice_text": "Marie Curie",
            
        
    
        
        
            
                "is_correct": true,
            
        
    
        
        
            
                "order_number": 4,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "choice_label": "Ada Lovelace",
            
        
    
        
        
            
                "choice_text": "Ada Lovelace",
            
        
    
        
        
            
                "is_correct": false,
            
        
    
        
        
            
                "order_number": 2,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExamAttemptsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "selesai",
            
        
    
        
        
            
                "score_total": 3.87,
            
        
    
        
        
            
                "passed": true,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "selesai",
            
        
    
        
        
            
                "score_total": 9.68,
            
        
    
        
        
            
                "passed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "started_at": new Date(Date.now()),
            
        
    
        
        
            
                "submitted_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "belum_mulai",
            
        
    
        
        
            
                "score_total": 0.28,
            
        
    
        
        
            
                "passed": false,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const ExamAnswersData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "answer_text": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 0.01,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "graded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "answer_text": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 9.48,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "graded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "answer_text": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "score": 6.42,
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "graded_at": new Date(Date.now()),
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const FeeDefinitionsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "fee_type": "spp_bulanan",
            
        
    
        
        
            
                "name": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "amount": 9.56,
            
        
    
        
        
            
                "allow_installments": false,
            
        
    
        
        
            
                "minimum_down_payment": 7.85,
            
        
    
        
        
            
                "max_installments": 9,
            
        
    
        
        
            
                "installment_deadline": new Date(Date.now()),
            
        
    
        
        
            
                "active": false,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "fee_type": "pendaftaran",
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "amount": 9.79,
            
        
    
        
        
            
                "allow_installments": false,
            
        
    
        
        
            
                "minimum_down_payment": 6.31,
            
        
    
        
        
            
                "max_installments": 5,
            
        
    
        
        
            
                "installment_deadline": new Date(Date.now()),
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "fee_type": "spp_bulanan",
            
        
    
        
        
            
                "name": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "amount": 2.58,
            
        
    
        
        
            
                "allow_installments": false,
            
        
    
        
        
            
                "minimum_down_payment": 6.88,
            
        
    
        
        
            
                "max_installments": 9,
            
        
    
        
        
            
                "installment_deadline": new Date(Date.now()),
            
        
    
        
        
            
                "active": true,
            
        
    
    },
    
];



const BillingItemsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bill_number": "Grace Hopper",
            
        
    
        
        
            
                "period_type": "sekali",
            
        
    
        
        
            
                "period_year": 7,
            
        
    
        
        
            
                "period_month": 4,
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount_total": 2.45,
            
        
    
        
        
            
                "amount_paid": 5.42,
            
        
    
        
        
            
                "status": "dibatalkan",
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bill_number": "Grace Hopper",
            
        
    
        
        
            
                "period_type": "sekali",
            
        
    
        
        
            
                "period_year": 4,
            
        
    
        
        
            
                "period_month": 2,
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount_total": 0.42,
            
        
    
        
        
            
                "amount_paid": 3.89,
            
        
    
        
        
            
                "status": "jatuh_tempo",
            
        
    
        
        
            
                "notes": "Marie Curie",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "bill_number": "Marie Curie",
            
        
    
        
        
            
                "period_type": "sekali",
            
        
    
        
        
            
                "period_year": 1,
            
        
    
        
        
            
                "period_month": 9,
            
        
    
        
        
            
                "issued_at": new Date(Date.now()),
            
        
    
        
        
            
                "due_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount_total": 5.9,
            
        
    
        
        
            
                "amount_paid": 0.42,
            
        
    
        
        
            
                "status": "cicilan",
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const PaymentsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 8.78,
            
        
    
        
        
            
                "method": "va",
            
        
    
        
        
            
                "reference_number": "Marie Curie",
            
        
    
        
        
            
                "status": "refunded",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Alan Turing",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 4.3,
            
        
    
        
        
            
                "method": "cash",
            
        
    
        
        
            
                "reference_number": "Ada Lovelace",
            
        
    
        
        
            
                "status": "refunded",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Grace Hopper",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "paid_at": new Date(Date.now()),
            
        
    
        
        
            
                "amount": 4.08,
            
        
    
        
        
            
                "method": "cash",
            
        
    
        
        
            
                "reference_number": "Grace Hopper",
            
        
    
        
        
            
                "status": "pending",
            
        
    
        
        
            
                // type code here for "files" field
            
        
    
        
        
            
                "notes": "Ada Lovelace",
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
    },
    
];



const NotificationLogsData = [
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "in_app",
            
        
    
        
        
            
                "category": "absensi",
            
        
    
        
        
            
                "title": "Ada Lovelace",
            
        
    
        
        
            
                "message": "Alan Turing",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "queued",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "whatsapp",
            
        
    
        
        
            
                "category": "tagihan",
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "message": "Alan Turing",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "sent",
            
        
    
    },
    
    {
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                // type code here for "relation_one" field
            
        
    
        
        
            
                "channel": "sms",
            
        
    
        
        
            
                "category": "tagihan",
            
        
    
        
        
            
                "title": "Grace Hopper",
            
        
    
        
        
            
                "message": "Alan Turing",
            
        
    
        
        
            
                "sent_at": new Date(Date.now()),
            
        
    
        
        
            
                "status": "read",
            
        
    
    },
    
];




    
    
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            // Similar logic for "relation_many"
        
    
        
            
            async function associateUserWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const User0 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (User0?.setSchool)
                {
                    await
                    User0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const User1 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (User1?.setSchool)
                {
                    await
                    User1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const User2 = await Users.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (User2?.setSchool)
                {
                    await
                    User2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
    
    
        
    

    
    
    
        
            
            async function associateAcademicYearWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AcademicYear0 = await AcademicYears.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AcademicYear0?.setSchool)
                {
                    await
                    AcademicYear0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AcademicYear1 = await AcademicYears.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AcademicYear1?.setSchool)
                {
                    await
                    AcademicYear1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AcademicYear2 = await AcademicYears.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AcademicYear2?.setSchool)
                {
                    await
                    AcademicYear2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateEducationLevelWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const EducationLevel0 = await EducationLevels.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (EducationLevel0?.setSchool)
                {
                    await
                    EducationLevel0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const EducationLevel1 = await EducationLevels.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (EducationLevel1?.setSchool)
                {
                    await
                    EducationLevel1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const EducationLevel2 = await EducationLevels.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (EducationLevel2?.setSchool)
                {
                    await
                    EducationLevel2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateClassWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setSchool)
                {
                    await
                    Class0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setSchool)
                {
                    await
                    Class1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setSchool)
                {
                    await
                    Class2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
            
            async function associateClassWithAcademic_year() {
            
                const relatedAcademic_year0 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setAcademic_year)
                {
                    await
                    Class0.
                    setAcademic_year(relatedAcademic_year0);
                }
            
                const relatedAcademic_year1 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setAcademic_year)
                {
                    await
                    Class1.
                    setAcademic_year(relatedAcademic_year1);
                }
            
                const relatedAcademic_year2 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setAcademic_year)
                {
                    await
                    Class2.
                    setAcademic_year(relatedAcademic_year2);
                }
            
        }
        
    
        
            
            async function associateClassWithEducation_level() {
            
                const relatedEducation_level0 = await EducationLevels.findOne({
                    offset: Math.floor(Math.random() * (await EducationLevels.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setEducation_level)
                {
                    await
                    Class0.
                    setEducation_level(relatedEducation_level0);
                }
            
                const relatedEducation_level1 = await EducationLevels.findOne({
                    offset: Math.floor(Math.random() * (await EducationLevels.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setEducation_level)
                {
                    await
                    Class1.
                    setEducation_level(relatedEducation_level1);
                }
            
                const relatedEducation_level2 = await EducationLevels.findOne({
                    offset: Math.floor(Math.random() * (await EducationLevels.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setEducation_level)
                {
                    await
                    Class2.
                    setEducation_level(relatedEducation_level2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateClassWithHomeroom_teacher() {
            
                const relatedHomeroom_teacher0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Class0 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Class0?.setHomeroom_teacher)
                {
                    await
                    Class0.
                    setHomeroom_teacher(relatedHomeroom_teacher0);
                }
            
                const relatedHomeroom_teacher1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Class1 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Class1?.setHomeroom_teacher)
                {
                    await
                    Class1.
                    setHomeroom_teacher(relatedHomeroom_teacher1);
                }
            
                const relatedHomeroom_teacher2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Class2 = await Classes.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Class2?.setHomeroom_teacher)
                {
                    await
                    Class2.
                    setHomeroom_teacher(relatedHomeroom_teacher2);
                }
            
        }
        
    
        
    

    
    
    
        
            
            async function associateStudentWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Student0 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Student0?.setSchool)
                {
                    await
                    Student0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Student1 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Student1?.setSchool)
                {
                    await
                    Student1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Student2 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Student2?.setSchool)
                {
                    await
                    Student2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
            
            async function associateStudentWithUser() {
            
                const relatedUser0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Student0 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Student0?.setUser)
                {
                    await
                    Student0.
                    setUser(relatedUser0);
                }
            
                const relatedUser1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Student1 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Student1?.setUser)
                {
                    await
                    Student1.
                    setUser(relatedUser1);
                }
            
                const relatedUser2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Student2 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Student2?.setUser)
                {
                    await
                    Student2.
                    setUser(relatedUser2);
                }
            
        }
        
    
        
            
            async function associateStudentWithCurrent_clas() {
            
                const relatedCurrent_clas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const Student0 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Student0?.setCurrent_clas)
                {
                    await
                    Student0.
                    setCurrent_clas(relatedCurrent_clas0);
                }
            
                const relatedCurrent_clas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const Student1 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Student1?.setCurrent_clas)
                {
                    await
                    Student1.
                    setCurrent_clas(relatedCurrent_clas1);
                }
            
                const relatedCurrent_clas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const Student2 = await Students.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Student2?.setCurrent_clas)
                {
                    await
                    Student2.
                    setCurrent_clas(relatedCurrent_clas2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateParentStudentLinkWithParent_user() {
            
                const relatedParent_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ParentStudentLink0 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ParentStudentLink0?.setParent_user)
                {
                    await
                    ParentStudentLink0.
                    setParent_user(relatedParent_user0);
                }
            
                const relatedParent_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ParentStudentLink1 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ParentStudentLink1?.setParent_user)
                {
                    await
                    ParentStudentLink1.
                    setParent_user(relatedParent_user1);
                }
            
                const relatedParent_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ParentStudentLink2 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ParentStudentLink2?.setParent_user)
                {
                    await
                    ParentStudentLink2.
                    setParent_user(relatedParent_user2);
                }
            
        }
        
    
        
            
            async function associateParentStudentLinkWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ParentStudentLink0 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ParentStudentLink0?.setStudent)
                {
                    await
                    ParentStudentLink0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ParentStudentLink1 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ParentStudentLink1?.setStudent)
                {
                    await
                    ParentStudentLink1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ParentStudentLink2 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ParentStudentLink2?.setStudent)
                {
                    await
                    ParentStudentLink2.
                    setStudent(relatedStudent2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateParentStudentLinkWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ParentStudentLink0 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ParentStudentLink0?.setSchool)
                {
                    await
                    ParentStudentLink0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ParentStudentLink1 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ParentStudentLink1?.setSchool)
                {
                    await
                    ParentStudentLink1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ParentStudentLink2 = await ParentStudentLinks.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ParentStudentLink2?.setSchool)
                {
                    await
                    ParentStudentLink2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateSubjectWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Subject0 = await Subjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Subject0?.setSchool)
                {
                    await
                    Subject0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Subject1 = await Subjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Subject1?.setSchool)
                {
                    await
                    Subject1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Subject2 = await Subjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Subject2?.setSchool)
                {
                    await
                    Subject2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateClassSubjectWithClas() {
            
                const relatedClas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setClas)
                {
                    await
                    ClassSubject0.
                    setClas(relatedClas0);
                }
            
                const relatedClas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setClas)
                {
                    await
                    ClassSubject1.
                    setClas(relatedClas1);
                }
            
                const relatedClas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setClas)
                {
                    await
                    ClassSubject2.
                    setClas(relatedClas2);
                }
            
        }
        
    
        
            
            async function associateClassSubjectWithSubject() {
            
                const relatedSubject0 = await Subjects.findOne({
                    offset: Math.floor(Math.random() * (await Subjects.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setSubject)
                {
                    await
                    ClassSubject0.
                    setSubject(relatedSubject0);
                }
            
                const relatedSubject1 = await Subjects.findOne({
                    offset: Math.floor(Math.random() * (await Subjects.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setSubject)
                {
                    await
                    ClassSubject1.
                    setSubject(relatedSubject1);
                }
            
                const relatedSubject2 = await Subjects.findOne({
                    offset: Math.floor(Math.random() * (await Subjects.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setSubject)
                {
                    await
                    ClassSubject2.
                    setSubject(relatedSubject2);
                }
            
        }
        
    
        
            
            async function associateClassSubjectWithTeacher() {
            
                const relatedTeacher0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setTeacher)
                {
                    await
                    ClassSubject0.
                    setTeacher(relatedTeacher0);
                }
            
                const relatedTeacher1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setTeacher)
                {
                    await
                    ClassSubject1.
                    setTeacher(relatedTeacher1);
                }
            
                const relatedTeacher2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setTeacher)
                {
                    await
                    ClassSubject2.
                    setTeacher(relatedTeacher2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateClassSubjectWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ClassSubject0 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ClassSubject0?.setSchool)
                {
                    await
                    ClassSubject0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ClassSubject1 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ClassSubject1?.setSchool)
                {
                    await
                    ClassSubject1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ClassSubject2 = await ClassSubjects.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ClassSubject2?.setSchool)
                {
                    await
                    ClassSubject2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateTimetableEntryWithClas() {
            
                const relatedClas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const TimetableEntry0 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimetableEntry0?.setClas)
                {
                    await
                    TimetableEntry0.
                    setClas(relatedClas0);
                }
            
                const relatedClas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const TimetableEntry1 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimetableEntry1?.setClas)
                {
                    await
                    TimetableEntry1.
                    setClas(relatedClas1);
                }
            
                const relatedClas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const TimetableEntry2 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimetableEntry2?.setClas)
                {
                    await
                    TimetableEntry2.
                    setClas(relatedClas2);
                }
            
        }
        
    
        
            
            async function associateTimetableEntryWithClass_subject() {
            
                const relatedClass_subject0 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const TimetableEntry0 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimetableEntry0?.setClass_subject)
                {
                    await
                    TimetableEntry0.
                    setClass_subject(relatedClass_subject0);
                }
            
                const relatedClass_subject1 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const TimetableEntry1 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimetableEntry1?.setClass_subject)
                {
                    await
                    TimetableEntry1.
                    setClass_subject(relatedClass_subject1);
                }
            
                const relatedClass_subject2 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const TimetableEntry2 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimetableEntry2?.setClass_subject)
                {
                    await
                    TimetableEntry2.
                    setClass_subject(relatedClass_subject2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateTimetableEntryWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const TimetableEntry0 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (TimetableEntry0?.setSchool)
                {
                    await
                    TimetableEntry0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const TimetableEntry1 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (TimetableEntry1?.setSchool)
                {
                    await
                    TimetableEntry1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const TimetableEntry2 = await TimetableEntries.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (TimetableEntry2?.setSchool)
                {
                    await
                    TimetableEntry2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAttendanceSessionWithClas() {
            
                const relatedClas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setClas)
                {
                    await
                    AttendanceSession0.
                    setClas(relatedClas0);
                }
            
                const relatedClas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setClas)
                {
                    await
                    AttendanceSession1.
                    setClas(relatedClas1);
                }
            
                const relatedClas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setClas)
                {
                    await
                    AttendanceSession2.
                    setClas(relatedClas2);
                }
            
        }
        
    
        
    
        
            
            async function associateAttendanceSessionWithRecorded_by() {
            
                const relatedRecorded_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setRecorded_by)
                {
                    await
                    AttendanceSession0.
                    setRecorded_by(relatedRecorded_by0);
                }
            
                const relatedRecorded_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setRecorded_by)
                {
                    await
                    AttendanceSession1.
                    setRecorded_by(relatedRecorded_by1);
                }
            
                const relatedRecorded_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setRecorded_by)
                {
                    await
                    AttendanceSession2.
                    setRecorded_by(relatedRecorded_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateAttendanceSessionWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AttendanceSession0 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceSession0?.setSchool)
                {
                    await
                    AttendanceSession0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AttendanceSession1 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceSession1?.setSchool)
                {
                    await
                    AttendanceSession1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AttendanceSession2 = await AttendanceSessions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceSession2?.setSchool)
                {
                    await
                    AttendanceSession2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAttendanceRecordWithAttendance_session() {
            
                const relatedAttendance_session0 = await AttendanceSessions.findOne({
                    offset: Math.floor(Math.random() * (await AttendanceSessions.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setAttendance_session)
                {
                    await
                    AttendanceRecord0.
                    setAttendance_session(relatedAttendance_session0);
                }
            
                const relatedAttendance_session1 = await AttendanceSessions.findOne({
                    offset: Math.floor(Math.random() * (await AttendanceSessions.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setAttendance_session)
                {
                    await
                    AttendanceRecord1.
                    setAttendance_session(relatedAttendance_session1);
                }
            
                const relatedAttendance_session2 = await AttendanceSessions.findOne({
                    offset: Math.floor(Math.random() * (await AttendanceSessions.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setAttendance_session)
                {
                    await
                    AttendanceRecord2.
                    setAttendance_session(relatedAttendance_session2);
                }
            
        }
        
    
        
            
            async function associateAttendanceRecordWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setStudent)
                {
                    await
                    AttendanceRecord0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setStudent)
                {
                    await
                    AttendanceRecord1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setStudent)
                {
                    await
                    AttendanceRecord2.
                    setStudent(relatedStudent2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateAttendanceRecordWithChecked_by() {
            
                const relatedChecked_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setChecked_by)
                {
                    await
                    AttendanceRecord0.
                    setChecked_by(relatedChecked_by0);
                }
            
                const relatedChecked_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setChecked_by)
                {
                    await
                    AttendanceRecord1.
                    setChecked_by(relatedChecked_by1);
                }
            
                const relatedChecked_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setChecked_by)
                {
                    await
                    AttendanceRecord2.
                    setChecked_by(relatedChecked_by2);
                }
            
        }
        
    
        
            
            async function associateAttendanceRecordWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AttendanceRecord0 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AttendanceRecord0?.setSchool)
                {
                    await
                    AttendanceRecord0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AttendanceRecord1 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AttendanceRecord1?.setSchool)
                {
                    await
                    AttendanceRecord1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AttendanceRecord2 = await AttendanceRecords.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AttendanceRecord2?.setSchool)
                {
                    await
                    AttendanceRecord2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAnnouncementWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Announcement0 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Announcement0?.setSchool)
                {
                    await
                    Announcement0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Announcement1 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Announcement1?.setSchool)
                {
                    await
                    Announcement1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Announcement2 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Announcement2?.setSchool)
                {
                    await
                    Announcement2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateAnnouncementWithTarget_clas() {
            
                const relatedTarget_clas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const Announcement0 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Announcement0?.setTarget_clas)
                {
                    await
                    Announcement0.
                    setTarget_clas(relatedTarget_clas0);
                }
            
                const relatedTarget_clas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const Announcement1 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Announcement1?.setTarget_clas)
                {
                    await
                    Announcement1.
                    setTarget_clas(relatedTarget_clas1);
                }
            
                const relatedTarget_clas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const Announcement2 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Announcement2?.setTarget_clas)
                {
                    await
                    Announcement2.
                    setTarget_clas(relatedTarget_clas2);
                }
            
        }
        
    
        
    
        
    
        
    
        
            
            async function associateAnnouncementWithAuthor() {
            
                const relatedAuthor0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Announcement0 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Announcement0?.setAuthor)
                {
                    await
                    Announcement0.
                    setAuthor(relatedAuthor0);
                }
            
                const relatedAuthor1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Announcement1 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Announcement1?.setAuthor)
                {
                    await
                    Announcement1.
                    setAuthor(relatedAuthor1);
                }
            
                const relatedAuthor2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Announcement2 = await Announcements.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Announcement2?.setAuthor)
                {
                    await
                    Announcement2.
                    setAuthor(relatedAuthor2);
                }
            
        }
        
    
        
    

    
    
    
        
            
            async function associateAssignmentWithClass_subject() {
            
                const relatedClass_subject0 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Assignment0 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Assignment0?.setClass_subject)
                {
                    await
                    Assignment0.
                    setClass_subject(relatedClass_subject0);
                }
            
                const relatedClass_subject1 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Assignment1 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Assignment1?.setClass_subject)
                {
                    await
                    Assignment1.
                    setClass_subject(relatedClass_subject1);
                }
            
                const relatedClass_subject2 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Assignment2 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Assignment2?.setClass_subject)
                {
                    await
                    Assignment2.
                    setClass_subject(relatedClass_subject2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAssignmentWithCreated_by() {
            
                const relatedCreated_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Assignment0 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Assignment0?.setCreated_by)
                {
                    await
                    Assignment0.
                    setCreated_by(relatedCreated_by0);
                }
            
                const relatedCreated_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Assignment1 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Assignment1?.setCreated_by)
                {
                    await
                    Assignment1.
                    setCreated_by(relatedCreated_by1);
                }
            
                const relatedCreated_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Assignment2 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Assignment2?.setCreated_by)
                {
                    await
                    Assignment2.
                    setCreated_by(relatedCreated_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateAssignmentWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Assignment0 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Assignment0?.setSchool)
                {
                    await
                    Assignment0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Assignment1 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Assignment1?.setSchool)
                {
                    await
                    Assignment1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Assignment2 = await Assignments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Assignment2?.setSchool)
                {
                    await
                    Assignment2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateAssignmentSubmissionWithAssignment() {
            
                const relatedAssignment0 = await Assignments.findOne({
                    offset: Math.floor(Math.random() * (await Assignments.count())),
                });
                const AssignmentSubmission0 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AssignmentSubmission0?.setAssignment)
                {
                    await
                    AssignmentSubmission0.
                    setAssignment(relatedAssignment0);
                }
            
                const relatedAssignment1 = await Assignments.findOne({
                    offset: Math.floor(Math.random() * (await Assignments.count())),
                });
                const AssignmentSubmission1 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AssignmentSubmission1?.setAssignment)
                {
                    await
                    AssignmentSubmission1.
                    setAssignment(relatedAssignment1);
                }
            
                const relatedAssignment2 = await Assignments.findOne({
                    offset: Math.floor(Math.random() * (await Assignments.count())),
                });
                const AssignmentSubmission2 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AssignmentSubmission2?.setAssignment)
                {
                    await
                    AssignmentSubmission2.
                    setAssignment(relatedAssignment2);
                }
            
        }
        
    
        
            
            async function associateAssignmentSubmissionWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AssignmentSubmission0 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AssignmentSubmission0?.setStudent)
                {
                    await
                    AssignmentSubmission0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AssignmentSubmission1 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AssignmentSubmission1?.setStudent)
                {
                    await
                    AssignmentSubmission1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const AssignmentSubmission2 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AssignmentSubmission2?.setStudent)
                {
                    await
                    AssignmentSubmission2.
                    setStudent(relatedStudent2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateAssignmentSubmissionWithGraded_by() {
            
                const relatedGraded_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AssignmentSubmission0 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AssignmentSubmission0?.setGraded_by)
                {
                    await
                    AssignmentSubmission0.
                    setGraded_by(relatedGraded_by0);
                }
            
                const relatedGraded_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AssignmentSubmission1 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AssignmentSubmission1?.setGraded_by)
                {
                    await
                    AssignmentSubmission1.
                    setGraded_by(relatedGraded_by1);
                }
            
                const relatedGraded_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const AssignmentSubmission2 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AssignmentSubmission2?.setGraded_by)
                {
                    await
                    AssignmentSubmission2.
                    setGraded_by(relatedGraded_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateAssignmentSubmissionWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AssignmentSubmission0 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (AssignmentSubmission0?.setSchool)
                {
                    await
                    AssignmentSubmission0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AssignmentSubmission1 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (AssignmentSubmission1?.setSchool)
                {
                    await
                    AssignmentSubmission1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const AssignmentSubmission2 = await AssignmentSubmissions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (AssignmentSubmission2?.setSchool)
                {
                    await
                    AssignmentSubmission2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExamCategoryWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamCategory0 = await ExamCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamCategory0?.setSchool)
                {
                    await
                    ExamCategory0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamCategory1 = await ExamCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamCategory1?.setSchool)
                {
                    await
                    ExamCategory1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamCategory2 = await ExamCategories.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamCategory2?.setSchool)
                {
                    await
                    ExamCategory2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateExamWithClass_subject() {
            
                const relatedClass_subject0 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Exam0 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Exam0?.setClass_subject)
                {
                    await
                    Exam0.
                    setClass_subject(relatedClass_subject0);
                }
            
                const relatedClass_subject1 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Exam1 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Exam1?.setClass_subject)
                {
                    await
                    Exam1.
                    setClass_subject(relatedClass_subject1);
                }
            
                const relatedClass_subject2 = await ClassSubjects.findOne({
                    offset: Math.floor(Math.random() * (await ClassSubjects.count())),
                });
                const Exam2 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Exam2?.setClass_subject)
                {
                    await
                    Exam2.
                    setClass_subject(relatedClass_subject2);
                }
            
        }
        
    
        
            
            async function associateExamWithCategory() {
            
                const relatedCategory0 = await ExamCategories.findOne({
                    offset: Math.floor(Math.random() * (await ExamCategories.count())),
                });
                const Exam0 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Exam0?.setCategory)
                {
                    await
                    Exam0.
                    setCategory(relatedCategory0);
                }
            
                const relatedCategory1 = await ExamCategories.findOne({
                    offset: Math.floor(Math.random() * (await ExamCategories.count())),
                });
                const Exam1 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Exam1?.setCategory)
                {
                    await
                    Exam1.
                    setCategory(relatedCategory1);
                }
            
                const relatedCategory2 = await ExamCategories.findOne({
                    offset: Math.floor(Math.random() * (await ExamCategories.count())),
                });
                const Exam2 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Exam2?.setCategory)
                {
                    await
                    Exam2.
                    setCategory(relatedCategory2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExamWithCreated_by() {
            
                const relatedCreated_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Exam0 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Exam0?.setCreated_by)
                {
                    await
                    Exam0.
                    setCreated_by(relatedCreated_by0);
                }
            
                const relatedCreated_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Exam1 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Exam1?.setCreated_by)
                {
                    await
                    Exam1.
                    setCreated_by(relatedCreated_by1);
                }
            
                const relatedCreated_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Exam2 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Exam2?.setCreated_by)
                {
                    await
                    Exam2.
                    setCreated_by(relatedCreated_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateExamWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Exam0 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Exam0?.setSchool)
                {
                    await
                    Exam0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Exam1 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Exam1?.setSchool)
                {
                    await
                    Exam1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Exam2 = await Exams.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Exam2?.setSchool)
                {
                    await
                    Exam2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExamQuestionWithExam() {
            
                const relatedExam0 = await Exams.findOne({
                    offset: Math.floor(Math.random() * (await Exams.count())),
                });
                const ExamQuestion0 = await ExamQuestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamQuestion0?.setExam)
                {
                    await
                    ExamQuestion0.
                    setExam(relatedExam0);
                }
            
                const relatedExam1 = await Exams.findOne({
                    offset: Math.floor(Math.random() * (await Exams.count())),
                });
                const ExamQuestion1 = await ExamQuestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamQuestion1?.setExam)
                {
                    await
                    ExamQuestion1.
                    setExam(relatedExam1);
                }
            
                const relatedExam2 = await Exams.findOne({
                    offset: Math.floor(Math.random() * (await Exams.count())),
                });
                const ExamQuestion2 = await ExamQuestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamQuestion2?.setExam)
                {
                    await
                    ExamQuestion2.
                    setExam(relatedExam2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExamQuestionWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamQuestion0 = await ExamQuestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamQuestion0?.setSchool)
                {
                    await
                    ExamQuestion0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamQuestion1 = await ExamQuestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamQuestion1?.setSchool)
                {
                    await
                    ExamQuestion1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamQuestion2 = await ExamQuestions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamQuestion2?.setSchool)
                {
                    await
                    ExamQuestion2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExamQuestionChoiceWithExam_question() {
            
                const relatedExam_question0 = await ExamQuestions.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestions.count())),
                });
                const ExamQuestionChoice0 = await ExamQuestionChoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamQuestionChoice0?.setExam_question)
                {
                    await
                    ExamQuestionChoice0.
                    setExam_question(relatedExam_question0);
                }
            
                const relatedExam_question1 = await ExamQuestions.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestions.count())),
                });
                const ExamQuestionChoice1 = await ExamQuestionChoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamQuestionChoice1?.setExam_question)
                {
                    await
                    ExamQuestionChoice1.
                    setExam_question(relatedExam_question1);
                }
            
                const relatedExam_question2 = await ExamQuestions.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestions.count())),
                });
                const ExamQuestionChoice2 = await ExamQuestionChoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamQuestionChoice2?.setExam_question)
                {
                    await
                    ExamQuestionChoice2.
                    setExam_question(relatedExam_question2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExamQuestionChoiceWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamQuestionChoice0 = await ExamQuestionChoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamQuestionChoice0?.setSchool)
                {
                    await
                    ExamQuestionChoice0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamQuestionChoice1 = await ExamQuestionChoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamQuestionChoice1?.setSchool)
                {
                    await
                    ExamQuestionChoice1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamQuestionChoice2 = await ExamQuestionChoices.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamQuestionChoice2?.setSchool)
                {
                    await
                    ExamQuestionChoice2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExamAttemptWithExam() {
            
                const relatedExam0 = await Exams.findOne({
                    offset: Math.floor(Math.random() * (await Exams.count())),
                });
                const ExamAttempt0 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAttempt0?.setExam)
                {
                    await
                    ExamAttempt0.
                    setExam(relatedExam0);
                }
            
                const relatedExam1 = await Exams.findOne({
                    offset: Math.floor(Math.random() * (await Exams.count())),
                });
                const ExamAttempt1 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAttempt1?.setExam)
                {
                    await
                    ExamAttempt1.
                    setExam(relatedExam1);
                }
            
                const relatedExam2 = await Exams.findOne({
                    offset: Math.floor(Math.random() * (await Exams.count())),
                });
                const ExamAttempt2 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAttempt2?.setExam)
                {
                    await
                    ExamAttempt2.
                    setExam(relatedExam2);
                }
            
        }
        
    
        
            
            async function associateExamAttemptWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ExamAttempt0 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAttempt0?.setStudent)
                {
                    await
                    ExamAttempt0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ExamAttempt1 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAttempt1?.setStudent)
                {
                    await
                    ExamAttempt1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const ExamAttempt2 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAttempt2?.setStudent)
                {
                    await
                    ExamAttempt2.
                    setStudent(relatedStudent2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateExamAttemptWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamAttempt0 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAttempt0?.setSchool)
                {
                    await
                    ExamAttempt0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamAttempt1 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAttempt1?.setSchool)
                {
                    await
                    ExamAttempt1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamAttempt2 = await ExamAttempts.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAttempt2?.setSchool)
                {
                    await
                    ExamAttempt2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateExamAnswerWithExam_attempt() {
            
                const relatedExam_attempt0 = await ExamAttempts.findOne({
                    offset: Math.floor(Math.random() * (await ExamAttempts.count())),
                });
                const ExamAnswer0 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAnswer0?.setExam_attempt)
                {
                    await
                    ExamAnswer0.
                    setExam_attempt(relatedExam_attempt0);
                }
            
                const relatedExam_attempt1 = await ExamAttempts.findOne({
                    offset: Math.floor(Math.random() * (await ExamAttempts.count())),
                });
                const ExamAnswer1 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAnswer1?.setExam_attempt)
                {
                    await
                    ExamAnswer1.
                    setExam_attempt(relatedExam_attempt1);
                }
            
                const relatedExam_attempt2 = await ExamAttempts.findOne({
                    offset: Math.floor(Math.random() * (await ExamAttempts.count())),
                });
                const ExamAnswer2 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAnswer2?.setExam_attempt)
                {
                    await
                    ExamAnswer2.
                    setExam_attempt(relatedExam_attempt2);
                }
            
        }
        
    
        
            
            async function associateExamAnswerWithExam_question() {
            
                const relatedExam_question0 = await ExamQuestions.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestions.count())),
                });
                const ExamAnswer0 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAnswer0?.setExam_question)
                {
                    await
                    ExamAnswer0.
                    setExam_question(relatedExam_question0);
                }
            
                const relatedExam_question1 = await ExamQuestions.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestions.count())),
                });
                const ExamAnswer1 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAnswer1?.setExam_question)
                {
                    await
                    ExamAnswer1.
                    setExam_question(relatedExam_question1);
                }
            
                const relatedExam_question2 = await ExamQuestions.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestions.count())),
                });
                const ExamAnswer2 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAnswer2?.setExam_question)
                {
                    await
                    ExamAnswer2.
                    setExam_question(relatedExam_question2);
                }
            
        }
        
    
        
    
        
            
            async function associateExamAnswerWithSelected_choice() {
            
                const relatedSelected_choice0 = await ExamQuestionChoices.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestionChoices.count())),
                });
                const ExamAnswer0 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAnswer0?.setSelected_choice)
                {
                    await
                    ExamAnswer0.
                    setSelected_choice(relatedSelected_choice0);
                }
            
                const relatedSelected_choice1 = await ExamQuestionChoices.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestionChoices.count())),
                });
                const ExamAnswer1 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAnswer1?.setSelected_choice)
                {
                    await
                    ExamAnswer1.
                    setSelected_choice(relatedSelected_choice1);
                }
            
                const relatedSelected_choice2 = await ExamQuestionChoices.findOne({
                    offset: Math.floor(Math.random() * (await ExamQuestionChoices.count())),
                });
                const ExamAnswer2 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAnswer2?.setSelected_choice)
                {
                    await
                    ExamAnswer2.
                    setSelected_choice(relatedSelected_choice2);
                }
            
        }
        
    
        
    
        
            
            async function associateExamAnswerWithGraded_by() {
            
                const relatedGraded_by0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ExamAnswer0 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAnswer0?.setGraded_by)
                {
                    await
                    ExamAnswer0.
                    setGraded_by(relatedGraded_by0);
                }
            
                const relatedGraded_by1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ExamAnswer1 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAnswer1?.setGraded_by)
                {
                    await
                    ExamAnswer1.
                    setGraded_by(relatedGraded_by1);
                }
            
                const relatedGraded_by2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const ExamAnswer2 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAnswer2?.setGraded_by)
                {
                    await
                    ExamAnswer2.
                    setGraded_by(relatedGraded_by2);
                }
            
        }
        
    
        
    
        
            
            async function associateExamAnswerWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamAnswer0 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (ExamAnswer0?.setSchool)
                {
                    await
                    ExamAnswer0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamAnswer1 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (ExamAnswer1?.setSchool)
                {
                    await
                    ExamAnswer1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const ExamAnswer2 = await ExamAnswers.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (ExamAnswer2?.setSchool)
                {
                    await
                    ExamAnswer2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateFeeDefinitionWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const FeeDefinition0 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FeeDefinition0?.setSchool)
                {
                    await
                    FeeDefinition0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const FeeDefinition1 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FeeDefinition1?.setSchool)
                {
                    await
                    FeeDefinition1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const FeeDefinition2 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FeeDefinition2?.setSchool)
                {
                    await
                    FeeDefinition2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
            
            async function associateFeeDefinitionWithAcademic_year() {
            
                const relatedAcademic_year0 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const FeeDefinition0 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FeeDefinition0?.setAcademic_year)
                {
                    await
                    FeeDefinition0.
                    setAcademic_year(relatedAcademic_year0);
                }
            
                const relatedAcademic_year1 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const FeeDefinition1 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FeeDefinition1?.setAcademic_year)
                {
                    await
                    FeeDefinition1.
                    setAcademic_year(relatedAcademic_year1);
                }
            
                const relatedAcademic_year2 = await AcademicYears.findOne({
                    offset: Math.floor(Math.random() * (await AcademicYears.count())),
                });
                const FeeDefinition2 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FeeDefinition2?.setAcademic_year)
                {
                    await
                    FeeDefinition2.
                    setAcademic_year(relatedAcademic_year2);
                }
            
        }
        
    
        
    
        
    
        
            
            async function associateFeeDefinitionWithEducation_level() {
            
                const relatedEducation_level0 = await EducationLevels.findOne({
                    offset: Math.floor(Math.random() * (await EducationLevels.count())),
                });
                const FeeDefinition0 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FeeDefinition0?.setEducation_level)
                {
                    await
                    FeeDefinition0.
                    setEducation_level(relatedEducation_level0);
                }
            
                const relatedEducation_level1 = await EducationLevels.findOne({
                    offset: Math.floor(Math.random() * (await EducationLevels.count())),
                });
                const FeeDefinition1 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FeeDefinition1?.setEducation_level)
                {
                    await
                    FeeDefinition1.
                    setEducation_level(relatedEducation_level1);
                }
            
                const relatedEducation_level2 = await EducationLevels.findOne({
                    offset: Math.floor(Math.random() * (await EducationLevels.count())),
                });
                const FeeDefinition2 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FeeDefinition2?.setEducation_level)
                {
                    await
                    FeeDefinition2.
                    setEducation_level(relatedEducation_level2);
                }
            
        }
        
    
        
            
            async function associateFeeDefinitionWithClas() {
            
                const relatedClas0 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const FeeDefinition0 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (FeeDefinition0?.setClas)
                {
                    await
                    FeeDefinition0.
                    setClas(relatedClas0);
                }
            
                const relatedClas1 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const FeeDefinition1 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (FeeDefinition1?.setClas)
                {
                    await
                    FeeDefinition1.
                    setClas(relatedClas1);
                }
            
                const relatedClas2 = await Classes.findOne({
                    offset: Math.floor(Math.random() * (await Classes.count())),
                });
                const FeeDefinition2 = await FeeDefinitions.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (FeeDefinition2?.setClas)
                {
                    await
                    FeeDefinition2.
                    setClas(relatedClas2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    

    
    
    
        
            
            async function associateBillingItemWithFee_definition() {
            
                const relatedFee_definition0 = await FeeDefinitions.findOne({
                    offset: Math.floor(Math.random() * (await FeeDefinitions.count())),
                });
                const BillingItem0 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillingItem0?.setFee_definition)
                {
                    await
                    BillingItem0.
                    setFee_definition(relatedFee_definition0);
                }
            
                const relatedFee_definition1 = await FeeDefinitions.findOne({
                    offset: Math.floor(Math.random() * (await FeeDefinitions.count())),
                });
                const BillingItem1 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillingItem1?.setFee_definition)
                {
                    await
                    BillingItem1.
                    setFee_definition(relatedFee_definition1);
                }
            
                const relatedFee_definition2 = await FeeDefinitions.findOne({
                    offset: Math.floor(Math.random() * (await FeeDefinitions.count())),
                });
                const BillingItem2 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillingItem2?.setFee_definition)
                {
                    await
                    BillingItem2.
                    setFee_definition(relatedFee_definition2);
                }
            
        }
        
    
        
            
            async function associateBillingItemWithStudent() {
            
                const relatedStudent0 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const BillingItem0 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillingItem0?.setStudent)
                {
                    await
                    BillingItem0.
                    setStudent(relatedStudent0);
                }
            
                const relatedStudent1 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const BillingItem1 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillingItem1?.setStudent)
                {
                    await
                    BillingItem1.
                    setStudent(relatedStudent1);
                }
            
                const relatedStudent2 = await Students.findOne({
                    offset: Math.floor(Math.random() * (await Students.count())),
                });
                const BillingItem2 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillingItem2?.setStudent)
                {
                    await
                    BillingItem2.
                    setStudent(relatedStudent2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associateBillingItemWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const BillingItem0 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (BillingItem0?.setSchool)
                {
                    await
                    BillingItem0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const BillingItem1 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (BillingItem1?.setSchool)
                {
                    await
                    BillingItem1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const BillingItem2 = await BillingItems.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (BillingItem2?.setSchool)
                {
                    await
                    BillingItem2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associatePaymentWithBilling_item() {
            
                const relatedBilling_item0 = await BillingItems.findOne({
                    offset: Math.floor(Math.random() * (await BillingItems.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setBilling_item)
                {
                    await
                    Payment0.
                    setBilling_item(relatedBilling_item0);
                }
            
                const relatedBilling_item1 = await BillingItems.findOne({
                    offset: Math.floor(Math.random() * (await BillingItems.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setBilling_item)
                {
                    await
                    Payment1.
                    setBilling_item(relatedBilling_item1);
                }
            
                const relatedBilling_item2 = await BillingItems.findOne({
                    offset: Math.floor(Math.random() * (await BillingItems.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setBilling_item)
                {
                    await
                    Payment2.
                    setBilling_item(relatedBilling_item2);
                }
            
        }
        
    
        
            
            async function associatePaymentWithPaid_by_user() {
            
                const relatedPaid_by_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setPaid_by_user)
                {
                    await
                    Payment0.
                    setPaid_by_user(relatedPaid_by_user0);
                }
            
                const relatedPaid_by_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setPaid_by_user)
                {
                    await
                    Payment1.
                    setPaid_by_user(relatedPaid_by_user1);
                }
            
                const relatedPaid_by_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setPaid_by_user)
                {
                    await
                    Payment2.
                    setPaid_by_user(relatedPaid_by_user2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
            
            async function associatePaymentWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Payment0 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (Payment0?.setSchool)
                {
                    await
                    Payment0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Payment1 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (Payment1?.setSchool)
                {
                    await
                    Payment1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const Payment2 = await Payments.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (Payment2?.setSchool)
                {
                    await
                    Payment2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    

    
    
    
        
            
            async function associateNotificationLogWithSchool() {
            
                const relatedSchool0 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const NotificationLog0 = await NotificationLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationLog0?.setSchool)
                {
                    await
                    NotificationLog0.
                    setSchool(relatedSchool0);
                }
            
                const relatedSchool1 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const NotificationLog1 = await NotificationLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationLog1?.setSchool)
                {
                    await
                    NotificationLog1.
                    setSchool(relatedSchool1);
                }
            
                const relatedSchool2 = await Schools.findOne({
                    offset: Math.floor(Math.random() * (await Schools.count())),
                });
                const NotificationLog2 = await NotificationLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationLog2?.setSchool)
                {
                    await
                    NotificationLog2.
                    setSchool(relatedSchool2);
                }
            
        }
        
    
        
            
            async function associateNotificationLogWithRecipient_user() {
            
                const relatedRecipient_user0 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationLog0 = await NotificationLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 0
                });
                if (NotificationLog0?.setRecipient_user)
                {
                    await
                    NotificationLog0.
                    setRecipient_user(relatedRecipient_user0);
                }
            
                const relatedRecipient_user1 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationLog1 = await NotificationLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 1
                });
                if (NotificationLog1?.setRecipient_user)
                {
                    await
                    NotificationLog1.
                    setRecipient_user(relatedRecipient_user1);
                }
            
                const relatedRecipient_user2 = await Users.findOne({
                    offset: Math.floor(Math.random() * (await Users.count())),
                });
                const NotificationLog2 = await NotificationLogs.findOne({
                    order: [['id', 'ASC']],
                    offset: 2
                });
                if (NotificationLog2?.setRecipient_user)
                {
                    await
                    NotificationLog2.
                    setRecipient_user(relatedRecipient_user2);
                }
            
        }
        
    
        
    
        
    
        
    
        
    
        
    
        
    


module.exports = {
    up: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
                
                await Schools.bulkCreate(SchoolsData);
                
            
            
                
                await AcademicYears.bulkCreate(AcademicYearsData);
                
            
            
                
                await EducationLevels.bulkCreate(EducationLevelsData);
                
            
            
                
                await Classes.bulkCreate(ClassesData);
                
            
            
                
                await Students.bulkCreate(StudentsData);
                
            
            
                
                await ParentStudentLinks.bulkCreate(ParentStudentLinksData);
                
            
            
                
                await Subjects.bulkCreate(SubjectsData);
                
            
            
                
                await ClassSubjects.bulkCreate(ClassSubjectsData);
                
            
            
                
                await TimetableEntries.bulkCreate(TimetableEntriesData);
                
            
            
                
                await AttendanceSessions.bulkCreate(AttendanceSessionsData);
                
            
            
                
                await AttendanceRecords.bulkCreate(AttendanceRecordsData);
                
            
            
                
                await Announcements.bulkCreate(AnnouncementsData);
                
            
            
                
                await Assignments.bulkCreate(AssignmentsData);
                
            
            
                
                await AssignmentSubmissions.bulkCreate(AssignmentSubmissionsData);
                
            
            
                
                await ExamCategories.bulkCreate(ExamCategoriesData);
                
            
            
                
                await Exams.bulkCreate(ExamsData);
                
            
            
                
                await ExamQuestions.bulkCreate(ExamQuestionsData);
                
            
            
                
                await ExamQuestionChoices.bulkCreate(ExamQuestionChoicesData);
                
            
            
                
                await ExamAttempts.bulkCreate(ExamAttemptsData);
                
            
            
                
                await ExamAnswers.bulkCreate(ExamAnswersData);
                
            
            
                
                await FeeDefinitions.bulkCreate(FeeDefinitionsData);
                
            
            
                
                await BillingItems.bulkCreate(BillingItemsData);
                
            
            
                
                await Payments.bulkCreate(PaymentsData);
                
            
            
                
                await NotificationLogs.bulkCreate(NotificationLogsData);
                
            
            await Promise.all([
            
                
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        // Similar logic for "relation_many"
                    
                
                    
                        
                        await associateUserWithSchool(),
                    
                
            
                
                
                
                
                    
                
            
                
                
                    
                        
                        await associateAcademicYearWithSchool(),
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateEducationLevelWithSchool(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateClassWithSchool(),
                    
                
                    
                        
                        await associateClassWithAcademic_year(),
                    
                
                    
                        
                        await associateClassWithEducation_level(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateClassWithHomeroom_teacher(),
                    
                
                    
                
            
                
                
                    
                        
                        await associateStudentWithSchool(),
                    
                
                    
                        
                        await associateStudentWithUser(),
                    
                
                    
                        
                        await associateStudentWithCurrent_clas(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateParentStudentLinkWithParent_user(),
                    
                
                    
                        
                        await associateParentStudentLinkWithStudent(),
                    
                
                    
                
                    
                
                    
                        
                        await associateParentStudentLinkWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateSubjectWithSchool(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateClassSubjectWithClas(),
                    
                
                    
                        
                        await associateClassSubjectWithSubject(),
                    
                
                    
                        
                        await associateClassSubjectWithTeacher(),
                    
                
                    
                
                    
                
                    
                        
                        await associateClassSubjectWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateTimetableEntryWithClas(),
                    
                
                    
                        
                        await associateTimetableEntryWithClass_subject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateTimetableEntryWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateAttendanceSessionWithClas(),
                    
                
                    
                
                    
                        
                        await associateAttendanceSessionWithRecorded_by(),
                    
                
                    
                
                    
                        
                        await associateAttendanceSessionWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateAttendanceRecordWithAttendance_session(),
                    
                
                    
                        
                        await associateAttendanceRecordWithStudent(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAttendanceRecordWithChecked_by(),
                    
                
                    
                        
                        await associateAttendanceRecordWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateAnnouncementWithSchool(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAnnouncementWithTarget_clas(),
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAnnouncementWithAuthor(),
                    
                
                    
                
            
                
                
                    
                        
                        await associateAssignmentWithClass_subject(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAssignmentWithCreated_by(),
                    
                
                    
                
                    
                        
                        await associateAssignmentWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateAssignmentSubmissionWithAssignment(),
                    
                
                    
                        
                        await associateAssignmentSubmissionWithStudent(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateAssignmentSubmissionWithGraded_by(),
                    
                
                    
                
                    
                        
                        await associateAssignmentSubmissionWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateExamCategoryWithSchool(),
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateExamWithClass_subject(),
                    
                
                    
                        
                        await associateExamWithCategory(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExamWithCreated_by(),
                    
                
                    
                
                    
                        
                        await associateExamWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateExamQuestionWithExam(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExamQuestionWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateExamQuestionChoiceWithExam_question(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExamQuestionChoiceWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateExamAttemptWithExam(),
                    
                
                    
                        
                        await associateExamAttemptWithStudent(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateExamAttemptWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateExamAnswerWithExam_attempt(),
                    
                
                    
                        
                        await associateExamAnswerWithExam_question(),
                    
                
                    
                
                    
                        
                        await associateExamAnswerWithSelected_choice(),
                    
                
                    
                
                    
                        
                        await associateExamAnswerWithGraded_by(),
                    
                
                    
                
                    
                        
                        await associateExamAnswerWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateFeeDefinitionWithSchool(),
                    
                
                    
                        
                        await associateFeeDefinitionWithAcademic_year(),
                    
                
                    
                
                    
                
                    
                        
                        await associateFeeDefinitionWithEducation_level(),
                    
                
                    
                        
                        await associateFeeDefinitionWithClas(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
                
                
                    
                        
                        await associateBillingItemWithFee_definition(),
                    
                
                    
                        
                        await associateBillingItemWithStudent(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associateBillingItemWithSchool(),
                    
                
            
                
                
                    
                        
                        await associatePaymentWithBilling_item(),
                    
                
                    
                        
                        await associatePaymentWithPaid_by_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                        
                        await associatePaymentWithSchool(),
                    
                
            
                
                
                    
                        
                        await associateNotificationLogWithSchool(),
                    
                
                    
                        
                        await associateNotificationLogWithRecipient_user(),
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
                    
                
            
            ]);
        
    },

    down: async (queryInterface, Sequelize) => {
        
            
            
            
            
            
            await queryInterface.bulkDelete('schools', null, {});
            
            
            await queryInterface.bulkDelete('academic_years', null, {});
            
            
            await queryInterface.bulkDelete('education_levels', null, {});
            
            
            await queryInterface.bulkDelete('classes', null, {});
            
            
            await queryInterface.bulkDelete('students', null, {});
            
            
            await queryInterface.bulkDelete('parent_student_links', null, {});
            
            
            await queryInterface.bulkDelete('subjects', null, {});
            
            
            await queryInterface.bulkDelete('class_subjects', null, {});
            
            
            await queryInterface.bulkDelete('timetable_entries', null, {});
            
            
            await queryInterface.bulkDelete('attendance_sessions', null, {});
            
            
            await queryInterface.bulkDelete('attendance_records', null, {});
            
            
            await queryInterface.bulkDelete('announcements', null, {});
            
            
            await queryInterface.bulkDelete('assignments', null, {});
            
            
            await queryInterface.bulkDelete('assignment_submissions', null, {});
            
            
            await queryInterface.bulkDelete('exam_categories', null, {});
            
            
            await queryInterface.bulkDelete('exams', null, {});
            
            
            await queryInterface.bulkDelete('exam_questions', null, {});
            
            
            await queryInterface.bulkDelete('exam_question_choices', null, {});
            
            
            await queryInterface.bulkDelete('exam_attempts', null, {});
            
            
            await queryInterface.bulkDelete('exam_answers', null, {});
            
            
            await queryInterface.bulkDelete('fee_definitions', null, {});
            
            
            await queryInterface.bulkDelete('billing_items', null, {});
            
            
            await queryInterface.bulkDelete('payments', null, {});
            
            
            await queryInterface.bulkDelete('notification_logs', null, {});
            
        
    },
};