mirror of https://github.com/pressly/goose.git
rename only: DBVersion => MigrationRecord
parent
949df006a9
commit
c1320a5e81
|
@ -50,7 +50,7 @@ func statusRun(cmd *Command, args ...string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func printMigrationStatus(db *sql.DB, version int, script string) {
|
func printMigrationStatus(db *sql.DB, version int, script string) {
|
||||||
var row DBVersion
|
var row MigrationRecord
|
||||||
q := fmt.Sprintf("SELECT tstamp, is_applied FROM goose_db_version WHERE version_id=%d ORDER BY tstamp DESC LIMIT 1", version)
|
q := fmt.Sprintf("SELECT tstamp, is_applied FROM goose_db_version WHERE version_id=%d ORDER BY tstamp DESC LIMIT 1", version)
|
||||||
e := db.QueryRow(q).Scan(&row.TStamp, &row.IsApplied)
|
e := db.QueryRow(q).Scan(&row.TStamp, &row.IsApplied)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DBVersion struct {
|
type MigrationRecord struct {
|
||||||
VersionId int
|
VersionId int
|
||||||
TStamp time.Time
|
TStamp time.Time
|
||||||
IsApplied bool // was this a result of up() or down()
|
IsApplied bool // was this a result of up() or down()
|
||||||
|
@ -215,7 +215,7 @@ func ensureDBVersion(db *sql.DB) (int, error) {
|
||||||
toSkip := make([]int, 0)
|
toSkip := make([]int, 0)
|
||||||
|
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var row DBVersion
|
var row MigrationRecord
|
||||||
if err = rows.Scan(&row.VersionId, &row.IsApplied); err != nil {
|
if err = rows.Scan(&row.VersionId, &row.IsApplied); err != nil {
|
||||||
log.Fatal("error scanning rows:", err)
|
log.Fatal("error scanning rows:", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue