mirror of https://github.com/status-im/migrate.git
Merge pull request #15 from vkonstantin/feature/pg_version
Return one row with last version from postgres
This commit is contained in:
commit
5342ee5a3c
|
@ -109,7 +109,7 @@ func (driver *Driver) Migrate(f file.File, pipe chan interface{}) {
|
|||
|
||||
func (driver *Driver) Version() (uint64, error) {
|
||||
var version uint64
|
||||
err := driver.db.QueryRow("SELECT version FROM " + tableName + " ORDER BY version DESC").Scan(&version)
|
||||
err := driver.db.QueryRow("SELECT version FROM " + tableName + " ORDER BY version DESC LIMIT 1").Scan(&version)
|
||||
switch {
|
||||
case err == sql.ErrNoRows:
|
||||
return 0, nil
|
||||
|
|
Loading…
Reference in New Issue