diff options
Diffstat (limited to 'Plugins/SqlEnterpriseFormatter/formatcreateindex.cpp')
| -rw-r--r-- | Plugins/SqlEnterpriseFormatter/formatcreateindex.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/Plugins/SqlEnterpriseFormatter/formatcreateindex.cpp b/Plugins/SqlEnterpriseFormatter/formatcreateindex.cpp index ac5fd7c..7a984bd 100644 --- a/Plugins/SqlEnterpriseFormatter/formatcreateindex.cpp +++ b/Plugins/SqlEnterpriseFormatter/formatcreateindex.cpp @@ -19,25 +19,13 @@ void FormatCreateIndex::formatInternal() if (createIndex->ifNotExistsKw) withKeyword("IF").withKeyword("NOT").withKeyword("EXISTS"); - if (dialect == Dialect::Sqlite2) - { - withId(createIndex->index).withKeyword("ON"); + if (!createIndex->database.isNull()) + withId(createIndex->database).withIdDot(); - if (!createIndex->database.isNull()) - withId(createIndex->database).withIdDot(); + withId(createIndex->index).withKeyword("ON").withId(createIndex->table).withParDefLeft().withStatementList(createIndex->indexedColumns).withParDefRight(); - withId(createIndex->table).withParDefLeft().withStatementList(createIndex->indexedColumns).withParDefRight().withConflict(createIndex->onConflict); - } - else - { - if (!createIndex->database.isNull()) - withId(createIndex->database).withIdDot(); - - withId(createIndex->index).withKeyword("ON").withId(createIndex->table).withParDefLeft().withStatementList(createIndex->indexedColumns).withParDefRight(); - - if (createIndex->where) - withKeyword("WHERE").withStatement(createIndex->where); - } + if (createIndex->where) + withKeyword("WHERE").withStatement(createIndex->where); withSemicolon(); } |
