dotnet ef migrations script --context ConfigurationDBContext
-- Script was generated by Devart dotConnect for MySQL, Version 8.12.1357
-- Product home page: http://www.devart.com/dotconnect/mysql
-- Database version: MySQL 8.0.14
-- Script date 4/10/2019 6:14:51 PM
ALTER TABLE ApiResources
ADD COLUMN Created datetime DEFAULT CAST('0001-01-01 00:00:00' AS DATETIME) NOT NULL;
The cast() is unnecessary. The value is automatically converted to the correct type:
ALTER TABLE Table1 ADD COLUMN Created datetime DEFAULT '0001-01-01 00:00:00' NOT NULL;
MySQL allows constants for default values but does not permit expressions.
8.12.1357 script error EF migration
Re: 8.12.1357 script error EF migration
Please open Property Editor and Press ... against the Column field to open Column Editor. There is the Length field in this dialog. Is that what you need?
Re: 8.12.1357 script error EF migration
This script is generated using ef migration commands in package manager console.
For some reason it generates a cast function for default value, which is illegal. Only constants are accepted.
For some reason it generates a cast function for default value, which is illegal. Only constants are accepted.
Re: 8.12.1357 script error EF migration
We have reproduced the bug and will notify you when it is fixed.
Re: 8.12.1357 script error EF migration
The bug with setting default values for the DateTime and TimeSpan columns in the ALTER statements in EF Core 2 Code-First Migrations is fixed: viewtopic.php?f=2&t=38883.