You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
We don't know if it's related to the fact that the deprecate_field for a foreign key field is not generating a migration for the change (3YOURMIND/django-deprecate-fields#21).
We couldn't find any steps describing how to remove a foreign key and that's why we open this issue.
We are on Django 3.2.9.
And if we remove the field that it is not being referenced anymore. Generate the migration and run it to remove the field we can see in the database that the field is removed successfully.
We could try to ignore the linter but we wonder if it has a way to make the linter happy. The issue is that we use the linter in our CI/CD and it's failing the builds. It complains about the dropping field operation:
❯ ./manage.py makemigrations --check
Migrations for 'our_app':
our_app/migrations/0110_remove_category.py
- Remove field category from modelcategory
Linting for 'our_app':
[30-Dec-2021 13:48:04] [INFO/django_migration_linter] [MESSAGE: Calling sqlmigrate command our_app 0110_remove_category]
(our_appa, 0110_remove_category)... ERR
DROPPING columns (table: ourapp_ourmodel, column: category_id)
The migration linter detected that this migration is not backward compatible.
- If you keep the migration, you will want to fix the issue or ignore the migration.
- By default, the newly created migration file will be deleted.
Do you want to keep the migration? [y/N]
The text was updated successfully, but these errors were encountered:
This is one of the cases where I'd recommend to ignore the generated migration (if it only contains the FK column drop).
The linter cannot really know if one is just dropping a column unconsciously or if the column is actually unused.
Therefore => dropping a column raises as a linting error.
Hi
We don't know if it's related to the fact that the
deprecate_field
for a foreign key field is not generating a migration for the change (3YOURMIND/django-deprecate-fields#21).We couldn't find any steps describing how to remove a foreign key and that's why we open this issue.
We are on Django 3.2.9.
And if we remove the field that it is not being referenced anymore. Generate the migration and run it to remove the field we can see in the database that the field is removed successfully.
We could try to ignore the linter but we wonder if it has a way to make the linter happy. The issue is that we use the linter in our CI/CD and it's failing the builds. It complains about the dropping field operation:
The text was updated successfully, but these errors were encountered: