Allow foreign table constraint without columns (#1608)

This commit is contained in:
Ramnivas Laddad 2024-12-19 01:10:53 -08:00 committed by GitHub
parent fac84d81ee
commit 6523dabcf8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 3 deletions

View file

@ -885,12 +885,14 @@ impl fmt::Display for TableConstraint {
} => {
write!(
f,
"{}FOREIGN KEY ({}) REFERENCES {}({})",
"{}FOREIGN KEY ({}) REFERENCES {}",
display_constraint_name(name),
display_comma_separated(columns),
foreign_table,
display_comma_separated(referred_columns),
)?;
if !referred_columns.is_empty() {
write!(f, "({})", display_comma_separated(referred_columns))?;
}
if let Some(action) = on_delete {
write!(f, " ON DELETE {action}")?;
}