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

Migrations on releases of different runtimes #6987

Closed
livarcocc opened this issue Nov 10, 2016 · 5 comments
Closed

Migrations on releases of different runtimes #6987

livarcocc opened this issue Nov 10, 2016 · 5 comments

Comments

@livarcocc
Copy link

I am attempting to publish my application to win10-x64 from a Ubuntu 16.04 system. I am able to publish it correctly but how do I go about adding the migration and updating the database?

I tried using --configuration release flag for dotnet ef, but it defaults to ubuntu-16.04 runtime and creates the migration and database for it instead of the win10-x64. I tried adding the dotnet ef commands to a postpublish script but it does it for the compiled debug.

Thanks

Moving here from https://github.com/dotnet/cli/issues/4678

@divega divega added this to the 1.2.0 milestone Nov 11, 2016
@bricelam bricelam added the tools label Nov 28, 2016
@bricelam bricelam modified the milestones: 1.2.0, tools-1.0.0 Nov 29, 2016
@bricelam bricelam modified the milestones: 2.0.0, tools-1.0.0 Dec 16, 2016
@bricelam
Copy link
Contributor

bricelam commented Jan 10, 2017

@MikeRavenelle Could you describe your scenario a little more? How are you making the connection strings runtime-specific? Why are aren't you using the same set of migrations for all runtimes?

The landscape has also probably changed a bit with the move to MSBuild. Making an app standalone, is now purely a publish time thing; It no longer affects design time.

@bricelam
Copy link
Contributor

If you want to play around with this on the latest bits (to see if it's still a problem), see #7358 for details.

@MikeRavenelle
Copy link

@bricelam This issue was purely for executing a migrations post publish on the command line. I alternatively wrote code into my application to handle migration instead of relying on the command line tool. The issue was that I could not specify what runtime to generate the migration on. This was primarily an issue when using SQLite since the database file would not be generated for that specific runtime. I have not attempted to see if this was resolved using MSBuild, I will try that out. Thanks.

@bricelam
Copy link
Contributor

bricelam commented Jan 10, 2017

Oh interesting. I think your solution of doing this at runtime is the right approach, but let us know if you think it could be improved on the MSBuild version.

@bricelam
Copy link
Contributor

Closing for now. Re-open if you have any suggestions on how we can improve this scenario.

@bricelam bricelam removed this from the tools/1.0.0 milestone Jan 23, 2017
@bricelam bricelam removed their assignment Jan 23, 2017
@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants