Closed gaylonalfano closed 4 years ago
Okay, I may have resolved the directory issue by using the --reload
flag. I'm still trying it out but it seems like I can now run my Nessie commands and the custom paths I configure for migrations and seeds are working. I'll test a bit more and then close.
Update - Yep, the migrationFolder
and seedFolder
settings are now taking effect now that I re-ran the --reload
flag. I need to research more on when it's a good idea to re-run --reload
. Thanks!
System (please complete the following information):
Describe the bug When I initialize Nessie running the standard command:
deno run --allow-net --allow-read --allow-write https://deno.land/x/nessie/cli.ts init
, it creates aproject/db
directory inside my current working directory (project
), as well as the defaultnessie.config.ts
file (project/nessie.config.ts
). That seems standard and no issue there.However, if I want to store my migrations and seeds into a different directory/path structure by changing the
migrationFolder
andseedFolder
paths, it does not seem to work.Here is my current
project/nessie.config.ts
config:To Reproduce Steps to reproduce the behavior:
For example, I can change the default
migrationFolder: "./db/migrations"
to, say,migrationFolder: "./src/app/db/migrations"
andseedFolder: "./src/app/db/seeds"
.I save my changes in
nessie.config.ts
and then, inside my project root folder, I run my firstmake [name]
command to create my first migration:deno run --allow-net --allow-read --allow-write https://deno.land/x/nessie/cli.ts make create_users
. After this command runs, I still end up with aproject/db/migrations/12345_create_users.ts
file, instead of my preferred and configured path ofproject/src/app/db/migrations/12345_create_users.ts
.It's only when I run the Nessie command from my
project/src/app
directory, does Nessie create the nestedproject/src/app/db/migrations
andproject/src/app/db/seeds
directories.Expected behavior My expectation is that my nessie configuration will create my nested directories and store the new migration file inside
project/src/app/db/migrations/11111_create_users.ts
. However, it instead saves the migration file insideproject/db/migrations/11111_create_users.ts
. I have even deleted the default./db
directory (created when I first raninit
with Nessie) and re-ran themake [name]
to create another migration. It still doesn't seem to use the paths specified in mynessie.config.ts
file.Perhaps I'm missing something. I just assumed that my
nessie.config.ts
config would store my migration files and seed files in the relative paths I specify formigrationsFolder
andseedFolder
, but perhaps I'm missing something. For now, I just make sure I am in myproject/src/app
directory before I run any Nessie commands. Please let me know if I can provide anything else.