When you import from the database to models, and you have a GUID primary key "Id".
The "value generated" selected value is always "Never"
(Even if you first created the database from model, and then create the models from database again
The "value generated" selected value is always "Never")
Shouldnt primary key be default value generated to "Add"? or at least there should be an option to set primary key value generated to "add"?
Note: If I do not manually assign the primary key with a GUID identitifer, it creates an empty GUID value in the database
#postgres
GUID primary key and "Value Generated": Add
Re: GUID primary key and "Value Generated": Add
Please create the following table in your database:
And import it into your EF Core Model (*.efml). Entity Developer should set Value Generated=OnAdd for the Pkey property.
JIC: https://dba.stackexchange.com/questions ... n-postgres
Code: Select all
CREATE TABLE tbl
(
pkey UUID NOT NULL DEFAULT uuid_generate_v1() ,
CONSTRAINT pkey_tbl PRIMARY KEY ( pkey )
)
JIC: https://dba.stackexchange.com/questions ... n-postgres