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
New relations in the migration engine #612
New relations in the migration engine #612
Conversation
}) | ||
.collect() | ||
Ok((model, table)) | ||
}) |
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.
This is an indentation change.
assert_eq!(row["string"].as_str().unwrap(), "test_string"); | ||
|
||
Ok(()) | ||
} |
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.
These two tests are now obsolete (no implicit defaults anymore).
906922e
to
f700954
Compare
@@ -1 +1,2 @@ | |||
edition = "2018" | |||
max_width = 120 |
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.
Yay!
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.
I changed that because rust-analyzer wasn't respecting the limit in rustfmt.toml (we have two of these, need to figure out why).
auto_increment: { | ||
match f.default_value() { | ||
Some(DefaultValue::Expression(ValueGenerator { | ||
name: _, |
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.
Could you use .. here?
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.
yes most definitely, we can even simplify this whole match to a matches!
call. I'll do that.
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.
Simplified to matches!(f.default_value(), Some(DefaultValue::Expression(ValueGenerator { generator: ValueGeneratorFn::Autoincrement, .. })))
f700954
to
a10ba5f
Compare
Also two improvements: - The implicit defaults have been removed - DateTime @default(now()) now sets a proper database default
No description provided.