Closed hatzhang closed 6 months ago
以下Entity生成的迁移脚本时,会报如题的错。同样的迁移脚本不会报错,如果对着SqlServer跑的话。 可以支持这个nvarchar(max)的属性吗?
nvarchar(max)
public class ComplicatedDataEntity { public long ComplicatedDataEntityId { get; set; } public string Name { get; set; } }
Migration 类
protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ComplicatedDataEntities", columns: table => new { ComplicatedDataEntityId = table.Column<long>(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column<string>(type: "nvarchar(max)", nullable: true) }, ...
例外:
Failed executing DbCommand (9ms) [Parameters=[], CommandType='Text', CommandTime CREATE TABLE "ComplicatedDataEntities" ( "ComplicatedDataEntityId" bigint NOT NULL, "Name" nvarchar(max) ); Kdbndp.KingbaseException (0x80004005): 42601: syntax error at or near "max"
我应该重新生成基于Kingbase的Migration,而非使用已经生成的SqlServer的Migrations.
以下Entity生成的迁移脚本时,会报如题的错。同样的迁移脚本不会报错,如果对着SqlServer跑的话。 可以支持这个
nvarchar(max)
的属性吗?Migration 类
例外: