OwlCyberSecurity - MANAGER
Edit File: loader.cpython-39.pyc
a ���e�A � @ s~ d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl m Z d dlmZ ddl mZmZmZmZ d ZG d d� d�ZdS )� N)� import_module�reload)�apps)�settings)�MigrationGraph)�MigrationRecorder� )�AmbiguityError�BadMigrationError�InconsistentMigrationHistory�NodeNotFoundErrorZ migrationsc @ s� e Zd ZdZddd�Zedd� �Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� Zdd� Z dd� Zdd� Zd dd�Zdd� ZdS )!�MigrationLoaderal Load migration files from disk and their status from the database. Migration files are expected to live in the "migrations" directory of an app. Their names are entirely unimportant from a code perspective, but will probably follow the 1234_name.py convention. On initialization, this class will scan those directories, and open and read the Python files, looking for a class called Migration, which should inherit from django.db.migrations.Migration. See django.db.migrations.migration for what that looks like. Some migrations will be marked as "replacing" another set of migrations. These are loaded into a separate set of migrations away from the main ones. If all the migrations they replace are either unapplied or missing from disk, then they are injected into the main set, replacing the named migrations. Any dependency pointers to the replaced migrations are re-pointed to the new migration. This does mean that this class MUST also talk to the database as well as to disk, but this is probably fine. We're already not just operating in memory. TFc C s. || _ d | _d | _|| _|| _|r*| �� d S �N)� connection�disk_migrations�applied_migrations�ignore_no_migrations�replace_migrations�build_graph)�selfr �loadr r � r �\/home/gouroczh/virtualenv/pat/3.9/lib/python3.9/site-packages/django/db/migrations/loader.py�__init__- s zMigrationLoader.__init__c C s8 |t jv rt j| dfS t�|�j}d|tf dfS dS )z� Return the path to the migrations module for the specified app_label and a boolean indicating if the module is specified in settings.MIGRATION_MODULE. T�%s.%sFN)r ZMIGRATION_MODULESr Zget_app_config�name�MIGRATIONS_MODULE_NAME)�cls� app_labelZapp_package_namer r r �migrations_module<