-
Notifications
You must be signed in to change notification settings - Fork 278
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
Default value of string like field can be empty string ""
or "null"
#626
Conversation
""
or "null"
Looks good! Thanks for the contribution @fishead ❤️ 🙏 |
I'll check why the CI is failing and will update you. |
MariaDB renders the NULL default values as
|
OK, just checked that on https://mariadb.com/kb/en/information-schema-columns-table/ and this patch should solve the issue. Please, add it to the // marDefaultExpr returns the correct schema.Expr based on the column attributes for MariaDB.
func (i *inspect) marDefaultExpr(c *schema.Column, x string) schema.Expr {
+ // Unlike MySQL, NULL means default to NULL or no default.
+ if x == "NULL" {
+ return nil
+ }
// From MariaDB 10.2.7, string-based literals are quoted to distinguish them from expressions.
if i.gteV("10.2.7") && sqlx.IsQuoted(x, '\'') { |
@fishead, you're also welcome to our atlas community on Discord 😃 |
@a8m PR updated. Thanks for the detail. |
💯 |
fix issue #625