I've switched from MySql.Data.EntityFrameworkCore to Pomelo.EntityFrameworkCore.MySql which is now working. I'm unsure if the additions in the Zero version vs Boilerplate have incompatible table definitions, but the documentation should not recommend a package that does not work.
Today I downloaded the latest v6.3.1, ASP.NET CORE & Angular, .NET Core 2.1 project Followed this documentation to change from SqlServer to MySql: https://aspnetboilerplate.com/Pages/Documents/EF-Core-MySql-Integration?searchKey=mysql I've made no other changes to the downloaded template
On update-database I get the error:
Failed executing DbCommand (5ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CREATE TABLE AbpBackgroundJobs
(
Id
bigint NOT NULL AUTO_INCREMENT,
CreationTime
datetime NOT NULL,
CreatorUserId
bigint NULL,
JobType
varchar(512) NOT NULL,
JobArgs
varchar(1048576) NOT NULL,
TryCount
smallint NOT NULL,
NextTryTime
datetime NOT NULL,
LastTryTime
datetime NULL,
IsAbandoned
bit NOT NULL,
Priority
tinyint NOT NULL,
PRIMARY KEY (Id
)
);
MySql.Data.MySqlClient.MySqlException (0x80004005): Column length too big for column 'JobArgs' (max = 16383); use BLOB or TEXT instead
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, 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.ExecuteNonQuery()
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod executeMethod, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary
2 parameterValues)
at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 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.OperationBase.Execute(Action action)
Column length too big for column 'JobArgs' (max = 16383); use BLOB or TEXT instead
I've been using the ASP.NET Boilerplate free template purchasing ASP.NET Zero yesterday, with MySql without issue. How can I resolve this?
EDIT: I'm manually modifying the generated fluent files to keep moving forward (this won't work as soon as I need to regenerate) and have found the same issue with another table, I will assume there are more:
Failed executing DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CREATE TABLE AbpLanguageTexts
(
Id
bigint NOT NULL AUTO_INCREMENT,
CreationTime
datetime NOT NULL,
CreatorUserId
bigint NULL,
LastModificationTime
datetime NULL,
LastModifierUserId
bigint NULL,
TenantId
int NULL,
LanguageName
varchar(10) NOT NULL,
Source
varchar(128) NOT NULL,
Key
varchar(256) NOT NULL,
Value
varchar(67108864) NOT NULL,
PRIMARY KEY (Id
)
);
MySql.Data.MySqlClient.MySqlException (0x80004005): Column length too big for column 'Value' (max = 16383); use BLOB or TEXT instead