Hello,

How would you produce this in DO:

SomeDate DATETIME NOT NULL DEFAULT GETDATE()

I can do the DATETIME and NOT NULL parts, but can't get the default value to be GETDATE() instead of a literal date value (a FormatException is thrown during Domain.Build()).

asked Feb 21 '14 at 04:21

ericmutta's gravatar image

ericmutta
13446


One Answer:

Hello Eric,

Default property expects a .NET value rather than SQL expression.

We have plans to support SQL expressions as well but this is not yet implemented.

In the code you could always initialize the value in the constructor anyway you want.

answered Feb 21 '14 at 07:22

Denis%20Krjuchkov's gravatar image

Denis Krjuchkov
179325

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×6
×5

Asked: Feb 21 '14 at 04:21

Seen: 1,632 times

Last updated: Feb 21 '14 at 07:22

powered by OSQA