Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script output ends up in unexpected directory #10036

Closed
scottsauber opened this issue Oct 10, 2017 · 1 comment
Closed

Script output ends up in unexpected directory #10036

scottsauber opened this issue Oct 10, 2017 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@scottsauber
Copy link

scottsauber commented Oct 10, 2017

I have two projects. For simplicity lets call them Widgets.Core and Widgets.UI. Widgets.Core is a netstandard2 library and houses all my EF models and DbContexts, so I run my migrations from there. Widgets.UI is my ASP.NET Core front end running on .NET Core 2.

I want all my .cs migrations to go to Widgets.Core\Data\Migrations. I also want to generate .sql migrations and have them go to Widgets.Core\Data\Migrations\SQL.

When I'm in the Widgets.Core project at the command land I run:
dotnet ef migrations add MigrationName --startup-project ..\Widgets.UI\Widgets.UI.csproj --output-dir Data\Migrations everything works fine

Within the same directory if I run
dotnet ef migrations script --startup-project ..\Widgets.UI\Widgets.UI.csproj --output Data\Migrations\SQL\MigrationName.sql

This SQL script ends up in the Widgets.UI, not Widgets.Core. I would expect --output-dir in ef migrations add to behave the same as --output in ef migrations script and output in the my current directory, not the directory of my startup project.

Obviously I can just .. my way back, but would be nice if these behaved the same.

@bricelam
Copy link
Contributor

bricelam commented Oct 11, 2017

In order for Hosting to work correctly, we set the working directory to the startup project directory.

Ideally yes, relative --output paths should probably be resolved from the original working directory...

@ajcvickers ajcvickers added this to the 2.1.0 milestone Oct 11, 2017
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview1, 2.1.0 Jan 17, 2018
@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Mar 27, 2018
@ajcvickers ajcvickers modified the milestones: 2.1.0-preview2, 2.1.0 Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants