diff options
Diffstat (limited to 'qlite/src')
-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)"; |