Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Can't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
some_date:
type: timestamp
notnull: true
default: CURRENT_TIMESTAMP
http://trac.doctrine-project.org/ticket/1740
In general (maybe 1.3?) it might make sense to enable people to somehow say that the default should not be quoted. Maybe an additional "flag" like the "fixed: true" we have for string type definitions?
However for 1.2 I propose that we look if we can change so that default values are never quoted. Rather they are expected to be an expression/constant. This is somewhat unclean, but should address the most common uses cases with minimal invasion into the yaml syntax. Furthermore even if one does need the string to be quoted (for example when setting a default date "2009-03-03", then one could hard quotes into the default "'2009-03-03'" and it should work on most RDBMS (of course only if they support the ISO date format .. which should be the case for even the most obsure locale settings).
i guess for mysql this feature would actually need to work through a trigger, which makes this change even less appealing. maybe we should instead create a behavior that can handle either setting the CURRENT_* constant or setup a trigger.
In general I think there is some merit to also making it optionally possible to have defaults set inside the model before the data is send to the server (especially for time it can be good to use only the date/time settings from a single server). But this again isnt anything for doctrine 1.2 .. maybe this ticket should be cleaned up into a 2.0 ticket and/or a ticket for a behavior?