Migrations are enabled for context, but the database does not exist or contains no mapped tables. Use Migrations to create the database and its tables, for example by running the 'Update-Database' command from the Package Manager Console.
The database is not getting created for the first time while running the asp.net mvc application. I got this above error migrations are enabled for context and use migration to create the database and its table.
Solution:
You can solve it manually via SQL management Studio by running the Database schema.
Run the following command in the nuget package manager console.
PM> Update-Database –Script
This will generate a SQL file with Schema code. Create an empty database and run the database schema, tables get created on it.
Post your comments / questions
Recent Article
- How to enable Search Feature in Django admin?
- How to check PAN-Aadhaar is Linked or NOT?
- How to customize pagination for django admin?
- How to fix HAXM is not installed |in Android Studio
- How to fix CMOS Checksum Error in Computer or Laptop | SOLVED
- Reactivating windows after a Hardware change on PC or Laptop
- FIXED: Windows reported that the hardware of your device has changed. Error code :0xc004F211
- "redirect" is not defined pylance("reportUndefinedVariable)
Related Article