Skip to content

Commit

Permalink
atlasexec: add dirName, url and drvier to migrate apply output (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenlu authored Jun 16, 2024
1 parent 3550d0d commit 65d85b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions atlasexec/atlas_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type (
}
// MigrateApply contains a summary of a migration applying attempt on a database.
MigrateApply struct {
Env
Pending []File `json:"Pending,omitempty"` // Pending migration files
Applied []*AppliedFile `json:"Applied,omitempty"` // Applied files
Current string `json:"Current,omitempty"` // Current migration version
Expand Down
5 changes: 4 additions & 1 deletion atlasexec/atlas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ func Test_MigrateApply(t *testing.T) {
Env: "test",
})
require.NoError(t, err)
require.EqualValues(t, "20230926085734", got.Target)
require.Equal(t, "sqlite3", got.Env.Driver)
require.Equal(t, "migrations", got.Env.Dir)
require.Equal(t, "sqlite://file?_fk=1&cache=shared&mode=memory", got.Env.URL.String())
require.Equal(t, "20230926085734", got.Target)
// Add dirty changes and try again
os.Setenv("DB_URL", "sqlite://test.db?_fk=1&cache=shared&mode=memory")
drv, err := sql.Open("sqlite3", "test.db")
Expand Down

0 comments on commit 65d85b6

Please sign in to comment.