# Path: psqlextra/backend/migrations/patched_migrations.py
# @contextmanager
# def postgres_patched_migrations():
#     """Patches migration related classes/functions to extend how Django
#     generates and applies migrations.
# 
#     This adds support for automatically detecting changes in Postgres
#     specific models.
#     """
# 
#     with patched_project_state():
#         with patched_autodetector():
#             yield


from django.core.management.commands import makemigrations
from psqlextra.backend.migrations import postgres_patched_migrations



class Command(makemigrations.Command):
    help = "Creates new PostgreSQL specific migration(s) for apps."

    def handle(self, *app_labels, **options):

# Path: psqlextra/backend/migrations/patched_migrations.py
# @contextmanager
# def postgres_patched_migrations():
#     """Patches migration related classes/functions to extend how Django
#     generates and applies migrations.
# 
#     This adds support for automatically detecting changes in Postgres
#     specific models.
#     """
# 
#     with patched_project_state():
#         with patched_autodetector():
#             yield


# Path: psqlextra/management/commands/pgmakemigrations.py
from django.core.management.commands import makemigrations
from psqlextra.backend.migrations import postgres_patched_migrations




class Command(makemigrations.Command):
    help = "Creates new PostgreSQL specific migration(s) for apps."

    def handle(self, *app_labels, **options):

        with postgres_patched_migrations():