summaryrefslogtreecommitdiff
path: root/lib/output
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-07-05 20:27:55 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2021-07-05 20:27:55 +0100
commit8d61f54668bba1a73cc1dc2fe13df625001866a7 (patch)
tree8da04267ff9d146b13858eb1e26d29315d8ba190 /lib/output
parentModernize namespaces (diff)
downloadmygrate-8d61f54668bba1a73cc1dc2fe13df625001866a7.tar.bz2
mygrate-8d61f54668bba1a73cc1dc2fe13df625001866a7.tar.xz
mygrate-8d61f54668bba1a73cc1dc2fe13df625001866a7.zip
Add missing braces
Diffstat (limited to 'lib/output')
-rw-r--r--lib/output/pq/updateDatabase.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/output/pq/updateDatabase.cpp b/lib/output/pq/updateDatabase.cpp
index 907ee60..b8e27ba 100644
--- a/lib/output/pq/updateDatabase.cpp
+++ b/lib/output/pq/updateDatabase.cpp
@@ -79,13 +79,16 @@ namespace MyGrate::Output::Pq {
TypeMapper tm;
for (auto col : *cols) {
output::pq::sql::insertColumn::execute(this, col[0], col.currentRow(), table_id);
- if (col.currentRow())
+ if (col.currentRow()) {
ct << ',';
+ }
scprintf<"%? %?">(ct, col[0], tm.map(col[2], scprintf<"%?.%?">(tableName, col[0])));
- if (!col[1])
+ if (!col[1]) {
ct << " not null";
- if (col[3])
+ }
+ if (col[3]) {
ct << " primary key";
+ }
tableDef->columns.push_back(std::make_unique<ColumnDef>(col[0], tableDef->columns.size() + 1, col[3]));
}
ct << ")";