| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/django/db/migrations/__pycache__/ |
Upload File : |
�
�|�e�� � � � d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
d dlmZ d d lmZ d d
lmZmZ d dlmZ G d� d
� � ZdS )� N)�chain)�settings)�models)�
operations)� Migration)�AlterModelOptions)�MigrationOptimizer)�MigrationQuestioner)�COMPILED_REGEX_TYPE�RegexObject)�stable_topological_sortc �: � e Zd ZdZd.d�Zd/d�Zd� Zd� Zd0d�Zd� Z d � Z
ed
� � � Zd.d�Z
d� Zd
� Zd� Zd1d�Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d � Z!d!� Z"d"� Z#d#� Z$d$� Z%d%� Z&d&� Z'd'� Z(d(� Z)d)� Z*d*� Z+d.d+�Z,d,� Z-e.d-� � � Z/dS )2�MigrationAutodetectora
Take a pair of ProjectStates and compare them to see what the first would
need doing to make it match the second (the second usually being the
project's current state).
Note that this naturally operates on entire projects at a time,
as it's likely that changes interact (for example, you can't
add a ForeignKey without having a migration to add the table it
depends on first). A user interface may offer single-app usage
if it wishes, with the caveat that it may not always be possible.
Nc �x � || _ || _ |p
t � � | _ d� |j D � � | _ d S )Nc � � h | ]\ }}|��S � r )�.0�app�models �C/usr/lib/python3/dist-packages/django/db/migrations/autodetector.py� <setcomp>z1MigrationAutodetector.__init__.<locals>.<setcomp>! s � �F�F�F�j�c�5�c�F�F�F� )�
from_state�to_stater
�
questionerr �
existing_apps)�selfr r r s r �__init__zMigrationAutodetector.__init__ sB � �$��� ��
�$�=�(;�(=�(=���F�F�J�4E�F�F�F����r c � � | � ||� � }| � |||� � }|r| � ||� � }|S )z�
Main entry point to produce a list of applicable changes.
Take a graph to base names on and an optional set of apps
to try and restrict to (restriction is not guaranteed)
)�_detect_changes�arrange_for_graph�
_trim_to_apps)r �graph�trim_to_apps�convert_apps�migration_name�changess r r'