{
  "version": "5",
  "dialect": "mysql",
  "id": "0ec4760a-6847-43de-8c01-13cb9676df8c",
  "prevId": "00000000-0000-0000-0000-000000000000",
  "tables": {
    "academic_years": {
      "name": "academic_years",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "start_date": {
          "name": "start_date",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "end_date": {
          "name": "end_date",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "is_active": {
          "name": "is_active",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "academic_years_name_idx": {
          "name": "academic_years_name_idx",
          "columns": [
            "name"
          ],
          "isUnique": false
        },
        "academic_years_active_idx": {
          "name": "academic_years_active_idx",
          "columns": [
            "is_active"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "academic_years_id": {
          "name": "academic_years_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "academic_years_name_unique": {
          "name": "academic_years_name_unique",
          "columns": [
            "name"
          ]
        }
      },
      "checkConstraint": {}
    },
    "accounts": {
      "name": "accounts",
      "columns": {
        "userId": {
          "name": "userId",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "provider": {
          "name": "provider",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "providerAccountId": {
          "name": "providerAccountId",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "refresh_token": {
          "name": "refresh_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "access_token": {
          "name": "access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "token_type": {
          "name": "token_type",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "scope": {
          "name": "scope",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "id_token": {
          "name": "id_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "session_state": {
          "name": "session_state",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "account_userId_idx": {
          "name": "account_userId_idx",
          "columns": [
            "userId"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "accounts_userId_users_id_fk": {
          "name": "accounts_userId_users_id_fk",
          "tableFrom": "accounts",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "accounts_provider_providerAccountId_pk": {
          "name": "accounts_provider_providerAccountId_pk",
          "columns": [
            "provider",
            "providerAccountId"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "ai_providers": {
      "name": "ai_providers",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "provider": {
          "name": "provider",
          "type": "enum('zhipu','openai','gemini','custom')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "base_url": {
          "name": "base_url",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "model": {
          "name": "model",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "api_key_encrypted": {
          "name": "api_key_encrypted",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "api_key_last4": {
          "name": "api_key_last4",
          "type": "varchar(4)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_default": {
          "name": "is_default",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "created_by": {
          "name": "created_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updated_by": {
          "name": "updated_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "ai_provider_idx": {
          "name": "ai_provider_idx",
          "columns": [
            "provider"
          ],
          "isUnique": false
        },
        "ai_provider_default_idx": {
          "name": "ai_provider_default_idx",
          "columns": [
            "is_default"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "ai_providers_id": {
          "name": "ai_providers_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "announcements": {
      "name": "announcements",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('school','grade','class')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'school'"
        },
        "status": {
          "name": "status",
          "type": "enum('draft','published','archived')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'draft'"
        },
        "target_grade_id": {
          "name": "target_grade_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "target_class_id": {
          "name": "target_class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "author_id": {
          "name": "author_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "published_at": {
          "name": "published_at",
          "type": "datetime",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "announcements_author_idx": {
          "name": "announcements_author_idx",
          "columns": [
            "author_id"
          ],
          "isUnique": false
        },
        "announcements_status_idx": {
          "name": "announcements_status_idx",
          "columns": [
            "status"
          ],
          "isUnique": false
        },
        "announcements_type_idx": {
          "name": "announcements_type_idx",
          "columns": [
            "type"
          ],
          "isUnique": false
        },
        "announcements_target_grade_idx": {
          "name": "announcements_target_grade_idx",
          "columns": [
            "target_grade_id"
          ],
          "isUnique": false
        },
        "announcements_target_class_idx": {
          "name": "announcements_target_class_idx",
          "columns": [
            "target_class_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "announcements_author_id_users_id_fk": {
          "name": "announcements_author_id_users_id_fk",
          "tableFrom": "announcements",
          "tableTo": "users",
          "columnsFrom": [
            "author_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "announcements_id": {
          "name": "announcements_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "attendance_records": {
      "name": "attendance_records",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "student_id": {
          "name": "student_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "schedule_id": {
          "name": "schedule_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "date": {
          "name": "date",
          "type": "date",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "enum('present','absent','late','early_leave','excused')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "remark": {
          "name": "remark",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "recorded_by": {
          "name": "recorded_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "attendance_records_student_idx": {
          "name": "attendance_records_student_idx",
          "columns": [
            "student_id"
          ],
          "isUnique": false
        },
        "attendance_records_class_idx": {
          "name": "attendance_records_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        },
        "attendance_records_date_idx": {
          "name": "attendance_records_date_idx",
          "columns": [
            "date"
          ],
          "isUnique": false
        },
        "attendance_records_class_date_idx": {
          "name": "attendance_records_class_date_idx",
          "columns": [
            "class_id",
            "date"
          ],
          "isUnique": false
        },
        "attendance_records_student_date_idx": {
          "name": "attendance_records_student_date_idx",
          "columns": [
            "student_id",
            "date"
          ],
          "isUnique": false
        },
        "attendance_records_schedule_idx": {
          "name": "attendance_records_schedule_idx",
          "columns": [
            "schedule_id"
          ],
          "isUnique": false
        },
        "attendance_records_recorded_by_idx": {
          "name": "attendance_records_recorded_by_idx",
          "columns": [
            "recorded_by"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "attendance_records_student_id_users_id_fk": {
          "name": "attendance_records_student_id_users_id_fk",
          "tableFrom": "attendance_records",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "attendance_records_class_id_classes_id_fk": {
          "name": "attendance_records_class_id_classes_id_fk",
          "tableFrom": "attendance_records",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "attendance_records_recorded_by_users_id_fk": {
          "name": "attendance_records_recorded_by_users_id_fk",
          "tableFrom": "attendance_records",
          "tableTo": "users",
          "columnsFrom": [
            "recorded_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ar_c_fk": {
          "name": "ar_c_fk",
          "tableFrom": "attendance_records",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ar_s_fk": {
          "name": "ar_s_fk",
          "tableFrom": "attendance_records",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ar_rb_fk": {
          "name": "ar_rb_fk",
          "tableFrom": "attendance_records",
          "tableTo": "users",
          "columnsFrom": [
            "recorded_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "attendance_records_id": {
          "name": "attendance_records_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "attendance_rules": {
      "name": "attendance_rules",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "late_threshold_minutes": {
          "name": "late_threshold_minutes",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 15
        },
        "early_leave_threshold_minutes": {
          "name": "early_leave_threshold_minutes",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 15
        },
        "enable_auto_mark": {
          "name": "enable_auto_mark",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "attendance_rules_class_idx": {
          "name": "attendance_rules_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "attendance_rules_class_id_classes_id_fk": {
          "name": "attendance_rules_class_id_classes_id_fk",
          "tableFrom": "attendance_rules",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "atr_c_fk": {
          "name": "atr_c_fk",
          "tableFrom": "attendance_rules",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "attendance_rules_id": {
          "name": "attendance_rules_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "audit_logs": {
      "name": "audit_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_name": {
          "name": "user_name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "module": {
          "name": "module",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "target_id": {
          "name": "target_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "target_type": {
          "name": "target_type",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "detail": {
          "name": "detail",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ip_address": {
          "name": "ip_address",
          "type": "varchar(45)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "enum('success','failure')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'success'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "audit_logs_user_id_idx": {
          "name": "audit_logs_user_id_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        },
        "audit_logs_module_idx": {
          "name": "audit_logs_module_idx",
          "columns": [
            "module"
          ],
          "isUnique": false
        },
        "audit_logs_action_idx": {
          "name": "audit_logs_action_idx",
          "columns": [
            "action"
          ],
          "isUnique": false
        },
        "audit_logs_status_idx": {
          "name": "audit_logs_status_idx",
          "columns": [
            "status"
          ],
          "isUnique": false
        },
        "audit_logs_created_at_idx": {
          "name": "audit_logs_created_at_idx",
          "columns": [
            "created_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "audit_logs_id": {
          "name": "audit_logs_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "chapters": {
      "name": "chapters",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "textbook_id": {
          "name": "textbook_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "order": {
          "name": "order",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "parent_id": {
          "name": "parent_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "textbook_idx": {
          "name": "textbook_idx",
          "columns": [
            "textbook_id"
          ],
          "isUnique": false
        },
        "parent_id_idx": {
          "name": "parent_id_idx",
          "columns": [
            "parent_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "chapters_textbook_id_textbooks_id_fk": {
          "name": "chapters_textbook_id_textbooks_id_fk",
          "tableFrom": "chapters",
          "tableTo": "textbooks",
          "columnsFrom": [
            "textbook_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "chapters_id": {
          "name": "chapters_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "class_enrollments": {
      "name": "class_enrollments",
      "columns": {
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "student_id": {
          "name": "student_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "class_enrollment_status": {
          "name": "class_enrollment_status",
          "type": "enum('active','inactive')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'active'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "class_enrollments_class_idx": {
          "name": "class_enrollments_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        },
        "class_enrollments_student_idx": {
          "name": "class_enrollments_student_idx",
          "columns": [
            "student_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "ce_c_fk": {
          "name": "ce_c_fk",
          "tableFrom": "class_enrollments",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ce_s_fk": {
          "name": "ce_s_fk",
          "tableFrom": "class_enrollments",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "class_enrollments_class_id_student_id_pk": {
          "name": "class_enrollments_class_id_student_id_pk",
          "columns": [
            "class_id",
            "student_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "class_schedule": {
      "name": "class_schedule",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "weekday": {
          "name": "weekday",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "start_time": {
          "name": "start_time",
          "type": "varchar(5)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "end_time": {
          "name": "end_time",
          "type": "varchar(5)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "course": {
          "name": "course",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "location": {
          "name": "location",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "class_schedule_class_idx": {
          "name": "class_schedule_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        },
        "class_schedule_class_day_idx": {
          "name": "class_schedule_class_day_idx",
          "columns": [
            "class_id",
            "weekday"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "cs_c_fk": {
          "name": "cs_c_fk",
          "tableFrom": "class_schedule",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "class_schedule_id": {
          "name": "class_schedule_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "class_subject_teachers": {
      "name": "class_subject_teachers",
      "columns": {
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject_id": {
          "name": "subject_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "teacher_id": {
          "name": "teacher_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "class_subject_teachers_class_idx": {
          "name": "class_subject_teachers_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        },
        "class_subject_teachers_teacher_idx": {
          "name": "class_subject_teachers_teacher_idx",
          "columns": [
            "teacher_id"
          ],
          "isUnique": false
        },
        "class_subject_teachers_subject_id_idx": {
          "name": "class_subject_teachers_subject_id_idx",
          "columns": [
            "subject_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "class_subject_teachers_teacher_id_users_id_fk": {
          "name": "class_subject_teachers_teacher_id_users_id_fk",
          "tableFrom": "class_subject_teachers",
          "tableTo": "users",
          "columnsFrom": [
            "teacher_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "cst_c_fk": {
          "name": "cst_c_fk",
          "tableFrom": "class_subject_teachers",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "cst_s_fk": {
          "name": "cst_s_fk",
          "tableFrom": "class_subject_teachers",
          "tableTo": "subjects",
          "columnsFrom": [
            "subject_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "class_subject_teachers_class_id_subject_id_pk": {
          "name": "class_subject_teachers_class_id_subject_id_pk",
          "columns": [
            "class_id",
            "subject_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "classes": {
      "name": "classes",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "school_name": {
          "name": "school_name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "school_id": {
          "name": "school_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "grade": {
          "name": "grade",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "grade_id": {
          "name": "grade_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "homeroom": {
          "name": "homeroom",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "room": {
          "name": "room",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "invitation_code": {
          "name": "invitation_code",
          "type": "varchar(6)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "teacher_id": {
          "name": "teacher_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "classes_teacher_idx": {
          "name": "classes_teacher_idx",
          "columns": [
            "teacher_id"
          ],
          "isUnique": false
        },
        "classes_grade_idx": {
          "name": "classes_grade_idx",
          "columns": [
            "grade"
          ],
          "isUnique": false
        },
        "classes_school_idx": {
          "name": "classes_school_idx",
          "columns": [
            "school_id"
          ],
          "isUnique": false
        },
        "classes_grade_id_idx": {
          "name": "classes_grade_id_idx",
          "columns": [
            "grade_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "classes_teacher_id_users_id_fk": {
          "name": "classes_teacher_id_users_id_fk",
          "tableFrom": "classes",
          "tableTo": "users",
          "columnsFrom": [
            "teacher_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "c_s_fk": {
          "name": "c_s_fk",
          "tableFrom": "classes",
          "tableTo": "schools",
          "columnsFrom": [
            "school_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "c_g_fk": {
          "name": "c_g_fk",
          "tableFrom": "classes",
          "tableTo": "grades",
          "columnsFrom": [
            "grade_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "classes_id": {
          "name": "classes_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "classes_invitation_code_unique": {
          "name": "classes_invitation_code_unique",
          "columns": [
            "invitation_code"
          ]
        }
      },
      "checkConstraint": {}
    },
    "classrooms": {
      "name": "classrooms",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "building": {
          "name": "building",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "floor": {
          "name": "floor",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "capacity": {
          "name": "capacity",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "classrooms_name_idx": {
          "name": "classrooms_name_idx",
          "columns": [
            "name"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "classrooms_id": {
          "name": "classrooms_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "classrooms_name_unique": {
          "name": "classrooms_name_unique",
          "columns": [
            "name"
          ]
        }
      },
      "checkConstraint": {}
    },
    "course_plan_items": {
      "name": "course_plan_items",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "plan_id": {
          "name": "plan_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "week": {
          "name": "week",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "topic": {
          "name": "topic",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "hours": {
          "name": "hours",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 2
        },
        "textbook_chapter": {
          "name": "textbook_chapter",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_completed": {
          "name": "is_completed",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "date",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "course_plan_items_plan_idx": {
          "name": "course_plan_items_plan_idx",
          "columns": [
            "plan_id"
          ],
          "isUnique": false
        },
        "course_plan_items_plan_week_idx": {
          "name": "course_plan_items_plan_week_idx",
          "columns": [
            "plan_id",
            "week"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "course_plan_items_plan_id_course_plans_id_fk": {
          "name": "course_plan_items_plan_id_course_plans_id_fk",
          "tableFrom": "course_plan_items",
          "tableTo": "course_plans",
          "columnsFrom": [
            "plan_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "cpi_p_fk": {
          "name": "cpi_p_fk",
          "tableFrom": "course_plan_items",
          "tableTo": "course_plans",
          "columnsFrom": [
            "plan_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "course_plan_items_id": {
          "name": "course_plan_items_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "course_plans": {
      "name": "course_plans",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject_id": {
          "name": "subject_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "teacher_id": {
          "name": "teacher_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "academic_year_id": {
          "name": "academic_year_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "semester": {
          "name": "semester",
          "type": "enum('1','2')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'1'"
        },
        "total_hours": {
          "name": "total_hours",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "completed_hours": {
          "name": "completed_hours",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "weekly_hours": {
          "name": "weekly_hours",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "start_date": {
          "name": "start_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "end_date": {
          "name": "end_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "syllabus": {
          "name": "syllabus",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "objectives": {
          "name": "objectives",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "enum('planning','active','completed','paused')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'planning'"
        },
        "created_by": {
          "name": "created_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "course_plans_class_idx": {
          "name": "course_plans_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        },
        "course_plans_teacher_idx": {
          "name": "course_plans_teacher_idx",
          "columns": [
            "teacher_id"
          ],
          "isUnique": false
        },
        "course_plans_subject_idx": {
          "name": "course_plans_subject_idx",
          "columns": [
            "subject_id"
          ],
          "isUnique": false
        },
        "course_plans_status_idx": {
          "name": "course_plans_status_idx",
          "columns": [
            "status"
          ],
          "isUnique": false
        },
        "course_plans_class_subject_idx": {
          "name": "course_plans_class_subject_idx",
          "columns": [
            "class_id",
            "subject_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "course_plans_class_id_classes_id_fk": {
          "name": "course_plans_class_id_classes_id_fk",
          "tableFrom": "course_plans",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "course_plans_subject_id_subjects_id_fk": {
          "name": "course_plans_subject_id_subjects_id_fk",
          "tableFrom": "course_plans",
          "tableTo": "subjects",
          "columnsFrom": [
            "subject_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "course_plans_teacher_id_users_id_fk": {
          "name": "course_plans_teacher_id_users_id_fk",
          "tableFrom": "course_plans",
          "tableTo": "users",
          "columnsFrom": [
            "teacher_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "course_plans_created_by_users_id_fk": {
          "name": "course_plans_created_by_users_id_fk",
          "tableFrom": "course_plans",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "cp_c_fk": {
          "name": "cp_c_fk",
          "tableFrom": "course_plans",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "cp_s_fk": {
          "name": "cp_s_fk",
          "tableFrom": "course_plans",
          "tableTo": "subjects",
          "columnsFrom": [
            "subject_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "cp_t_fk": {
          "name": "cp_t_fk",
          "tableFrom": "course_plans",
          "tableTo": "users",
          "columnsFrom": [
            "teacher_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "cp_cb_fk": {
          "name": "cp_cb_fk",
          "tableFrom": "course_plans",
          "tableTo": "users",
          "columnsFrom": [
            "created_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "course_plans_id": {
          "name": "course_plans_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "data_change_logs": {
      "name": "data_change_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "table_name": {
          "name": "table_name",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "record_id": {
          "name": "record_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "enum('create','update','delete')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "old_value": {
          "name": "old_value",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "new_value": {
          "name": "new_value",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "changed_by": {
          "name": "changed_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "changed_by_name": {
          "name": "changed_by_name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "ip_address": {
          "name": "ip_address",
          "type": "varchar(45)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "data_change_logs_table_name_idx": {
          "name": "data_change_logs_table_name_idx",
          "columns": [
            "table_name"
          ],
          "isUnique": false
        },
        "data_change_logs_record_id_idx": {
          "name": "data_change_logs_record_id_idx",
          "columns": [
            "record_id"
          ],
          "isUnique": false
        },
        "data_change_logs_action_idx": {
          "name": "data_change_logs_action_idx",
          "columns": [
            "action"
          ],
          "isUnique": false
        },
        "data_change_logs_changed_by_idx": {
          "name": "data_change_logs_changed_by_idx",
          "columns": [
            "changed_by"
          ],
          "isUnique": false
        },
        "data_change_logs_created_at_idx": {
          "name": "data_change_logs_created_at_idx",
          "columns": [
            "created_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "data_change_logs_id": {
          "name": "data_change_logs_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "departments": {
      "name": "departments",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "departments_name_idx": {
          "name": "departments_name_idx",
          "columns": [
            "name"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "departments_id": {
          "name": "departments_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "departments_name_unique": {
          "name": "departments_name_unique",
          "columns": [
            "name"
          ]
        }
      },
      "checkConstraint": {}
    },
    "exam_questions": {
      "name": "exam_questions",
      "columns": {
        "exam_id": {
          "name": "exam_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "question_id": {
          "name": "question_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "score": {
          "name": "score",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "order": {
          "name": "order",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        }
      },
      "indexes": {},
      "foreignKeys": {
        "exam_questions_exam_id_exams_id_fk": {
          "name": "exam_questions_exam_id_exams_id_fk",
          "tableFrom": "exam_questions",
          "tableTo": "exams",
          "columnsFrom": [
            "exam_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "exam_questions_question_id_questions_id_fk": {
          "name": "exam_questions_question_id_questions_id_fk",
          "tableFrom": "exam_questions",
          "tableTo": "questions",
          "columnsFrom": [
            "question_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "exam_questions_exam_id_question_id_pk": {
          "name": "exam_questions_exam_id_question_id_pk",
          "columns": [
            "exam_id",
            "question_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "exam_submissions": {
      "name": "exam_submissions",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "exam_id": {
          "name": "exam_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "student_id": {
          "name": "student_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "score": {
          "name": "score",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'started'"
        },
        "submitted_at": {
          "name": "submitted_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "exam_student_idx": {
          "name": "exam_student_idx",
          "columns": [
            "exam_id",
            "student_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "exam_submissions_exam_id_exams_id_fk": {
          "name": "exam_submissions_exam_id_exams_id_fk",
          "tableFrom": "exam_submissions",
          "tableTo": "exams",
          "columnsFrom": [
            "exam_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "exam_submissions_student_id_users_id_fk": {
          "name": "exam_submissions_student_id_users_id_fk",
          "tableFrom": "exam_submissions",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "exam_submissions_id": {
          "name": "exam_submissions_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "exams": {
      "name": "exams",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "structure": {
          "name": "structure",
          "type": "json",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "creator_id": {
          "name": "creator_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject_id": {
          "name": "subject_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "grade_id": {
          "name": "grade_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "start_time": {
          "name": "start_time",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "end_time": {
          "name": "end_time",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'draft'"
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "exams_subject_idx": {
          "name": "exams_subject_idx",
          "columns": [
            "subject_id"
          ],
          "isUnique": false
        },
        "exams_grade_idx": {
          "name": "exams_grade_idx",
          "columns": [
            "grade_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "exams_creator_id_users_id_fk": {
          "name": "exams_creator_id_users_id_fk",
          "tableFrom": "exams",
          "tableTo": "users",
          "columnsFrom": [
            "creator_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "exams_subject_id_subjects_id_fk": {
          "name": "exams_subject_id_subjects_id_fk",
          "tableFrom": "exams",
          "tableTo": "subjects",
          "columnsFrom": [
            "subject_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "exams_grade_id_grades_id_fk": {
          "name": "exams_grade_id_grades_id_fk",
          "tableFrom": "exams",
          "tableTo": "grades",
          "columnsFrom": [
            "grade_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "exams_id": {
          "name": "exams_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "file_attachments": {
      "name": "file_attachments",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "filename": {
          "name": "filename",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "original_name": {
          "name": "original_name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "mime_type": {
          "name": "mime_type",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "size": {
          "name": "size",
          "type": "bigint",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "storage_path": {
          "name": "storage_path",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "url": {
          "name": "url",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "uploader_id": {
          "name": "uploader_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "target_type": {
          "name": "target_type",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "target_id": {
          "name": "target_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "file_attachments_uploader_idx": {
          "name": "file_attachments_uploader_idx",
          "columns": [
            "uploader_id"
          ],
          "isUnique": false
        },
        "file_attachments_target_idx": {
          "name": "file_attachments_target_idx",
          "columns": [
            "target_type",
            "target_id"
          ],
          "isUnique": false
        },
        "file_attachments_created_at_idx": {
          "name": "file_attachments_created_at_idx",
          "columns": [
            "created_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "file_attachments_uploader_id_users_id_fk": {
          "name": "file_attachments_uploader_id_users_id_fk",
          "tableFrom": "file_attachments",
          "tableTo": "users",
          "columnsFrom": [
            "uploader_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "file_attachments_id": {
          "name": "file_attachments_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "grade_records": {
      "name": "grade_records",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "student_id": {
          "name": "student_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject_id": {
          "name": "subject_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "exam_id": {
          "name": "exam_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "academic_year_id": {
          "name": "academic_year_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "score": {
          "name": "score",
          "type": "decimal(6,2)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "full_score": {
          "name": "full_score",
          "type": "decimal(6,2)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'100'"
        },
        "type": {
          "name": "type",
          "type": "enum('exam','quiz','homework','other')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'exam'"
        },
        "semester": {
          "name": "semester",
          "type": "enum('1','2')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'1'"
        },
        "recorded_by": {
          "name": "recorded_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "remark": {
          "name": "remark",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "grade_records_student_idx": {
          "name": "grade_records_student_idx",
          "columns": [
            "student_id"
          ],
          "isUnique": false
        },
        "grade_records_class_idx": {
          "name": "grade_records_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        },
        "grade_records_subject_idx": {
          "name": "grade_records_subject_idx",
          "columns": [
            "subject_id"
          ],
          "isUnique": false
        },
        "grade_records_exam_idx": {
          "name": "grade_records_exam_idx",
          "columns": [
            "exam_id"
          ],
          "isUnique": false
        },
        "grade_records_class_subject_idx": {
          "name": "grade_records_class_subject_idx",
          "columns": [
            "class_id",
            "subject_id"
          ],
          "isUnique": false
        },
        "grade_records_recorded_by_idx": {
          "name": "grade_records_recorded_by_idx",
          "columns": [
            "recorded_by"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "grade_records_student_id_users_id_fk": {
          "name": "grade_records_student_id_users_id_fk",
          "tableFrom": "grade_records",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "grade_records_class_id_classes_id_fk": {
          "name": "grade_records_class_id_classes_id_fk",
          "tableFrom": "grade_records",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "grade_records_subject_id_subjects_id_fk": {
          "name": "grade_records_subject_id_subjects_id_fk",
          "tableFrom": "grade_records",
          "tableTo": "subjects",
          "columnsFrom": [
            "subject_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "grade_records_recorded_by_users_id_fk": {
          "name": "grade_records_recorded_by_users_id_fk",
          "tableFrom": "grade_records",
          "tableTo": "users",
          "columnsFrom": [
            "recorded_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "gr_c_fk": {
          "name": "gr_c_fk",
          "tableFrom": "grade_records",
          "tableTo": "classes",
          "columnsFrom": [
            "class_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "gr_s_fk": {
          "name": "gr_s_fk",
          "tableFrom": "grade_records",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "gr_sub_fk": {
          "name": "gr_sub_fk",
          "tableFrom": "grade_records",
          "tableTo": "subjects",
          "columnsFrom": [
            "subject_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "gr_rb_fk": {
          "name": "gr_rb_fk",
          "tableFrom": "grade_records",
          "tableTo": "users",
          "columnsFrom": [
            "recorded_by"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "grade_records_id": {
          "name": "grade_records_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "grades": {
      "name": "grades",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "school_id": {
          "name": "school_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "order": {
          "name": "order",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "grade_head_id": {
          "name": "grade_head_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "teaching_head_id": {
          "name": "teaching_head_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "grades_school_idx": {
          "name": "grades_school_idx",
          "columns": [
            "school_id"
          ],
          "isUnique": false
        },
        "grades_school_name_uniq": {
          "name": "grades_school_name_uniq",
          "columns": [
            "school_id",
            "name"
          ],
          "isUnique": false
        },
        "grades_grade_head_idx": {
          "name": "grades_grade_head_idx",
          "columns": [
            "grade_head_id"
          ],
          "isUnique": false
        },
        "grades_teaching_head_idx": {
          "name": "grades_teaching_head_idx",
          "columns": [
            "teaching_head_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "g_s_fk": {
          "name": "g_s_fk",
          "tableFrom": "grades",
          "tableTo": "schools",
          "columnsFrom": [
            "school_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "g_gh_fk": {
          "name": "g_gh_fk",
          "tableFrom": "grades",
          "tableTo": "users",
          "columnsFrom": [
            "grade_head_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "g_th_fk": {
          "name": "g_th_fk",
          "tableFrom": "grades",
          "tableTo": "users",
          "columnsFrom": [
            "teaching_head_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "grades_id": {
          "name": "grades_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "homework_answers": {
      "name": "homework_answers",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "submission_id": {
          "name": "submission_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "question_id": {
          "name": "question_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "answer_content": {
          "name": "answer_content",
          "type": "json",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "score": {
          "name": "score",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "feedback": {
          "name": "feedback",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "hw_answer_submission_idx": {
          "name": "hw_answer_submission_idx",
          "columns": [
            "submission_id"
          ],
          "isUnique": false
        },
        "hw_answer_submission_question_idx": {
          "name": "hw_answer_submission_question_idx",
          "columns": [
            "submission_id",
            "question_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "hw_ans_sub_fk": {
          "name": "hw_ans_sub_fk",
          "tableFrom": "homework_answers",
          "tableTo": "homework_submissions",
          "columnsFrom": [
            "submission_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "hw_ans_q_fk": {
          "name": "hw_ans_q_fk",
          "tableFrom": "homework_answers",
          "tableTo": "questions",
          "columnsFrom": [
            "question_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "homework_answers_id": {
          "name": "homework_answers_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "homework_assignment_questions": {
      "name": "homework_assignment_questions",
      "columns": {
        "assignment_id": {
          "name": "assignment_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "question_id": {
          "name": "question_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "score": {
          "name": "score",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "order": {
          "name": "order",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        }
      },
      "indexes": {
        "hw_assignment_questions_assignment_idx": {
          "name": "hw_assignment_questions_assignment_idx",
          "columns": [
            "assignment_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "hw_aq_a_fk": {
          "name": "hw_aq_a_fk",
          "tableFrom": "homework_assignment_questions",
          "tableTo": "homework_assignments",
          "columnsFrom": [
            "assignment_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "hw_aq_q_fk": {
          "name": "hw_aq_q_fk",
          "tableFrom": "homework_assignment_questions",
          "tableTo": "questions",
          "columnsFrom": [
            "question_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "homework_assignment_questions_assignment_id_question_id_pk": {
          "name": "homework_assignment_questions_assignment_id_question_id_pk",
          "columns": [
            "assignment_id",
            "question_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "homework_assignment_targets": {
      "name": "homework_assignment_targets",
      "columns": {
        "assignment_id": {
          "name": "assignment_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "student_id": {
          "name": "student_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "hw_assignment_targets_assignment_idx": {
          "name": "hw_assignment_targets_assignment_idx",
          "columns": [
            "assignment_id"
          ],
          "isUnique": false
        },
        "hw_assignment_targets_student_idx": {
          "name": "hw_assignment_targets_student_idx",
          "columns": [
            "student_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "hw_at_a_fk": {
          "name": "hw_at_a_fk",
          "tableFrom": "homework_assignment_targets",
          "tableTo": "homework_assignments",
          "columnsFrom": [
            "assignment_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "hw_at_s_fk": {
          "name": "hw_at_s_fk",
          "tableFrom": "homework_assignment_targets",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "homework_assignment_targets_assignment_id_student_id_pk": {
          "name": "homework_assignment_targets_assignment_id_student_id_pk",
          "columns": [
            "assignment_id",
            "student_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "homework_assignments": {
      "name": "homework_assignments",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "source_exam_id": {
          "name": "source_exam_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "structure": {
          "name": "structure",
          "type": "json",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'draft'"
        },
        "creator_id": {
          "name": "creator_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "available_at": {
          "name": "available_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "due_at": {
          "name": "due_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "allow_late": {
          "name": "allow_late",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "late_due_at": {
          "name": "late_due_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "max_attempts": {
          "name": "max_attempts",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "hw_assignment_creator_idx": {
          "name": "hw_assignment_creator_idx",
          "columns": [
            "creator_id"
          ],
          "isUnique": false
        },
        "hw_assignment_source_exam_idx": {
          "name": "hw_assignment_source_exam_idx",
          "columns": [
            "source_exam_id"
          ],
          "isUnique": false
        },
        "hw_assignment_status_idx": {
          "name": "hw_assignment_status_idx",
          "columns": [
            "status"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "hw_asg_exam_fk": {
          "name": "hw_asg_exam_fk",
          "tableFrom": "homework_assignments",
          "tableTo": "exams",
          "columnsFrom": [
            "source_exam_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "hw_asg_creator_fk": {
          "name": "hw_asg_creator_fk",
          "tableFrom": "homework_assignments",
          "tableTo": "users",
          "columnsFrom": [
            "creator_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "homework_assignments_id": {
          "name": "homework_assignments_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "homework_submissions": {
      "name": "homework_submissions",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "assignment_id": {
          "name": "assignment_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "student_id": {
          "name": "student_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "attempt_no": {
          "name": "attempt_no",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "score": {
          "name": "score",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'started'"
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "submitted_at": {
          "name": "submitted_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_late": {
          "name": "is_late",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "hw_assignment_student_idx": {
          "name": "hw_assignment_student_idx",
          "columns": [
            "assignment_id",
            "student_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "hw_sub_a_fk": {
          "name": "hw_sub_a_fk",
          "tableFrom": "homework_submissions",
          "tableTo": "homework_assignments",
          "columnsFrom": [
            "assignment_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "hw_sub_student_fk": {
          "name": "hw_sub_student_fk",
          "tableFrom": "homework_submissions",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "homework_submissions_id": {
          "name": "homework_submissions_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "knowledge_points": {
      "name": "knowledge_points",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "anchor_text": {
          "name": "anchor_text",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "parent_id": {
          "name": "parent_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "chapter_id": {
          "name": "chapter_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "level": {
          "name": "level",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "order": {
          "name": "order",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "parent_id_idx": {
          "name": "parent_id_idx",
          "columns": [
            "parent_id"
          ],
          "isUnique": false
        },
        "kp_chapter_id_idx": {
          "name": "kp_chapter_id_idx",
          "columns": [
            "chapter_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "knowledge_points_id": {
          "name": "knowledge_points_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "login_logs": {
      "name": "login_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_email": {
          "name": "user_email",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "action": {
          "name": "action",
          "type": "enum('signin','signout','signup')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "enum('success','failure')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'success'"
        },
        "ip_address": {
          "name": "ip_address",
          "type": "varchar(45)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "login_logs_user_id_idx": {
          "name": "login_logs_user_id_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        },
        "login_logs_user_email_idx": {
          "name": "login_logs_user_email_idx",
          "columns": [
            "user_email"
          ],
          "isUnique": false
        },
        "login_logs_action_idx": {
          "name": "login_logs_action_idx",
          "columns": [
            "action"
          ],
          "isUnique": false
        },
        "login_logs_status_idx": {
          "name": "login_logs_status_idx",
          "columns": [
            "status"
          ],
          "isUnique": false
        },
        "login_logs_created_at_idx": {
          "name": "login_logs_created_at_idx",
          "columns": [
            "created_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "login_logs_id": {
          "name": "login_logs_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "message_notifications": {
      "name": "message_notifications",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "link": {
          "name": "link",
          "type": "varchar(512)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_read": {
          "name": "is_read",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "message_notifications_user_idx": {
          "name": "message_notifications_user_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        },
        "message_notifications_is_read_idx": {
          "name": "message_notifications_is_read_idx",
          "columns": [
            "is_read"
          ],
          "isUnique": false
        },
        "message_notifications_user_read_idx": {
          "name": "message_notifications_user_read_idx",
          "columns": [
            "user_id",
            "is_read"
          ],
          "isUnique": false
        },
        "message_notifications_created_at_idx": {
          "name": "message_notifications_created_at_idx",
          "columns": [
            "created_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "message_notifications_user_id_users_id_fk": {
          "name": "message_notifications_user_id_users_id_fk",
          "tableFrom": "message_notifications",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "message_notifications_id": {
          "name": "message_notifications_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "messages": {
      "name": "messages",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "sender_id": {
          "name": "sender_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "receiver_id": {
          "name": "receiver_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject": {
          "name": "subject",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "is_read": {
          "name": "is_read",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "read_at": {
          "name": "read_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "parent_message_id": {
          "name": "parent_message_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "messages_sender_idx": {
          "name": "messages_sender_idx",
          "columns": [
            "sender_id"
          ],
          "isUnique": false
        },
        "messages_receiver_idx": {
          "name": "messages_receiver_idx",
          "columns": [
            "receiver_id"
          ],
          "isUnique": false
        },
        "messages_is_read_idx": {
          "name": "messages_is_read_idx",
          "columns": [
            "is_read"
          ],
          "isUnique": false
        },
        "messages_parent_idx": {
          "name": "messages_parent_idx",
          "columns": [
            "parent_message_id"
          ],
          "isUnique": false
        },
        "messages_receiver_read_idx": {
          "name": "messages_receiver_read_idx",
          "columns": [
            "receiver_id",
            "is_read"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "messages_sender_id_users_id_fk": {
          "name": "messages_sender_id_users_id_fk",
          "tableFrom": "messages",
          "tableTo": "users",
          "columnsFrom": [
            "sender_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "messages_receiver_id_users_id_fk": {
          "name": "messages_receiver_id_users_id_fk",
          "tableFrom": "messages",
          "tableTo": "users",
          "columnsFrom": [
            "receiver_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "messages_id": {
          "name": "messages_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "notification_preferences": {
      "name": "notification_preferences",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "email_enabled": {
          "name": "email_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "sms_enabled": {
          "name": "sms_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "push_enabled": {
          "name": "push_enabled",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "homework_notifications": {
          "name": "homework_notifications",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "grade_notifications": {
          "name": "grade_notifications",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "announcement_notifications": {
          "name": "announcement_notifications",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "message_notifications": {
          "name": "message_notifications",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "attendance_notifications": {
          "name": "attendance_notifications",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "notification_preferences_user_idx": {
          "name": "notification_preferences_user_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "notification_preferences_user_id_users_id_fk": {
          "name": "notification_preferences_user_id_users_id_fk",
          "tableFrom": "notification_preferences",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "np_u_fk": {
          "name": "np_u_fk",
          "tableFrom": "notification_preferences",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "notification_preferences_id": {
          "name": "notification_preferences_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "notification_preferences_user_id_unique": {
          "name": "notification_preferences_user_id_unique",
          "columns": [
            "user_id"
          ]
        }
      },
      "checkConstraint": {}
    },
    "parent_student_relations": {
      "name": "parent_student_relations",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "parent_id": {
          "name": "parent_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "student_id": {
          "name": "student_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "relation": {
          "name": "relation",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        }
      },
      "indexes": {
        "parent_student_relations_parent_idx": {
          "name": "parent_student_relations_parent_idx",
          "columns": [
            "parent_id"
          ],
          "isUnique": false
        },
        "parent_student_relations_student_idx": {
          "name": "parent_student_relations_student_idx",
          "columns": [
            "student_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "parent_student_relations_parent_id_users_id_fk": {
          "name": "parent_student_relations_parent_id_users_id_fk",
          "tableFrom": "parent_student_relations",
          "tableTo": "users",
          "columnsFrom": [
            "parent_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "parent_student_relations_student_id_users_id_fk": {
          "name": "parent_student_relations_student_id_users_id_fk",
          "tableFrom": "parent_student_relations",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "psr_p_fk": {
          "name": "psr_p_fk",
          "tableFrom": "parent_student_relations",
          "tableTo": "users",
          "columnsFrom": [
            "parent_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "psr_s_fk": {
          "name": "psr_s_fk",
          "tableFrom": "parent_student_relations",
          "tableTo": "users",
          "columnsFrom": [
            "student_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "parent_student_relations_id": {
          "name": "parent_student_relations_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "password_security": {
      "name": "password_security",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "failed_login_attempts": {
          "name": "failed_login_attempts",
          "type": "int",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "locked_until": {
          "name": "locked_until",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "password_changed_at": {
          "name": "password_changed_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "must_change_password": {
          "name": "must_change_password",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "last_password_change": {
          "name": "last_password_change",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "password_security_user_idx": {
          "name": "password_security_user_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "password_security_user_id_users_id_fk": {
          "name": "password_security_user_id_users_id_fk",
          "tableFrom": "password_security",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ps_u_fk": {
          "name": "ps_u_fk",
          "tableFrom": "password_security",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "password_security_id": {
          "name": "password_security_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "password_security_user_id_unique": {
          "name": "password_security_user_id_unique",
          "columns": [
            "user_id"
          ]
        }
      },
      "checkConstraint": {}
    },
    "questions": {
      "name": "questions",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "json",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "enum('single_choice','multiple_choice','text','judgment','composite')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "difficulty": {
          "name": "difficulty",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 1
        },
        "parent_id": {
          "name": "parent_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "author_id": {
          "name": "author_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "parent_id_idx": {
          "name": "parent_id_idx",
          "columns": [
            "parent_id"
          ],
          "isUnique": false
        },
        "author_id_idx": {
          "name": "author_id_idx",
          "columns": [
            "author_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "questions_author_id_users_id_fk": {
          "name": "questions_author_id_users_id_fk",
          "tableFrom": "questions",
          "tableTo": "users",
          "columnsFrom": [
            "author_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "questions_id": {
          "name": "questions_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "questions_to_knowledge_points": {
      "name": "questions_to_knowledge_points",
      "columns": {
        "question_id": {
          "name": "question_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "knowledge_point_id": {
          "name": "knowledge_point_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "kp_idx": {
          "name": "kp_idx",
          "columns": [
            "knowledge_point_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "q_kp_qid_fk": {
          "name": "q_kp_qid_fk",
          "tableFrom": "questions_to_knowledge_points",
          "tableTo": "questions",
          "columnsFrom": [
            "question_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "q_kp_kpid_fk": {
          "name": "q_kp_kpid_fk",
          "tableFrom": "questions_to_knowledge_points",
          "tableTo": "knowledge_points",
          "columnsFrom": [
            "knowledge_point_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "questions_to_knowledge_points_question_id_knowledge_point_id_pk": {
          "name": "questions_to_knowledge_points_question_id_knowledge_point_id_pk",
          "columns": [
            "question_id",
            "knowledge_point_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "role_permissions": {
      "name": "role_permissions",
      "columns": {
        "role_id": {
          "name": "role_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "permission": {
          "name": "permission",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "role_permissions_role_idx": {
          "name": "role_permissions_role_idx",
          "columns": [
            "role_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "role_permissions_role_id_roles_id_fk": {
          "name": "role_permissions_role_id_roles_id_fk",
          "tableFrom": "role_permissions",
          "tableTo": "roles",
          "columnsFrom": [
            "role_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "role_permissions_role_id_permission_pk": {
          "name": "role_permissions_role_id_permission_pk",
          "columns": [
            "role_id",
            "permission"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "roles": {
      "name": "roles",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "roles_id": {
          "name": "roles_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "roles_name_unique": {
          "name": "roles_name_unique",
          "columns": [
            "name"
          ]
        }
      },
      "checkConstraint": {}
    },
    "schedule_changes": {
      "name": "schedule_changes",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "original_schedule_id": {
          "name": "original_schedule_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "original_teacher_id": {
          "name": "original_teacher_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "substitute_teacher_id": {
          "name": "substitute_teacher_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "original_date": {
          "name": "original_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "new_date": {
          "name": "new_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "new_start_time": {
          "name": "new_start_time",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "new_end_time": {
          "name": "new_end_time",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "reason": {
          "name": "reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "enum('pending','approved','rejected','completed')",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "requested_by": {
          "name": "requested_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "approved_by": {
          "name": "approved_by",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "schedule_changes_class_idx": {
          "name": "schedule_changes_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        },
        "schedule_changes_status_idx": {
          "name": "schedule_changes_status_idx",
          "columns": [
            "status"
          ],
          "isUnique": false
        },
        "schedule_changes_requested_by_idx": {
          "name": "schedule_changes_requested_by_idx",
          "columns": [
            "requested_by"
          ],
          "isUnique": false
        },
        "schedule_changes_original_schedule_idx": {
          "name": "schedule_changes_original_schedule_idx",
          "columns": [
            "original_schedule_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "schedule_changes_id": {
          "name": "schedule_changes_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "scheduling_rules": {
      "name": "scheduling_rules",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "class_id": {
          "name": "class_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "max_daily_hours": {
          "name": "max_daily_hours",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 8
        },
        "max_continuous_hours": {
          "name": "max_continuous_hours",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 2
        },
        "lunch_break_start": {
          "name": "lunch_break_start",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'12:00'"
        },
        "lunch_break_end": {
          "name": "lunch_break_end",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'13:00'"
        },
        "morning_start": {
          "name": "morning_start",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'08:00'"
        },
        "afternoon_end": {
          "name": "afternoon_end",
          "type": "varchar(10)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'17:00'"
        },
        "avoid_back_to_back": {
          "name": "avoid_back_to_back",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": false
        },
        "balanced_subjects": {
          "name": "balanced_subjects",
          "type": "boolean",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "scheduling_rules_class_idx": {
          "name": "scheduling_rules_class_idx",
          "columns": [
            "class_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "scheduling_rules_id": {
          "name": "scheduling_rules_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "schools": {
      "name": "schools",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "code": {
          "name": "code",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "schools_name_idx": {
          "name": "schools_name_idx",
          "columns": [
            "name"
          ],
          "isUnique": false
        },
        "schools_code_idx": {
          "name": "schools_code_idx",
          "columns": [
            "code"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "schools_id": {
          "name": "schools_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "schools_name_unique": {
          "name": "schools_name_unique",
          "columns": [
            "name"
          ]
        },
        "schools_code_unique": {
          "name": "schools_code_unique",
          "columns": [
            "code"
          ]
        }
      },
      "checkConstraint": {}
    },
    "sessions": {
      "name": "sessions",
      "columns": {
        "sessionToken": {
          "name": "sessionToken",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "userId": {
          "name": "userId",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "expires": {
          "name": "expires",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "session_userId_idx": {
          "name": "session_userId_idx",
          "columns": [
            "userId"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "sessions_userId_users_id_fk": {
          "name": "sessions_userId_users_id_fk",
          "tableFrom": "sessions",
          "tableTo": "users",
          "columnsFrom": [
            "userId"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "sessions_sessionToken": {
          "name": "sessions_sessionToken",
          "columns": [
            "sessionToken"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "subjects": {
      "name": "subjects",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "code": {
          "name": "code",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "order": {
          "name": "order",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "subjects_name_idx": {
          "name": "subjects_name_idx",
          "columns": [
            "name"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "subjects_id": {
          "name": "subjects_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "subjects_name_unique": {
          "name": "subjects_name_unique",
          "columns": [
            "name"
          ]
        },
        "subjects_code_unique": {
          "name": "subjects_code_unique",
          "columns": [
            "code"
          ]
        }
      },
      "checkConstraint": {}
    },
    "submission_answers": {
      "name": "submission_answers",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "submission_id": {
          "name": "submission_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "question_id": {
          "name": "question_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "answer_content": {
          "name": "answer_content",
          "type": "json",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "score": {
          "name": "score",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "feedback": {
          "name": "feedback",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "submission_idx": {
          "name": "submission_idx",
          "columns": [
            "submission_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "submission_answers_submission_id_exam_submissions_id_fk": {
          "name": "submission_answers_submission_id_exam_submissions_id_fk",
          "tableFrom": "submission_answers",
          "tableTo": "exam_submissions",
          "columnsFrom": [
            "submission_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "submission_answers_question_id_questions_id_fk": {
          "name": "submission_answers_question_id_questions_id_fk",
          "tableFrom": "submission_answers",
          "tableTo": "questions",
          "columnsFrom": [
            "question_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "submission_answers_id": {
          "name": "submission_answers_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "textbooks": {
      "name": "textbooks",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "subject": {
          "name": "subject",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "grade": {
          "name": "grade",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "publisher": {
          "name": "publisher",
          "type": "varchar(100)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "textbooks_id": {
          "name": "textbooks_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "users": {
      "name": "users",
      "columns": {
        "id": {
          "name": "id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "email": {
          "name": "email",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "emailVerified": {
          "name": "emailVerified",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "image": {
          "name": "image",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "password": {
          "name": "password",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "phone": {
          "name": "phone",
          "type": "varchar(30)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "address": {
          "name": "address",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "gender": {
          "name": "gender",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "age": {
          "name": "age",
          "type": "int",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "grade_id": {
          "name": "grade_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "department_id": {
          "name": "department_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "onboarded_at": {
          "name": "onboarded_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "birth_date": {
          "name": "birth_date",
          "type": "date",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "guardian_name": {
          "name": "guardian_name",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "guardian_phone": {
          "name": "guardian_phone",
          "type": "varchar(20)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "guardian_relation": {
          "name": "guardian_relation",
          "type": "varchar(50)",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "consent_accepted_at": {
          "name": "consent_accepted_at",
          "type": "datetime",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(now())"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "onUpdate": true,
          "default": "(now())"
        }
      },
      "indexes": {
        "email_idx": {
          "name": "email_idx",
          "columns": [
            "email"
          ],
          "isUnique": false
        },
        "users_grade_id_idx": {
          "name": "users_grade_id_idx",
          "columns": [
            "grade_id"
          ],
          "isUnique": false
        },
        "users_department_id_idx": {
          "name": "users_department_id_idx",
          "columns": [
            "department_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "users_id": {
          "name": "users_id",
          "columns": [
            "id"
          ]
        }
      },
      "uniqueConstraints": {
        "users_email_unique": {
          "name": "users_email_unique",
          "columns": [
            "email"
          ]
        }
      },
      "checkConstraint": {}
    },
    "users_to_roles": {
      "name": "users_to_roles",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "role_id": {
          "name": "role_id",
          "type": "varchar(128)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "user_id_idx": {
          "name": "user_id_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "users_to_roles_user_id_users_id_fk": {
          "name": "users_to_roles_user_id_users_id_fk",
          "tableFrom": "users_to_roles",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "users_to_roles_role_id_roles_id_fk": {
          "name": "users_to_roles_role_id_roles_id_fk",
          "tableFrom": "users_to_roles",
          "tableTo": "roles",
          "columnsFrom": [
            "role_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "users_to_roles_user_id_role_id_pk": {
          "name": "users_to_roles_user_id_role_id_pk",
          "columns": [
            "user_id",
            "role_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    },
    "verificationTokens": {
      "name": "verificationTokens",
      "columns": {
        "identifier": {
          "name": "identifier",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "token": {
          "name": "token",
          "type": "varchar(255)",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "expires": {
          "name": "expires",
          "type": "timestamp",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {
        "verificationTokens_identifier_token_pk": {
          "name": "verificationTokens_identifier_token_pk",
          "columns": [
            "identifier",
            "token"
          ]
        }
      },
      "uniqueConstraints": {},
      "checkConstraint": {}
    }
  },
  "views": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "tables": {},
    "indexes": {}
  }
}