mirror of https://github.com/status-im/migrate.git
parent
144aaaa986
commit
46fb82ce3d
|
@ -160,7 +160,6 @@ func (ch *ClickHouse) SetVersion(version int, dirty bool) error {
|
|||
return tx.Commit()
|
||||
}
|
||||
|
||||
|
||||
// ensureVersionTable checks if versions table exists and, if not, creates it.
|
||||
// Note that this function locks the database, which deviates from the usual
|
||||
// convention of "caller locks" in the ClickHouse type.
|
||||
|
|
|
@ -61,6 +61,7 @@ func WithInstance(instance *sql.DB, config *Config) (database.Driver, error) {
|
|||
}
|
||||
return mx, nil
|
||||
}
|
||||
|
||||
// ensureVersionTable checks if versions table exists and, if not, creates it.
|
||||
// Note that this function locks the database, which deviates from the usual
|
||||
// convention of "caller locks" in the Ql type.
|
||||
|
|
|
@ -53,7 +53,7 @@ Commands:
|
|||
goto V Migrate to version V
|
||||
up [N] Apply all or N up migrations
|
||||
down [N] Apply all or N down migrations
|
||||
drop Drop everyting inside database
|
||||
drop Drop everything inside database
|
||||
force V Set version V but don't run migration (ignores dirty state)
|
||||
version Print current migration version
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Package vfs contains a driver that reads migrations from a virtual file
|
||||
// Package godoc_vfs contains a driver that reads migrations from a virtual file
|
||||
// system.
|
||||
//
|
||||
// Implementations of the filesystem interface that read from zip files and
|
||||
|
|
|
@ -67,7 +67,7 @@ func (i *Migrations) Append(m *Migration) (ok bool) {
|
|||
|
||||
func (i *Migrations) buildIndex() {
|
||||
i.index = make(uintSlice, 0)
|
||||
for version, _ := range i.migrations {
|
||||
for version := range i.migrations {
|
||||
i.index = append(i.index, version)
|
||||
}
|
||||
sort.Sort(i.index)
|
||||
|
|
2
util.go
2
util.go
|
@ -23,7 +23,7 @@ func NewMultiError(errs ...error) MultiError {
|
|||
return MultiError{compactErrs}
|
||||
}
|
||||
|
||||
// Error implements error. Mulitple errors are concatenated with 'and's.
|
||||
// Error implements error. Multiple errors are concatenated with 'and's.
|
||||
func (m MultiError) Error() string {
|
||||
var strs = make([]string, 0)
|
||||
for _, e := range m.Errs {
|
||||
|
|
Loading…
Reference in New Issue