Skip to content

Commit

Permalink
fix: status
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisvisco committed Oct 31, 2024
1 parent d70ceed commit 818266e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/amigo/amigo.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (a Amigo) GenerateMigrationsFiles(writer io.Writer) error {

// GetStatus return the state of the database
func (a Amigo) GetStatus(db *sql.DB) ([]string, error) {
rows, err := db.Query("SELECT id FROM " + a.ctx.SchemaVersionTable + " ORDER BY id desc")
rows, err := db.Query("SELECT version FROM " + a.ctx.SchemaVersionTable + " ORDER BY version desc")
if err != nil {
return nil, fmt.Errorf("unable to get state: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/templates/migrations.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"embed"
{{if .ImportSchemaPackage}}"{{ .ImportSchemaPackage }}"{{end}}
)

{{if .ImportSchemaPackage}}
//go:embed *.sql
var sqlMigrationsFS embed.FS
{{end}}

var Migrations = []schema.Migration{
{{- range .Migrations }}
Expand Down

0 comments on commit 818266e

Please sign in to comment.