Kevin11Stone / Pizzeria

0 stars 0 forks source link

Beverage table not being created #7

Closed Kevin11Stone closed 4 years ago

Kevin11Stone commented 4 years ago

I speculated it was a relationship issue. After adding a primary key property, the same exception is thrown.

Possible solution:

Below is a snippet from the inner exception. System.Data.SqlClient.SqlException: Invalid object name 'dbo.Beverages'. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)

Kevin11Stone commented 4 years ago

Deleting the database does not solve this issue.

Kevin11Stone commented 4 years ago

Manually creating the table within the migration also did not solve the issue.

Kevin11Stone commented 4 years ago

After manually creating the table within a migration, re scaffolding a previous migration (modelChanges) by running Update-Database -TargetMigration 202001101945026_InitialDesign, deleting the previous migration and updating the database, the Beverage table was successfully created.