Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Issue using Database Migration #354


User avatar
0
joe704la created

I am getting the below error message when I try to use the Update-Database. I tried both creating a new database from scratch and just allowing the Package manger creating the database but neither works.

Error Number:2714,State:6,Class:16 There is already an object named 'AbpPermissions' in the database.

Any help would be greatly appreciated.


7 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    It tries to create the sample table twice. Have you added new migrations on the standard migrations coming from AspNet Zero template? Also, you can share the migration code that causes the error.

  • User Avatar
    0
    joe704la created

    No this was the first time I was going to start the application. I haven't done any customization's yet. Whats really weird is today it worked just fine and I didn't do anything but restarted my computer.

  • User Avatar
    0
    hikalkan created
    Support Team

    The only possiblity, you may deleted the MigrationHistory table of EF. If you create an empty database, it should work. Also, check your connection string (You can add -Verbose parameter to your Update-Database command). I tried it again, there is no problem with Migrations.

  • User Avatar
    0
    ideutsch created

    I am having the same issue. Sometimes the "Update-Database" command will work, and sometimes I'll get the permissions table error. Weird.

  • User Avatar
    0
    ideutsch created

    This was right after creating a new database. I'll post more detailed information if it continues to be a problem.

  • User Avatar
    0
    ideutsch created

    I think if you currently have a migration or seed class open in Visual Studio it will fail, and work if you have any other class currently open. So to replicate the error, open a seed/migration class, and attempt to run Update-Database.

  • User Avatar
    0
    hikalkan created
    Support Team

    It's very strange, thank you for the information.