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

Update a production Sqlite database after publish. #6910

Closed
shaunluttin opened this issue Oct 31, 2016 · 1 comment
Closed

Update a production Sqlite database after publish. #6910

shaunluttin opened this issue Oct 31, 2016 · 1 comment

Comments

@shaunluttin
Copy link

shaunluttin commented Oct 31, 2016

Steps to reproduce

dotnet publish <args> // creates the following directory structure
    
artifacts/
    App.dll
    Database.sqlite
    The-rest-of-the-publish-output
    web.config                
App/
    Migrations/
    Program.cs
    project.json
    Startup.cs

dotnet ef --assembly ..\artifacts\App.dll --startup-assembly ..\artifacts\App.dll database update

The issue

Unexpected value '..\artifacts\App.dll' for option 'assembly'

Further technical details

We have also tried other ways to run dotnet ef database update on the compiled project but have not been able to determine how to update the database.

@rowanmiller
Copy link
Contributor

dotnet ef needs to work on a project, and not assemblies. The --assembly argument (and other arguments) are an implementation detail of how dotnet ef called ef.exe to run the operations. dotnet ef shouldn't even allow you to specify these - and we are going to fix that.

We do have an issue tracking the ability to have commands that work on assemblies, rather than a project - #646. You could look at using ef.exe, but it's not a supported scenario as yet, so you'd be mostly on your own working it out.

We do also have a higher level issue tracking a better story for the scenario of deploying migrations #6313.

For the moment, the best option is probably to use the commands to create a deployment script during build (dotnet ef migrations script --idempotent) and then run the script during deployment.

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants