uptrace / go-clickhouse

Golang ClickHouse client
https://clickhouse.uptrace.dev
BSD 2-Clause "Simplified" License
253 stars 27 forks source link

Head of master not applying unapplied migrations #30

Closed ryanrolds closed 2 years ago

ryanrolds commented 2 years ago

It looks like the MigrationGroup at https://github.com/uptrace/go-clickhouse/blob/master/chmigrate/migrator.go#L150-L153, is always empty as group.Migrations isn't being set to the unapplied migrations. I assume the range should be on migrations.

ryanrolds commented 2 years ago

Bonus question, should group.Migrations = migrations[:i+1] be dependent on the success of the "up" when only making as applied on success? I think the expectation is that the returned group are only migrations that got marked as applied, which varies based on that flag.