# Path: psqlextra/partitioning/error.py
# class PostgresPartitioningError(RuntimeError):
#     """Raised when the partitioning configuration is broken or automatically
#     creating/deleting partitions fails."""


from typing import Optional
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.module_loading import import_string
from psqlextra.partitioning import PostgresPartitioningError
        if dry:
            return

        if not yes:
            print("Do you want to proceed? (y/N) ")

            if not self._ask_for_confirmation():
                print("Operation aborted.")
                return

        plan.apply(using=using)
        print("Operations applied.")

    @staticmethod
    def _ask_for_confirmation() -> bool:
        answer = input("").lower()
        if not answer:
            return False

        if answer[0] == "y" or answer == "yes":
            return True

        return False

    @staticmethod
    def _partitioning_manager():
        partitioning_manager = getattr(
            settings, "PSQLEXTRA_PARTITIONING_MANAGER", None
        )
        if not partitioning_manager:

# Path: psqlextra/partitioning/error.py
# class PostgresPartitioningError(RuntimeError):
#     """Raised when the partitioning configuration is broken or automatically
#     creating/deleting partitions fails."""


# Path: psqlextra/management/commands/pgpartition.py
from typing import Optional
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.module_loading import import_string
from psqlextra.partitioning import PostgresPartitioningError

        if dry:
            return

        if not yes:
            print("Do you want to proceed? (y/N) ")

            if not self._ask_for_confirmation():
                print("Operation aborted.")
                return

        plan.apply(using=using)
        print("Operations applied.")

    @staticmethod
    def _ask_for_confirmation() -> bool:
        answer = input("").lower()
        if not answer:
            return False

        if answer[0] == "y" or answer == "yes":
            return True

        return False

    @staticmethod
    def _partitioning_manager():
        partitioning_manager = getattr(
            settings, "PSQLEXTRA_PARTITIONING_MANAGER", None
        )
        if not partitioning_manager:

            raise PostgresPartitioningError(