Database: axioma +-----------------------------------------------------+---------+-----------------+----------+ | Relationship | Orphans | Column type | FK-ready | +-----------------------------------------------------+---------+-----------------+----------+ | payments.student_id -> students.id | 5 | int | no | | charges.student_id -> students.id | 9 | int | no | | charges.group_id -> study_groups.id | 9 | int | no | | charges.tariff_id -> tariffs.id | 0 | int | yes | | student_tariffs.student_id -> students.id | 1 | int | no | | student_tariffs.group_id -> study_groups.id | 1 | int | no | | student_tariffs.tariff_id -> tariffs.id | 0 | int | yes | | group_tariffs.group_id -> study_groups.id | 1 | int | no | | group_tariffs.tariff_id -> tariffs.id | 0 | int | yes | | student_groups.student_id -> students.id | 0 | int | yes | | student_groups.group_id -> study_groups.id | 0 | int | yes | | schedule_items.group_id -> study_groups.id | 118 | int | no | | frozen_days.student_id -> students.id | 2 | int | no | | lessons.ed_unit_id -> study_groups.id | 6112 | int | no | | lessons.teacher_id -> users.id | 0 | bigint unsigned | yes | | student_lessons.lesson_id -> lessons.id | 2728 | int | no | | student_lessons.student_id -> students.id | 19085 | int | no | | weekly_tests.lesson_id -> lessons.id | 0 | int | yes | | weekly_test_results.test_id -> weekly_tests.id | 0 | int | yes | | weekly_test_results.student_id -> students.id | 113 | int | no | | students.user_id -> users.id | 0 | bigint unsigned | yes | | students.status_id -> student_statuses.id | 0 | int | yes | | study_groups.teacher_id -> users.id | 0 | bigint unsigned | yes | | teachers.user_id -> users.id | 0 | bigint unsigned | yes | | feedbacks.student_id -> students.id | 3 | int | no | | adviser_tasks.student_id -> students.id | 0 | int | yes | | heroes.student_id -> students.id | 32 | int | no | | student_achievements.student_id -> students.id | 0 | int | yes | | gamification_coins_ledger.student_id -> students.id | 175 | int | no | | gamification_xp_ledger.student_id -> students.id | 59 | int | no | +-----------------------------------------------------+---------+-----------------+----------+ 30 relationship(s) checked, 28453 orphaned row(s) total, 16 not ready for a foreign key. Clean up the orphans and reconcile any type mismatches before adding constraints. Database: axioma +-----------------------------------------------------+---------+-----------------+----------+ | Relationship | Orphans | Column type | FK-ready | +-----------------------------------------------------+---------+-----------------+----------+ | payments.student_id -> students.id | 5 | int | no | | charges.student_id -> students.id | 9 | int | no | | charges.group_id -> study_groups.id | 9 | int | no | | charges.tariff_id -> tariffs.id | 0 | int | yes | | student_tariffs.student_id -> students.id | 1 | int | no | | student_tariffs.group_id -> study_groups.id | 1 | int | no | | student_tariffs.tariff_id -> tariffs.id | 0 | int | yes | | group_tariffs.group_id -> study_groups.id | 1 | int | no | | group_tariffs.tariff_id -> tariffs.id | 0 | int | yes | | student_groups.student_id -> students.id | 0 | int | yes | | student_groups.group_id -> study_groups.id | 0 | int | yes | | schedule_items.group_id -> study_groups.id | 118 | int | no | | frozen_days.student_id -> students.id | 2 | int | no | | lessons.ed_unit_id -> study_groups.id | 6112 | int | no | | lessons.teacher_id -> users.id | 0 | bigint unsigned | yes | | student_lessons.lesson_id -> lessons.id | 2728 | int | no | | student_lessons.student_id -> students.id | 19085 | int | no | | weekly_tests.lesson_id -> lessons.id | 0 | int | yes | | weekly_test_results.test_id -> weekly_tests.id | 0 | int | yes | | weekly_test_results.student_id -> students.id | 113 | int | no | | students.user_id -> users.id | 0 | bigint unsigned | yes | | students.status_id -> student_statuses.id | 0 | int | yes | | study_groups.teacher_id -> users.id | 0 | bigint unsigned | yes | | teachers.user_id -> users.id | 0 | bigint unsigned | yes | | feedbacks.student_id -> students.id | 3 | int | no | | adviser_tasks.student_id -> students.id | 0 | int | yes | | heroes.student_id -> students.id | 0 | int | yes | | student_achievements.student_id -> students.id | 0 | int | yes | | gamification_coins_ledger.student_id -> students.id | 0 | int | yes | | gamification_xp_ledger.student_id -> students.id | 0 | int | yes | +-----------------------------------------------------+---------+-----------------+----------+ 30 relationship(s) checked, 28187 orphaned row(s) total, 13 not ready for a foreign key. Clean up the orphans and reconcile any type mismatches before adding constraints.