dotnetcore / dotnetcore/FreeSql

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

Open
#2,088 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.4k
Forks
910
PR merge metrics
No merged PRs in 30d

Description

#### 问题描述及重现代码:

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? 及具体版本
——

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.