Base solution for your next web application
Open Closed

Demo Project Database Initialization Issue #6475


User avatar
0
sunflowerlab created

I downlaoded the ASP.NET MVC & Jquery demo Project.

Is there any difference between Demo and Real project? I downloaded the demo project and ran the Migrator tool. It created the database but didn't load the default data. All tables are blank. I deleted the database and project. Extracted the project again and executed the command "Update-Database" from NuGet package console for EntityFramework. I am getting the following error. **I creates the database but deosn't add any initial data. **

Unable to update database to match the current model because there are pending changes and automatic migration is disabled. Either write the pending model changes to a code-based migration or enable automatic migration. Set DbMigrationsConfiguration.AutomaticMigrationsEnabled to true to enable automatic migration. You can use the Add-Migration command to write the pending model changes to a code-based migration.

Also gets following warning.

_Applying explicit migration: 201505162037045RenamedBinaryObjectTable. Caution: Changing any part of an object name could break scripts and stored procedures. Caution: Changing any part of an object name could break scripts and stored procedures. Applying explicit migration: 201506061210411AddedAuthenticationSourceToUser.

_Warning! The maximum key length is 900 bytes. The index 'IXNotificationNameEntityTypeNameEntityIdUserId' has maximum length of 1032 bytes. For some combination of large values, the insert/update operation will fail.

Caution: Changing any part of an object name could break scripts and stored procedures

I haven't changed anything in the code except the connection string on a web project.


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    I downlaoded the ASP.NET MVC & Jquery demo Project.

    What is the specific version?

    Is there any difference between Demo and Real project?

    No difference in code

  • User Avatar
    0
    sunflowerlab created

    i downloded the latest version.

    can you answer how to solve that issue?

  • User Avatar
    0
    maliming created
    Support Team

    Try creating an empty database first, then try to execute Update-Database.

  • User Avatar
    0
    sunflowerlab created

    Tried. Same thing. Still all table is created but without sample data and also get the same error at the end. Can we do the team viewer? We really need to get going with the project and looks like we are stuck on the first step.

  • User Avatar
    1
    sunflowerlab created

    Thanks it resolved by your team using team viewer