§ }<ˆj ã ó — d Z ddlZddlmZmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZ d „ Z G d „ dej ¦ « Z G d„ d ej ¦ « Zd„ Zd„ Zd„ ZdS )z� Various suggestions around migrations. Disabled by default! Enable with pylint --load-plugins=pylint_django.checkers.migrations é N)ÚcheckersÚ interfaces)Úutils)Úsuppress_message)Úcompat)ÚBASE_ID)Úis_migrations_modulec ó — t | j t j ¦ « sdS | j j dk sdS | j D ]J}|j dk r=t |j t j ¦ « r|j j D ]}|j dk r dS ŒŒKdS )NFÚAddFieldÚfieldÚdefaultT) Ú isinstanceÚfuncÚastroidÚ AttributeÚattrnameÚkeywordsÚargÚvalueÚCall)ÚcallÚkeywordÚ field_keywords ús/builddir/build/BUILD/cloudlinux-venv-1.0.12/venv/lib/python3.11/site-packages/pylint_django/checkers/migrations.pyÚ_is_addfield_with_defaultr sž € Ý�d”i¥Ô!2Ñ3Ô3ð ØˆuàŒ9Ô Ò+Ð+؈uà”=ð ð ˆàŒ;˜'Ò!Ð!¥j°´ÅÄÑ&MÔ&MÐ!ð ")¤Ô!7ð ð � Ø Ô$¨ Ò1Ð1ؘ4˜4˜4ð 2øð ˆ5ó c ó| — e Zd ZdZej fZdZde› d�diZ g Z i Zd„ Zd„ Z ej d¦ « d„ ¦ « Zd S ) ÚNewDbFieldWithDefaultCheckera¼ Looks for migrations which add new model fields and these fields have a default value. According to Django docs this may have performance penalties especially on large tables: https://docs.djangoproject.com/en/2.0/topics/migrations/#postgresql The preferred way is to add a new DB column with null=True because it will be created instantly and then possibly populate the table with the desired default values. únew-db-field-with-defaultÚWÚ98)z%s AddField with default valuer zKUsed when Pylint detects migrations adding new fields with a default value.c ó\ — t |¦ « r| j |¦ « d S d S ©N)r Ú_migration_modulesÚappend)ÚselfÚnodes r Úvisit_modulez)NewDbFieldWithDefaultChecker.visit_moduleE s9 € Ý Ñ%Ô%ð 1ØÔ#×*Ò*¨4Ñ0Ô0Ð0Ð0Ð0ð 1ð 1r c ó — | ¦ « j }n# Y d S xY wt |¦ « sd S t |¦ « rD|| j vr g | j |<