Page 1 of 1

Columns - Nulliable and Not Null

Posted: Thu 01 Jun 2017 06:50
by RobertK
Imagehttps://ibb.co/hUNUOF

You have "Nullable" which means the value can be null. BUT then you have "Not Null" now what is this? is this a duplicate feature of the same thing?

EDIT: Nullable is for the class, and "Not Null" is for the database table? shouldn't there just be one option?

Re: Columns - Nulliable and Not Null

Posted: Tue 06 Jun 2017 11:33
by Shalex
RobertK wrote:Nullable is for the class, and "Not Null" is for the database table?
That is correct.
RobertK wrote:shouldn't there just be one option?
These are two different options by design: one is for class property, another one is for database column.

Re: Columns - Nulliable and Not Null

Posted: Wed 21 Jun 2017 01:18
by RobertK
Shalex wrote:
RobertK wrote:Nullable is for the class, and "Not Null" is for the database table?
That is correct.
RobertK wrote:shouldn't there just be one option?
These are two different options by design: one is for class property, another one is for database column.
It should provide a warning that the two dont match because it makes no sense for it not to match?

Re: Columns - Nulliable and Not Null

Posted: Thu 29 Jun 2017 15:42
by Shalex
"Nullable" and "Not Null" are two conceptually different settings.

"Nullable" defines behavior of a model class property.

Column's "Not Null" attribute is taken into account in the following cases:
* generating DDL of the column when using Generate Database Script From Model
* comparing storage part of the model and database itself in Update Model From Database / Update Database From Model wizards

By default, Entity Developer should synchronize values of "Nullable" and "Not Null".

Re: Columns - Nulliable and Not Null

Posted: Wed 12 Jul 2017 01:14
by RobertK
Shalex wrote:"Nullable" and "Not Null" are two conceptually different settings.

By default, Entity Developer should synchronize values of "Nullable" and "Not Null".
Entity Developer should sync the two values nullable and not null - however, it does not do this!
hence the reason for reporting this issue.

Re: Columns - Nulliable and Not Null

Posted: Thu 13 Jul 2017 18:06
by Shalex
Possible values:
* Nullable -> true, false
* Not Null -> "not set", true, false

Synchronization works when Not Null is "not set". Otherwise, the exact value (true or false) means that a user defined the value of Not Null himself and Entity Developer should not override it.

If this doesn't help, please specify the exact steps we should follow to reproduce the issue when default values "Nullable" and "Not Null" do not match. For example: create the following table in database [...], add it to the model, check values of "Nullable" and "Not Null", they should be [...] but actually they are [...].