Closed kevinmarquesp closed 1 month ago
Nope, that's not expected. The GOOSE_MIGRATION_DIR
env variable should be a drop-in replacement for for the -dir
flag.
I use zsh
and can't seem to reproduce it (at least locally on my machine). Maybe you could try the following?
goose --version
goose version: v3.22.1
# from the root of this repository
export GOOSE_MIGRATION_DIR=testdata/migrations
goose create some_file sql
2024/10/19 08:39:24 Created new file: testdata/migrations/20241019123924_some_file.sql
tree testdata/migrations/
testdata/migrations/
├── 00001_users_table.sql
├── 00002_posts_table.sql
├── 00003_comments_table.sql
├── 00004_insert_data.sql
├── 00005_posts_view.sql
└── 20241019123924_some_file.sql
1 directory, 6 files
Is it possible it's something to do with the fish shell?
Oh, I'm sorry. I forgot to actually export the variable outside my shell. I was literally typing GOOSE_MIGRATION_DIR=./migrations
and hitting enter.
Fish actually accept this syntax, like export KEY=value
, but in the Fish way is to set a variable with the export flag as set -x KEY value
.
Thanks for actually responding, and sorry for the silly mistake. haha
No worries, it happens to us all :)
Steps to reproduce the bug:
GOOSE_MIGRATION_DIR=./infra/postgres/migrations
, or withset -U GOOSE_MIGRATION_DIR ./infra/postgres/migrations
in my case, I'm using the Fish shell.goose create profile_and_credentials sql
Then the file is created in the current directory. For some reason, it isn't getting the variables from the environment. Is that normal?
I'm using the version 3.22.1, the latest release.