Pomelo.entityframeworkcore.mysql: mariadb DATETIME ne prend pas en charge les valeurs générées

Créé le 22 mai 2017  ·  3Commentaires  ·  Source: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql

Étapes à reproduire

dotnet exécuter testMigrate

Le problème

Décrivez ce qui ne fonctionne pas comme prévu.

Si vous voyez une exception, incluez les détails complets des exceptions (message et trace de pile).

` Exception message: Stack trace: `EnsureCreate creates database...Error in GeneratedTime.CreatedDateTime: DATETIME does not support values generated on Add or Update in MySql <= 5.5, try explicitly setting the column type to TIMESTAMP at Microsoft.EntityFrameworkCore.Migrations.MySqlMigrationsSqlGenerationHelper.ColumnDefinition(String schema, String table, String name, Type clrType, String type, Nullable`1 unicode, Nullable`1 maxLength, Boolean rowVersion, Boolean nullable, Object defaultValue, String defaultValueSql, String computedColumnSql, IAnnotatable annotatable, IModel model, MigrationCommandListBuilder builder) in E:\GitHubCode\Pomelo.EntityFrameworkCore.MySql\src\Pomelo.EntityFrameworkCore.MySql\Migrations\MySqlMigrationsSqlGenerator.cs:line 424 at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.ColumnDefinition(AddColumnOperation operation, IModel model, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(CreateTableOperation operation, IModel model, MigrationCommandListBuilder builder, Boolean terminate) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(CreateTableOperation operation, IModel model, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MySqlMigrationsSqlGenerationHelper.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder) in E:\GitHubCode\Pomelo.EntityFrameworkCore.MySql\src\Pomelo.EntityFrameworkCore.MySql\Migrations\MySqlMigrationsSqlGenerator.cs:line 59 at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model) at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.CreateTables() at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.EnsureCreated() at Pomelo.EntityFrameworkCore.MySql.PerfTests.Commands.TestMigrateCommand.Run() in E:\GitHubCode\Pomelo.EntityFrameworkCore.MySql\test\Pomelo.EntityFrameworkCore.MySql.PerfTests\Commands\TestMigrateCommand.cs:line 15 at Pomelo.EntityFrameworkCore.MySql.PerfTests.Commands.CommandRunner.Run(String[] args) in E:\GitHubCode\Pomelo.EntityFrameworkCore.MySql\test\Pomelo.EntityFrameworkCore.MySql.PerfTests\Commands\CommandRunner.cs:line 29

Plus de détails techniques

Version MySQL : 10.1.23-MariaDB-1~jessie
Système d'exploitation : win10
Pomelo.EntityFrameworkCore.MySql version:1.1.0

Autres détails sur la configuration de mon projet :

type-bug

Commentaire le plus utile

281 corrige le problème de date/heure. Je ne pouvais toujours pas exécuter cette commande car les tests ont des types JSON et MariaDB ne prend pas en charge les colonnes JSON. Mais le correctif efface le problème de datetime.

Si vous commentez tous les champs JSON dans les tests, cela fonctionne.

Tous les 3 commentaires

281 corrige le problème de date/heure. Je ne pouvais toujours pas exécuter cette commande car les tests ont des types JSON et MariaDB ne prend pas en charge les colonnes JSON. Mais le correctif efface le problème de datetime.

Si vous commentez tous les champs JSON dans les tests, cela fonctionne.

Merci @caleblloyd.

Merci @caleblloyd.

Cette page vous a été utile?
0 / 5 - 0 notes