-
Notifications
You must be signed in to change notification settings - Fork 27
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
Reset SQL migrations #119
Reset SQL migrations #119
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so sorry if you already had plans to add these.
.primary_key(), | ||
) | ||
.col(ColumnDef::new(KeyValue::RecordId).integer().not_null()) | ||
.col(ColumnDef::new(KeyValue::Key).binary().not_null()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need two indexes here:
- an index on
(record_id, key)
unique index. which enforces the constraint and allows quick querying of all the keys for a givenrecord_id
. - an index on only
key
so that we can lookup all the records with a given key.
6476c91
to
b0ac823
Compare
Hadn't thought about most of these indices/queries, so thanks! Currently seeing sea orm generating invalid sql syntax when creating non-unique indices (which is why they're commented out here):
|
I think I ran into this same issue, any chanced you looked upstream to see if this is a known sea-orm issue? Lets move forward at least with the unique ones and open an issue to figure out the non-unique ones at a later date. |
cc9fcf6
to
36ca881
Compare
36ca881
to
3c17d63
Compare
Creates all tables with their needed columns, rather than adding columns later on. Will require a DB wipe.