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

postgresql中int2到bool类型的映射 #1805

Open
cfires opened this issue May 20, 2024 · 1 comment
Open

postgresql中int2到bool类型的映射 #1805

cfires opened this issue May 20, 2024 · 1 comment

Comments

@cfires
Copy link

cfires commented May 20, 2024

使用场景

postgresql中的数据类型为int2(通过sqlserver数据库迁移到postgresql,原bit被转换为int2,其中值为0和1),如果代码中标记bool类型,数据库中为int,可否生成代码时生成IS_DELETED=0或1的形式,而不是IS_DELETED='f' 或't'?当代码类型为bool,数据库类型也为bool时,还是生成postgresql风格的IS_DELETED='f' 或't'。

/// <summary>
/// 是否删除
/// </summary>
[Column(Name = "IS_DELETED", Position = -9)]
public bool IsDeleted { get; set; } = false;
@2881099
Copy link
Collaborator

2881099 commented May 20, 2024

代码生成为 int 解决吧。

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

No branches or pull requests

2 participants