2
respostas

TabelaAuxiliar

Rodei a migration e pra mim não gerou não. O código está igual.

2 respostas

para mim deu um erro estranho, diz que a tabela endereços ja foi criada, sendo que nao alterei nada nessa tabela ja que estavamos trabalhando em filems e cinema, erro abaixo:

To undo this action, use Remove-Migration. PM> Update-Database Build started... Build succeeded. fail: Microsoft.EntityFrameworkCore.Database.Command[20102] Failed executing DbCommand (7ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] CREATE TABLE Enderecos ( Id int NOT NULL AUTO_INCREMENT, Logradouro text NULL, Bairro text NULL, Numero int NOT NULL, PRIMARY KEY (Id) ); Failed executing DbCommand (7ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] CREATE TABLE Enderecos ( Id int NOT NULL AUTO_INCREMENT, Logradouro text NULL, Bairro text NULL, Numero int NOT NULL, PRIMARY KEY (Id) ); MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'enderecos' already exists at MySql.Data.MySqlClient.MySqlStream.ReadPacket() at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId) at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId) at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force) at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject) at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable1 migrationCommands, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) Table 'enderecos' already exists

Consegui resolver eu deletei todos os Migrations e adicionei um novo.

porem o erro de endereço é o mesmo, fail: Microsoft.EntityFrameworkCore.Database.Command[20102]

não estou conseuindo fazer o updte após a inclusão da entidade sessao no codigo.