Pomelo.entityframeworkcore.mysql: mariadb DATETIMEは、生成された値をサポートしていません

作成日 2017年05月22日  ·  3コメント  ·  ソース: PomeloFoundation/Pomelo.EntityFrameworkCore.MySql

再現する手順

dotnet runtestMigrate

問題

期待どおりに機能していないものを説明してください。

例外が表示されている場合は、完全な例外の詳細(メッセージとスタックトレース)を含めてください。

` 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

さらなる技術的詳細

MySQLバージョン:10.1.23-MariaDB-1〜jessie
オペレーティングシステム:win10
Pomelo.EntityFrameworkCore.MySqlバージョン:1.1.0

私のプロジェクト設定に関するその他の詳細:

type-bug

最も参考になるコメント

281は日時の問題を修正します。 テストにはJSONタイプがあり、MariaDBはJSON列をサポートしていないため、まだそのコマンドを実行できませんでした。 ただし、この修正により、日時の問題は解消されます。

テストのすべてのJSONフィールドをコメントアウトすると、機能します。

全てのコメント3件

281は日時の問題を修正します。 テストにはJSONタイプがあり、MariaDBはJSON列をサポートしていないため、まだそのコマンドを実行できませんでした。 ただし、この修正により、日時の問題は解消されます。

テストのすべてのJSONフィールドをコメントアウトすると、機能します。

@caleblloydありがとうございます。

@caleblloydありがとうございます。

このページは役に立ちましたか?
0 / 5 - 0 評価