Improved formatting of generated table sql

- Removed empty line before first column
- The follow up lines of fkey's are indented
- The closing parentheses is now on a new line
This commit is contained in:
eelke 2019-12-01 07:09:18 +01:00
parent 2c2253f75e
commit e53b85bd86
3 changed files with 11 additions and 12 deletions

View file

@ -118,7 +118,6 @@ QString PgClass::createTableSql() const
for (auto && col : cols) {
if (col.num > 0 && !col.isdropped) {
if (first) {
sql += "\n ";
first = false;
}
else sql += ",\n ";
@ -136,10 +135,10 @@ QString PgClass::createTableSql() const
first = false;
}
else sql += ",\n ";
sql += getConstraintDefinition(catalog(), constraint);
sql += getConstraintDefinition(catalog(), constraint, " ");
}
sql += ")";
sql += "\n)";
{
// [ INHERITS ( parent_table [, ... ] ) ]
auto parents = catalog().inherits()->getParentsOf(oid());