Skip to content

Commit 8efead9

Browse files
authored
Update clickhouse.go
1 parent 16cb313 commit 8efead9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

database/clickhouse/clickhouse.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,11 @@ func (ch *ClickHouse) ensureVersionTable() (err error) {
247247
sequence UInt64
248248
) Engine=%s`, ch.config.MigrationsTable, ch.config.MigrationsTableEngine)
249249
}
250-
251-
if strings.Contains(ch.config.MigrationsTableEngine, "Tree") {
252-
query = fmt.Sprintf(`%s PRIMARY KEY sequence ORDER BY sequence`, query)
250+
// fix: https://github.com/golang-migrate/migrate/pull/1169/commits/16cb3137a3e6e2e11de04585b66de26a584b6b8c
251+
// if strings.Contains(ch.config.MigrationsTableEngine, "Tree") {
252+
// query = fmt.Sprintf(`%s PRIMARY KEY sequence ORDER BY sequence`, query)
253+
if strings.HasSuffix(ch.config.MigrationsTableEngine, "Tree") {
254+
query = fmt.Sprintf(`%s ORDER BY sequence`, query)
253255
}
254256

255257
if _, err := ch.conn.Exec(query); err != nil {

0 commit comments

Comments
 (0)