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

VARCHAR requires a length on dialect mysql #343

Closed
soulee-dev opened this issue Sep 27, 2020 · 2 comments · Fixed by #344
Closed

VARCHAR requires a length on dialect mysql #343

soulee-dev opened this issue Sep 27, 2020 · 2 comments · Fixed by #344
Labels
bug Something isn't working

Comments

@soulee-dev
Copy link
Contributor

soulee-dev commented Sep 27, 2020

Hello

Problem

There is something error on creating tables on MySQL.
sqlalchemy.exc.CompileError: (in table 'user', column 'email'): VARCHAR requires a length on dialect mysql
effected columns
SQLAlchemyBaseUserTable:
email
hashed_password

SQLAlchemyBaseOAuthAccountTable:
oauth_name
access_token
refresh_token
account_id
account_email

https://github.com/frankie567/fastapi-users/blob/0134a43fade100c32588a0bf09d21b1939d24c8e/fastapi_users/db/sqlalchemy.py#L56

According to SQLAlchemy Docs,
CREATE TABLE DDL is issued if a VARCHAR with no length is included.

Solution

Pull request #344

@soulee-dev
Copy link
Contributor Author

I think the best way of solve this problem is adding length to columns.

@nicolaipre
Copy link

I am experiencing the same problem.

@frankie567 frankie567 added the bug Something isn't working label Sep 30, 2020
@frankie567 frankie567 linked a pull request Sep 30, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants