π Sid Gifari File Manager Pro
v8.0.5 | 2026-06-15 04:05:18 | PHP 8.1.34
π
/ (Root)
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pylint_django
/
tests
/
input
/
migrations
π /opt/cloudlinux/venv/lib/python3.11/site-packages/pylint_django/tests/input/migrations
π Refresh
βοΈ
Editing: 0002_new_column.py
Read Only
""" Migration file which adds a new column with a default value. This should trigger a warning because adding new columns with default value on a large table leads to DB performance issues. See: https://github.com/PyCQA/pylint-django/issues/118 and https://docs.djangoproject.com/en/2.0/topics/migrations/#postgresql > ... adding columns with default values will cause a full rewrite of > the table, for a time proportional to its size. > For this reason, itβs recommended you always create new columns with > null=True, as this way they will be added immediately. """ # pylint: disable=missing-docstring, invalid-name from datetime import timedelta from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("input", "0001_noerror_initial"), ] operations = [ # add a timedelta field migrations.AddField( # [new-db-field-with-default] model_name="testrun", name="estimated_time", field=models.DurationField(default=timedelta(0)), ), ]
πΎ Save Changes
β Cancel