ormdb icon indicating copy to clipboard operation
ormdb copied to clipboard

AutoIncrement attribute not working at pgSql

Open ibrahimakgn opened this issue 5 years ago • 3 comments

Hi,

I wanna create a table with this defination table class but when its created at db its giving Id column can not be null because of its primary key. But i have gave autoincrement = true. Whats the problem?

[Table(Name = "tbl_test")] public class tbl_test : Base { [Column(AutoIncrement = true)] public int? Id; [Column()] public string FirstName; [Column()] public string LastName; [Column()] public string Note; [Column()] public System.DateTime BornDate; [Column()] public bool IsActive;

    // Method expression which returns of type "TableConfig", is returned.
    protected override Expression<TableConfig> Config() =>
        (x) => x.SetPrimaryKey(Id)
            .AddIndex(BornDate);
}

ibrahimakgn avatar Dec 24 '20 19:12 ibrahimakgn

Hı

Can you tell us the name of the method you're having trouble with?

is it "Connection.Provider.CreateTable(...)" or "SQL.Insert(...)" ?

ormdb avatar Dec 25 '20 14:12 ormdb

With this method i created table but no Auto increment Connection.Provider.CreateTable(...)

ibrahimakgn avatar Dec 25 '20 15:12 ibrahimakgn

This bug is resolved on version 1.6.1.8.

Please visit https://www.nuget.org/packages/OrmDb/1.6.1.8

ormdb avatar Dec 25 '20 15:12 ormdb