Closed datdefboi closed 4 years ago
Can-you remove the dependencies with Microsoft.EntityFrameworkCore & Microsoft.EntityFrameworkCore.Design and execute the command dotnet ef migrations add Initial again ?
I've made an example of a bad driver's work. Feel free to some PRs and discussions. https://github.com/datdefboi/CassandraEFExample The DB has no changes and keyspaces (just deployed)
I made a pull request on your project
I've updated my example. A migration creates successfully, but it throws some exceptions:
Build started...
Build succeeded.
Failed executing DbCommand (21ms) [Parameters=[], CommandType='Text', CommandTimeout='-1']
SELECT count(*) FROM system_schema.tables WHERE keyspace_name='' and table_name='__EFMigrationsHistory'
Cassandra.InvalidQueryException: Key may not be empty
at Cassandra.Tasks.TaskHelper.WaitToComplete(Task task, Int32 timeout)
at Cassandra.Tasks.TaskHelper.WaitToCompleteWithMetrics(IMetricsManager manager, Task task, Int32 timeout)
at Cassandra.Tasks.TaskHelper.WaitToCompleteWithMetrics[T](IMetricsManager manager, Task`1 task, Int32 timeout)
at Cassandra.Session.Execute(IStatement statement, String executionProfileName)
at Cassandra.Session.Execute(IStatement statement)
at Cassandra.Session.Execute(String cqlQuery, ConsistencyLevel consistency)
at Cassandra.Data.CqlCommand.ExecuteScalar()
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteScalar(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Cassandra.Migrations.CassandraHistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Cassandra.Migrations.Internal.CassandraMigrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Key may not be empty
Have you tried to run my sample project and check the success migrations add
and database update
commands execution?
I made an another pull request to fix the migration. Sorry for the inconvenience.
this config throws the same error when
dotnet ef migrations add Initial