diff options
author | Samuel Hand <samuel.hand@openmailbox.org> | 2018-06-19 11:26:31 +0100 |
---|---|---|
committer | Samuel Hand <samuel.hand@openmailbox.org> | 2018-06-19 11:26:31 +0100 |
commit | 2a8352c5439129798b5141ec021b3b9405840a8a (patch) | |
tree | fcacb76529c0b7535b89a496092aac126cefdbc9 /qlite/src/table.vala | |
parent | 0bcdae34a5dbe5a102281e1b1bc405f5977dc659 (diff) | |
download | dino-2a8352c5439129798b5141ec021b3b9405840a8a.tar.gz dino-2a8352c5439129798b5141ec021b3b9405840a8a.zip |
Database migration and code cleanup
Diffstat (limited to 'qlite/src/table.vala')
-rw-r--r-- | qlite/src/table.vala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/qlite/src/table.vala b/qlite/src/table.vala index 00b4ef00..7fa2fc62 100644 --- a/qlite/src/table.vala +++ b/qlite/src/table.vala @@ -95,10 +95,12 @@ public class Table { public void create_table_at_version(long version) { ensure_init(); string sql = @"CREATE TABLE IF NOT EXISTS $name ("; + bool first = true; for (int i = 0; i < columns.length; i++) { Column c = columns[i]; if (c.min_version <= version && c.max_version >= version) { - sql += @"$(i > 0 ? "," : "") $c"; + sql += @"$(!first ? "," : "") $c"; + first = false; } } sql += @"$constraints)"; |