title: Entity Framework Core - Error when trying to Add Migration after creating Model from existing database
body: <p>I have .NET Core Project with Entity Framework Core. I created a model from an existing database using the following command</p>
  <p>Scaffold-DbContext &quot;Server=.\SQLEXPRESS;Database=DBName;Trusted_Connection=True;&quot; Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models</p>
  <p>The Model was generated and I tried to add migration but the migration that is generated is actually trying to create anew the already existing tables in the database. So when I try to run Update-Database I naturally run into the following error</p>
  <blockquote>
  <p>Applying migration '20200912095755_SetMaxLengthToBookTitle'. Failed
  executing DbCommand (20ms) [Parameters=[], CommandType='Text',
  CommandTimeout='30'] CREATE TABLE [Authors] (
  [Id] int NOT NULL IDENTITY,
  [Name] nvarchar(max) NULL,
  CONSTRAINT [PK_Authors] PRIMARY KEY ([Id]) ); Microsoft.Data.SqlClient.SqlException (0x80131904): There is already
  an object named 'Authors' in the database.    at
  Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception,
  Boolean breakConnection, Action<code>1 wrapCloseInAction)    at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action</code>1 wrapCloseInAction)    at
  Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
  stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)    at
  Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior,
  SqlCommand cmdHandler, SqlDataReader dataStream,
  BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
  stateObj, Boolean&amp; dataReady)</p>
  </blockquote>
  <p>What is the reason for that and what is the correct way to update database after creating the model from an already existing database in EF Core?</p>