2025-10-14 17:38:35,968 - INFO - ============================================================
2025-10-14 17:38:35,968 - INFO - FIXING DJANGO MIGRATION CONFLICTS
2025-10-14 17:38:35,968 - INFO - ============================================================
2025-10-14 17:38:36,303 - INFO - Django environment setup successful
2025-10-14 17:38:36,303 - INFO - Step 1: Checking current migration status...
2025-10-14 17:38:36,303 - INFO - Running: Check migration status
2025-10-14 17:38:36,303 - INFO - Command: python manage.py showmigrations users
2025-10-14 17:38:38,168 - INFO - [SUCCESS] Check migration status
2025-10-14 17:38:38,170 - INFO - Output: users
 [X] 0001_initial
 [X] 0002_alter_customuser_id_alter_customuser_monthly_income
 [X] 0003_customuser_logbook_customuser_signature_and_more
 [X] 0004_customuser_capital_invested_customuser_county_and_more
 [X] 0005_alter_customuser_role_alter_rolepermission_role
 [X] 0006_add_portfolio_management
 [X] 0007_customuser_profile_image
 [X] 0008_customuser_is_email_verified_and_more
 [X] 0009_customuser_registration_fee_amount_and_more
 [X] 0010_add_enhanced_permissions
 [X] 0011_manual_add_is_default
 [X] 0012_branch
 [X] 0013_customuser_accessible_branches_customuser_branch
 [X] 0014_fix_custom_user_tables
 [X] 0015_alter_rolepermission_is_default
 [X] 0017_add_mpesa_fields_only
 [X] 0018_add_unassigned_date_field
 [X] 0019_remove_rolepermission_role_permis_role_056d99_idx_and_more
 [X] 0020_remove_rolepermission_role_permis_role_056d99_idx_and_more
 [X] 0021_update_module_field_length
 [X] 0022_remove_rolepermission_role_permis_role_056d99_idx_and_more

2025-10-14 17:38:38,170 - INFO - Step 2: Merging conflicting migrations...
2025-10-14 17:38:38,170 - INFO - Running: Merge conflicting migrations
2025-10-14 17:38:38,170 - INFO - Command: python manage.py makemigrations --merge users
2025-10-14 17:38:40,270 - INFO - [SUCCESS] Merge conflicting migrations
2025-10-14 17:38:40,270 - INFO - Output: No conflicts detected to merge.

2025-10-14 17:38:40,270 - INFO - Step 3: Creating missing migrations...
2025-10-14 17:38:40,271 - INFO - Running: Create missing migrations
2025-10-14 17:38:40,271 - INFO - Command: python manage.py makemigrations users
2025-10-14 17:38:42,188 - INFO - [SUCCESS] Create missing migrations
2025-10-14 17:38:42,188 - INFO - Output: No changes detected in app 'users'

2025-10-14 17:38:42,188 - INFO - Step 4: Applying migrations...
2025-10-14 17:38:42,188 - INFO - Running: Apply migrations
2025-10-14 17:38:42,188 - INFO - Command: python manage.py migrate users
2025-10-14 17:38:44,255 - INFO - [SUCCESS] Apply migrations
2025-10-14 17:38:44,255 - INFO - Output: Operations to perform:
  Apply all migrations: users
Running migrations:
  No migrations to apply.

2025-10-14 17:38:44,255 - INFO - Step 5: Verifying the fix...
2025-10-14 17:38:44,262 - INFO - [SUCCESS] user_permissions table is working correctly
2025-10-14 17:38:44,262 - INFO - ============================================================
2025-10-14 17:38:44,262 - INFO - MIGRATION CONFLICTS FIXED SUCCESSFULLY!
2025-10-14 17:38:44,262 - INFO - The user_permissions table should now work correctly.
2025-10-14 17:38:44,262 - INFO - ============================================================
