Skip to content

FreeSql.Generator PostgreSQL生成Model没有对uuid_generate_v4()默认值生成InsertValueSql #2088

@466974367

Description

@466974367

问题描述及重现代码:

PostgreSQL

CREATE TABLE "public"."t_word_segment" (
  "id" varchar(36) COLLATE "pg_catalog"."default" NOT NULL DEFAULT uuid_generate_v4(),
  CONSTRAINT "t_word_segment_pkey" PRIMARY KEY ("id")
);

生成Model

namespace Geo_compass.Daxt.Model.Entities {
	[Table(Name = "t_word_segment", DisableSyncStructure = true)]
	public partial class T_word_segment {
		[Column(Name = "id", StringLength = 36, IsPrimary = true, IsNullable = false)]
		public string Id { get; set; } = "uuid_generate_v4()";
	}
}

预期Model

namespace Geo_compass.Daxt.Model.Entities {
	[Table(Name = "t_word_segment", DisableSyncStructure = true)]
	public partial class T_word_segment {
		[Column(Name = "id", StringLength = 36, IsPrimary = true, IsNullable = false, InsertValueSql = "uuid_generate_v4()")]
		public string Id { get; set; };
	}
}

数据库版本

PostgreSQL 14.13

安装的Nuget包

FreeSql.Generator 3.5.212

.net framework/. net core? 及具体版本

——

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions