question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Table 'ApiResources' already exists

See original GitHub issue

Thanks for such a great project.

I have an issue while migrating database.

First of all, I followed the instruction in EFMigration.md and Issue102 to use MySQL. When I run Update-Database -context AdminDbContext, I got

PM> dotnet ef database update -c AdminDbContext MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'ApiResources' already exists ---> MySql.Data.MySqlClient.MySqlException (0x80004005): Table 'ApiResources' already exists at MySqlConnector.Core.ResultSet.ReadResultSetHeaderAsync(IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\Core\ResultSet.cs:line 42 at MySql.Data.MySqlClient.MySqlDataReader.ActivateResultSet(ResultSet resultSet) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 74 at MySql.Data.MySqlClient.MySqlDataReader.ReadFirstResultSetAsync(IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 299 at MySql.Data.MySqlClient.MySqlDataReader.CreateAsync(MySqlCommand command, CommandBehavior behavior, ResultSetProtocol resultSetProtocol, IOBehavior ioBehavior) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlDataReader.cs:line 284 at MySqlConnector.Core.TextCommandExecutor.ExecuteReaderAsync(String commandText, MySqlParameterCollection parameterCollection, CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken) in C:\projects\mysqlconnector\src\MySqlConnector\Core\TextCommandExecutor.cs:line 37 at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQueryAsync(IOBehavior ioBehavior, CancellationToken cancellationToken) in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlCommand.cs:line 261 at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() in C:\projects\mysqlconnector\src\MySqlConnector\MySql.Data.MySqlClient\MySqlCommand.cs:line 62 at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 parameterValues) 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 contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) Table 'ApiResources' already exists

Could you please help to see what did I missed? Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
benedict1986commented, Oct 30, 2018

Hi skoruba,

I will give it a try and see how it goes. Thanks again for such a great project

0reactions
skorubacommented, Oct 30, 2018

Hi @benedict1986 - you are welcome - if you have any question - please let me know. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Laravel Migration table already exists, but I want to add ...
Caused by PDOException: SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'items' already exists. Duh! Items table should exist ...
Read more >
Table already exists error
Hi, i'm getting an error when i deploy my application. [PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'insurers' already ...
Read more >
table version already exists. pgAdmin4 fails on Linux Mint ...
Solution. Downgrade SQLAlchemy to an earlier non-conflict version. At the time of publishing the posts that explain the steps to install ...
Read more >
"<table name> already exists in database" error message ...
"<table name> already exists in database" error message when you run the upgrade toolkit for the Swiss version of Microsoft Dynamics NAV 2013....
Read more >
Create Link Table
You are here: APIs > Advanced API resources > Link Tables > Create Link Table ... Link table already exists with the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found