Skip to content
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

Added SQLite support for PasswordType #254

Merged
merged 1 commit into from
Nov 19, 2016

Conversation

frol
Copy link
Contributor

@frol frol commented Nov 8, 2016

This change fixes the issue of column type mismatch on SQLite as VARBINARY type fallbacks to NUMERIC, and in the end, Alembic always detects changes in my project:

Detected type change from NUMERIC(precision=128) to PasswordType(max_length=128) on 'user.password'

According to this reply on SQLAlchemy support forum, sa.VARBINARY is not a good fallback, but I have no idea on how would a correct implementation look like, so I only added SQLite support.

Originally, I thought my problem is reported in #106, but it turned out to be another not quite closely related issue.

#233 is another enhancement for PasswordType, which, in fact, solves #106.

@frol
Copy link
Contributor Author

frol commented Nov 9, 2016

Weird! SQLite used NUMERIC type as a fallback for the column when it used to be VARBINARY, but once I tried to set it as NUMERIC on the Python side, it broke... Anyway, I didn't feel like NUMERIC is the proper type for PasswordType, so I choose sqlite.BLOB type for it.

@kvesteri All tests are green now.

frol added a commit to frol/flask-restplus-server-example that referenced this pull request Nov 18, 2016
@kvesteri kvesteri merged commit 287f43e into kvesteri:master Nov 19, 2016
@kvesteri
Copy link
Owner

Thanks for the PR! 🚋

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.

None yet

2 participants