#!/bin/bash

# Remove any duplicate migrations
cd utils/migrations
for f in *.py; do
    if [ -f "$f" ] && [ "$(find . -name "$f" | wc -l)" -gt 1 ]; then
        rm -f "$(find . -name "$f" | tail -n +2)"
    fi
done

# Create a new merge migration
cd ../..
python manage.py makemigrations utils --merge --name merge_20250827_final

