add on update for my sql (#522)

This commit is contained in:
Andrey Frolov 2022-06-13 15:33:10 +03:00 committed by GitHub
parent ca15a4edbf
commit 99697d26e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View file

@ -2254,6 +2254,12 @@ impl<'a> Parser<'a> {
Ok(Some(ColumnOption::DialectSpecific(vec![
Token::make_keyword("AUTOINCREMENT"),
])))
} else if self.parse_keywords(&[Keyword::ON, Keyword::UPDATE])
&& dialect_of!(self is MySqlDialect)
{
Ok(Some(ColumnOption::DialectSpecific(vec![
Token::make_keyword("ON UPDATE"),
])))
} else {
Ok(None)
}