Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix sqldiff: do not consider ('serial', 'integer') nor ('bigserial', 'bigint') as a field-type-differ #1867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

nicolaspanel
Copy link
Contributor

@nicolaspanel nicolaspanel commented Apr 1, 2024

After upgrading from Django 3.x to Django 4.2.x sqldiff complains about fictive differences when comparing AutoField to integer

$ python manage.py  sqldiff -a -t                  
+ Application: admin
|-+ Differences for model: LogEntry
|--+ field 'id' not of same type: db='serial', model='integer'
+ Application: auth
|-+ Differences for model: Permission
|--+ field 'id' not of same type: db='serial', model='integer'
|-+ Differences for model: Group_permissions
|--+ field 'id' not of same type: db='serial', model='integer'
|-+ Differences for model: Group
|--+ field 'id' not of same type: db='serial', model='integer'

for some reason db_type=integer is renamed to serial (and db_type=bigint is renamed to bigserial) if it is a PrimaryKey and an AutoField, but the same do not apply to model_type which is leading to fictive diffs

…a `field-type-differ`

`` lead to fictive differences when comparing AutoField to integer
```
$ python manage.py  sqldiff -a -t
+ Application: admin
|-+ Differences for model: LogEntry
|--+ field 'id' not of same type: db='serial', model='integer'
```
@trbs trbs merged commit 0a2d432 into django-extensions:main Apr 4, 2025
@trbs
Copy link
Member

trbs commented Apr 4, 2025

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants