Skip to content

Commit

Permalink
Merge pull request #30 from wismna/patch-1
Browse files Browse the repository at this point in the history
Surround index column name with brackets
  • Loading branch information
caiiiycuk authored Dec 11, 2024
2 parents c8a6fca + 80721e3 commit 3316220
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object CreateIndex extends Command with Log {
val createIndexParts = rawSql.split("""\s+on\s+""")
val indexName = createIndexParts(0).tokens(INDEX_NAME_POSITION)
val tableName = createIndexParts(1).tokens(TABLE_NAME_POSITION)
val columns = rawSql.takeBraces.head.columns.map(_.name).mkString(",")
val columns = rawSql.takeBraces.head.columns.map(column => s"[${column.name}]").mkString(",")

(tableName, s"CREATE INDEX $indexName ON $tableName ($columns)", columns)
} catch {
Expand Down

0 comments on commit 3316220

Please sign in to comment.