Base solution for your next web application
Open Closed

Advice with Entity Framework Migration #3305


User avatar
0
moustafa created

Hello everyone,

i have a serious situation here , for your record i use MVC with Angular 1.x template

when i started my project i never use migrations so i just make changes to my classes then use command update-database -force in PMC to reflect the changes to database , even if i had problems during this process i easily delete the old database because i'm in the middle of development mode , but what about publishing and production what i do if i have to make changes , can anyone advice me what to do before get forward to the next step , is it possible to make migration class with all the changes been made during the development i hope that my question is clear enough

thank you in advance


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @moustafa,

    If you are not on production yet, you can delete all migration files and create a single migration by Add-Migration command. After moving to production, I suggest not to delete migrations.

    If that is not what you are asking, can you explain a bit more ?

    Thanks.

  • User Avatar
    0
    tteoh created

    I hope the Migrator documentation will be ready soon. I am sure it will help a lot of people to understand its usage on the following sequence of events:

    1. Initial use to setup PRD/STG from DEV environment
    2. How to publish the tool to the targeted environment from DEV
    3. How to execute the tool with reference to where the exe and config reside
    4. How to use the tool to handle subsequent model change .

    Look forward to the documentation release. ;)

    Thanks. /tommy

  • User Avatar
    0
    moustafa created

    Hi @ ismcagdas

    yes i'm asking about migration because i going to production mode and i didn't create migrations classes to changes i made to database but the migrations done from your side exists and i didn't delete it so i 'll try to add single migration as you said and i'll let you know i have a further questions

    thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks,

    We are waiting for your feedback :)