Null/Not null on columns

May 8, 2014 at 1:27 AM
Is there any way to specify whether the column should be not null or null when defining a property in model?
I`ve checked attributes in source code but unable to find anything similar.
Thanks
Coordinator
May 8, 2014 at 3:50 AM
Be more specific, are you talking about null/not null in the database when sauce creates the column or something else?
May 8, 2014 at 8:12 AM
Yes, sorry.

For example:

ALTER TABLE TableName ADD COLNew CHAR(25) NULL
vs
ALTER TABLE TableName ADD COLNew CHAR(25) NOT NULL
Coordinator
May 8, 2014 at 12:51 PM
Edited May 8, 2014 at 12:52 PM
If you set a default value for the column then sauce will not set the column to null.

[DataField(DefaultValue="1")].

The string you provide there is passed directly to the datastore.