Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Commonmark migration
Source Link

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.

    Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.

  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.

    Go to the migrations folder in your solution and check for the migration added after the last successful migration.

  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

    The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

    migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  4. You can either comment this statement or delete it

  5. Try to update your database again

migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  1. You can either comment this statement or delete it
  2. Try to update your database again

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.
  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.
  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  1. You can either comment this statement or delete it
  2. Try to update your database again

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.

  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.

  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

    migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  4. You can either comment this statement or delete it

  5. Try to update your database again

added 3 characters in body
Source Link
Ose
  • 11
  • 2

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.
  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.
  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  1. You can either comment this statement or delete it
  2. Try to update your tabledatabase again

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.
  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.
  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  1. You can either comment this statement or delete it
  2. Try to update your table again

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.
  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.
  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  1. You can either comment this statement or delete it
  2. Try to update your database again
Highlighted code. Put error in indented block quote.
Source Link
Jeremy Caney
  • 7.8k
  • 115
  • 58
  • 87

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory_EFMigrationsHistory) to know the last successful migration.
  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.
  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserIdFK_ApplicationUserToken_AspNetUsers_UserId, usually written like: migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table") in the migration that follows the last successful migration;
  4. You can either comment this statement or delete it
  5. Try to update your table again

migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  1. You can either comment this statement or delete it
  2. Try to update your table again

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.
  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.
  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId usually written like: migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table") in the migration that follows the last successful migration;
  4. You can either comment this statement or delete it
  5. Try to update your table again

The problem is that you have a migration that for some reason is referencing a constraint that has either not been created or deleted.

To solve this

  1. Check your migration history table on your database (_EFMigrationsHistory) to know the last successful migration.
  2. Go to the migrations folder in your solution and check for the migration added after the last successful migration.
  3. The error is most like from a statement that is trying to drop the FK_ApplicationUserToken_AspNetUsers_UserId, usually written like:

migrationBuilder.DropForeignKey( name: "FK_ApplicationUserToken_AspNetUsers_UserId", table: "Your table")

  1. You can either comment this statement or delete it
  2. Try to update your table again
Source Link
Ose
  • 11
  • 2
Loading