Skip to content

Commit

Permalink
atlasexec: add dev url to migrate down (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
masseelch authored Mar 21, 2024
1 parent 085f965 commit 66e2f2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions atlasexec/atlas.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type (
MigrateDownParams struct {
Env string
ConfigURL string
DevURL string
Context *DeployRunContext
DirURL string
URL string
Expand Down Expand Up @@ -308,6 +309,9 @@ func (c *Client) MigrateDown(ctx context.Context, params *MigrateDownParams) (*M
if params.ConfigURL != "" {
args = append(args, "--config", params.ConfigURL)
}
if params.DevURL != "" {
args = append(args, "--dev-url", params.DevURL)
}
if params.Context != nil {
buf, err := json.Marshal(params.Context)
if err != nil {
Expand Down
7 changes: 7 additions & 0 deletions atlasexec/atlas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,13 @@ func TestMigrateDown(t *testing.T) {
},
expect: "migrate down --format {{ json . }} 10",
},
{
name: "dev-url",
params: &atlasexec.MigrateDownParams{
DevURL: "url",
},
expect: "migrate down --format {{ json . }} --dev-url url",
},
} {
t.Run(tt.name, func(t *testing.T) {
_, err := c.MigrateDown(context.Background(), tt.params)
Expand Down

0 comments on commit 66e2f2b

Please sign in to comment.