Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mariadb DATETIME does not support values generated #280

Closed
zuosc opened this issue May 22, 2017 · 3 comments
Closed

mariadb DATETIME does not support values generated #280

zuosc opened this issue May 22, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@zuosc
Copy link

zuosc commented May 22, 2017

Steps to reproduce

dotnet run testMigrate

The issue

Describe what is not working as expected.

If you are seeing an exception, include the full exceptions details (message and stack trace).

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``

### Further technical details

MySQL version:  10.1.23-MariaDB-1~jessie
Operating system: win10
Pomelo.EntityFrameworkCore.MySql version:1.1.0

Other details about my project setup:
@caleblloyd
Copy link
Contributor

#281 fixes the datetime issue. I still couldn't run that command because the tests have JSON types and MariaDB does not support JSON columns. But the fix clears the datetime issue.

If you comment out all of the JSON fields in the tests, then it works.

@yukozh
Copy link
Member

yukozh commented May 22, 2017

Thank you @caleblloyd.

@yukozh yukozh added this to the 2.0.0 milestone May 22, 2017
@yukozh yukozh closed this as completed May 22, 2017
@zuosc
Copy link
Author

zuosc commented May 22, 2017

Thank you @caleblloyd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants