Skip to content

Merge token_blacklist migrations into one (#615)#781

Open
afoalb wants to merge 2 commits into
jazzband:masterfrom
afoalb:fix-blacklist-migrations
Open

Merge token_blacklist migrations into one (#615)#781
afoalb wants to merge 2 commits into
jazzband:masterfrom
afoalb:fix-blacklist-migrations

Conversation

@afoalb

@afoalb afoalb commented Feb 8, 2024

Copy link
Copy Markdown
  • Initial migrations defined id as AutoField, later migrations changed the type to BigAutoField. This conversion is not allowed in MSSQL.

afoalb and others added 2 commits February 8, 2024 20:06
- Initial migrations defined id as AutoField, later migrations changed the type to BigAutoField. This conversion is not allowed in MSSQL
@afoalb afoalb changed the title Merge token_blacklist migrations into one ([#615](https://github.com/jazzband/djangorestframework-simplejwt/issues/615)) Merge token_blacklist migrations into one (#615) Feb 8, 2024
@afoalb

afoalb commented Feb 8, 2024

Copy link
Copy Markdown
Author

I ran all tox tests locally and they all passed. Not clear why they are failling here on github

@50-Course 50-Course left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, Postgres favors BigAutoField. Talking about database-specific implementations:

AutoField as 32-bit INT, and BigAutoField to its 64-bit BIGINT character, in both MySQL and MariaDB.

Notably, AutoField maps to INT (32-bit) or BIGINT (64-bit) depending on DEFAULT_AUTO_FIELD setting or explicit field declaration - which by default is AutoField in django unless otherwise specified.

That said, this is a good move, and should we get the tests up, would be merging this MR

@50-Course

Copy link
Copy Markdown
Member

On deeper considerations, let's review the backwards compatibility that might revolve around this change - potential impact on existing projects.

Thoughts?

@50-Course

Copy link
Copy Markdown
Member

Hi, any updaes?

@Andrew-Chen-Wang

Andrew-Chen-Wang commented Jan 2, 2025

Copy link
Copy Markdown
Member

This would break backwards compatibility. Unlike SQLAlchemy which stores the last migrated revision id, Django migrations are managed by storing each migration name in the database (IIRC). This would still not be great for users who haven't upgraded simplejwt.

If we're looking for MSSQL changes, consider checking whether the database type is MSSQL then run an MSSQL specific change.

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.

3 participants