Entity Framework Migrations in app with outdated version
I am using the Entity Framework Migrations, at first I am using MigrateDatabaseToLatestVersion for whenever I run on clients the same update for last migration .. until it is working very well .. however a scenario has arisen where the client may be with a version on your machine of your outdated app, in that case the app has an error that my template is different from the database .. any solution to this problem?
c# vb.net entity-framework entity-framework-6
add a comment |
I am using the Entity Framework Migrations, at first I am using MigrateDatabaseToLatestVersion for whenever I run on clients the same update for last migration .. until it is working very well .. however a scenario has arisen where the client may be with a version on your machine of your outdated app, in that case the app has an error that my template is different from the database .. any solution to this problem?
c# vb.net entity-framework entity-framework-6
The database and the app must be consistent unless the code compares the database version with the app version. You can't get data out of a database that doesn't exist nor insert data into a database where the column doesn't exist. So if the database deleted a column a older version of the app will not work on a newer database. If a column was added in a new version of the database an new version of the software will looking for the added column will not work on an older database that doesn't have the column.
– jdweng
Nov 23 '18 at 14:41
I understood, my difficulty is how to handle this scenario when the user opens an old version of the application .. I agree with you that it has to be consistent, but this situation can happen and I have to prepare myself in case it comes to occur ...
– Leonardo Moura
Nov 23 '18 at 14:49
That is why the program must check the version of program and version of database to make sure they are compatible. When they are not then code as to be written to handle the mis-matches in versions.
– jdweng
Nov 23 '18 at 14:52
Thank you for the answer, I'll try this treatment.
– Leonardo Moura
Nov 23 '18 at 21:46
add a comment |
I am using the Entity Framework Migrations, at first I am using MigrateDatabaseToLatestVersion for whenever I run on clients the same update for last migration .. until it is working very well .. however a scenario has arisen where the client may be with a version on your machine of your outdated app, in that case the app has an error that my template is different from the database .. any solution to this problem?
c# vb.net entity-framework entity-framework-6
I am using the Entity Framework Migrations, at first I am using MigrateDatabaseToLatestVersion for whenever I run on clients the same update for last migration .. until it is working very well .. however a scenario has arisen where the client may be with a version on your machine of your outdated app, in that case the app has an error that my template is different from the database .. any solution to this problem?
c# vb.net entity-framework entity-framework-6
c# vb.net entity-framework entity-framework-6
asked Nov 23 '18 at 13:38
Leonardo MouraLeonardo Moura
61
61
The database and the app must be consistent unless the code compares the database version with the app version. You can't get data out of a database that doesn't exist nor insert data into a database where the column doesn't exist. So if the database deleted a column a older version of the app will not work on a newer database. If a column was added in a new version of the database an new version of the software will looking for the added column will not work on an older database that doesn't have the column.
– jdweng
Nov 23 '18 at 14:41
I understood, my difficulty is how to handle this scenario when the user opens an old version of the application .. I agree with you that it has to be consistent, but this situation can happen and I have to prepare myself in case it comes to occur ...
– Leonardo Moura
Nov 23 '18 at 14:49
That is why the program must check the version of program and version of database to make sure they are compatible. When they are not then code as to be written to handle the mis-matches in versions.
– jdweng
Nov 23 '18 at 14:52
Thank you for the answer, I'll try this treatment.
– Leonardo Moura
Nov 23 '18 at 21:46
add a comment |
The database and the app must be consistent unless the code compares the database version with the app version. You can't get data out of a database that doesn't exist nor insert data into a database where the column doesn't exist. So if the database deleted a column a older version of the app will not work on a newer database. If a column was added in a new version of the database an new version of the software will looking for the added column will not work on an older database that doesn't have the column.
– jdweng
Nov 23 '18 at 14:41
I understood, my difficulty is how to handle this scenario when the user opens an old version of the application .. I agree with you that it has to be consistent, but this situation can happen and I have to prepare myself in case it comes to occur ...
– Leonardo Moura
Nov 23 '18 at 14:49
That is why the program must check the version of program and version of database to make sure they are compatible. When they are not then code as to be written to handle the mis-matches in versions.
– jdweng
Nov 23 '18 at 14:52
Thank you for the answer, I'll try this treatment.
– Leonardo Moura
Nov 23 '18 at 21:46
The database and the app must be consistent unless the code compares the database version with the app version. You can't get data out of a database that doesn't exist nor insert data into a database where the column doesn't exist. So if the database deleted a column a older version of the app will not work on a newer database. If a column was added in a new version of the database an new version of the software will looking for the added column will not work on an older database that doesn't have the column.
– jdweng
Nov 23 '18 at 14:41
The database and the app must be consistent unless the code compares the database version with the app version. You can't get data out of a database that doesn't exist nor insert data into a database where the column doesn't exist. So if the database deleted a column a older version of the app will not work on a newer database. If a column was added in a new version of the database an new version of the software will looking for the added column will not work on an older database that doesn't have the column.
– jdweng
Nov 23 '18 at 14:41
I understood, my difficulty is how to handle this scenario when the user opens an old version of the application .. I agree with you that it has to be consistent, but this situation can happen and I have to prepare myself in case it comes to occur ...
– Leonardo Moura
Nov 23 '18 at 14:49
I understood, my difficulty is how to handle this scenario when the user opens an old version of the application .. I agree with you that it has to be consistent, but this situation can happen and I have to prepare myself in case it comes to occur ...
– Leonardo Moura
Nov 23 '18 at 14:49
That is why the program must check the version of program and version of database to make sure they are compatible. When they are not then code as to be written to handle the mis-matches in versions.
– jdweng
Nov 23 '18 at 14:52
That is why the program must check the version of program and version of database to make sure they are compatible. When they are not then code as to be written to handle the mis-matches in versions.
– jdweng
Nov 23 '18 at 14:52
Thank you for the answer, I'll try this treatment.
– Leonardo Moura
Nov 23 '18 at 21:46
Thank you for the answer, I'll try this treatment.
– Leonardo Moura
Nov 23 '18 at 21:46
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53447757%2fentity-framework-migrations-in-app-with-outdated-version%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53447757%2fentity-framework-migrations-in-app-with-outdated-version%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The database and the app must be consistent unless the code compares the database version with the app version. You can't get data out of a database that doesn't exist nor insert data into a database where the column doesn't exist. So if the database deleted a column a older version of the app will not work on a newer database. If a column was added in a new version of the database an new version of the software will looking for the added column will not work on an older database that doesn't have the column.
– jdweng
Nov 23 '18 at 14:41
I understood, my difficulty is how to handle this scenario when the user opens an old version of the application .. I agree with you that it has to be consistent, but this situation can happen and I have to prepare myself in case it comes to occur ...
– Leonardo Moura
Nov 23 '18 at 14:49
That is why the program must check the version of program and version of database to make sure they are compatible. When they are not then code as to be written to handle the mis-matches in versions.
– jdweng
Nov 23 '18 at 14:52
Thank you for the answer, I'll try this treatment.
– Leonardo Moura
Nov 23 '18 at 21:46