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
Order of columns in the table created does not have 'id' first, despite the order in the SQLModel. Looks like it's prioritising fields with sa_column #542
Comments
I've just encountered this problem too - it originates from the way sqlalchemy deals with a My workaround ended up exploiting
Works well enough (negligible perf impact since it's at class generation time), though would be obsoleted by #436 . |
i copy your code and run ,but its not work , resource_data in the first |
Is this still a problem? I cannot reproduce it (sqlmodel 0.0.18, sqlalchemy 2.0.29):
|
First Check
Commit to Help
Example Code
Description
The CREATE table script generated for the model above ends up putting resource_data as the first column, instead of preserving the natural order of 'id' first
This feels unusual when I inspect my postgresql tables in a db tool like pgAdmin.
How do I ensure the table is created with the 'natural' order?
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.8
Python Version
3.11.1
Additional Context
No response
The text was updated successfully, but these errors were encountered: