@@ -135,8 +135,8 @@ extension Table {
135
135
}
136
136
137
137
// MARK: - CREATE INDEX
138
-
139
- public func createIndex( _ columns: Expressible ... , unique: Bool = false , ifNotExists: Bool = false ) -> String {
138
+
139
+ public func createIndex( _ columns: [ Expressible ] , unique: Bool = false , ifNotExists: Bool = false ) -> String {
140
140
let clauses : [ Expressible ? ] = [
141
141
create ( " INDEX " , indexName ( columns) , unique ? . unique : nil , ifNotExists) ,
142
142
Expression < Void > ( literal: " ON " ) ,
@@ -146,12 +146,20 @@ extension Table {
146
146
147
147
return " " . join ( clauses. compactMap { $0 } ) . asSQL ( )
148
148
}
149
+
150
+ public func createIndex( _ columns: Expressible ... , unique: Bool = false , ifNotExists: Bool = false ) -> String {
151
+ return createIndex ( Array ( columns) , unique: unique, ifNotExists: ifNotExists)
152
+ }
149
153
150
154
// MARK: - DROP INDEX
151
-
152
- public func dropIndex( _ columns: Expressible ... , ifExists: Bool = false ) -> String {
155
+
156
+ public func dropIndex( _ columns: [ Expressible ] , ifExists: Bool = false ) -> String {
153
157
drop ( " INDEX " , indexName ( columns) , ifExists)
154
158
}
159
+
160
+ public func dropIndex( _ columns: Expressible ... , ifExists: Bool = false ) -> String {
161
+ dropIndex ( Array ( columns) , ifExists: ifExists)
162
+ }
155
163
156
164
fileprivate func indexName( _ columns: [ Expressible ] ) -> Expressible {
157
165
let string = ( [ " index " , clauses. from. name, " on " ] + columns. map { $0. expression. template } ) . joined ( separator: " " ) . lowercased ( )
0 commit comments