{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/9759","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/9759/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/9759/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/9759/events","html_url":"https://github.com/yiisoft/yii2/issues/9759","id":108028924,"number":9759,"title":"loadDefaultValues, NOT NULL on TIMESTAMP column MySql","user":{"login":"andrewblake1","id":1947758,"avatar_url":"https://avatars.githubusercontent.com/u/1947758?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewblake1","html_url":"https://github.com/andrewblake1","followers_url":"https://api.github.com/users/andrewblake1/followers","following_url":"https://api.github.com/users/andrewblake1/following{/other_user}","gists_url":"https://api.github.com/users/andrewblake1/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewblake1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewblake1/subscriptions","organizations_url":"https://api.github.com/users/andrewblake1/orgs","repos_url":"https://api.github.com/users/andrewblake1/repos","events_url":"https://api.github.com/users/andrewblake1/events{/privacy}","received_events_url":"https://api.github.com/users/andrewblake1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T23:43:21Z","updated_at":"2015-09-24T06:29:18Z","closed_at":null,"body":"Not sure if the following is desired behaviour:\r\n\r\nBecause MySql unfortunately automatically adds a default of CURRENT_TIMESTAMP to the first timestamp column of a table (even when NOT NULL attribute is set) this comes through as the value text set for the attribute in loadDefaultValues.\r\n\r\nWhile it is annoying behaviour from MySql it is the documented action for first TIMESTAMP column.\r\n\r\nIn one situation I found, I was wondering why a required rule wasn't being enforced on a DatePicker via kartik-v\\DateControl. It was because with DateControl the submitted input is hidden and was carrying a value of \"CURRENT_TIMESTAMP\".\r\n\r\nHave overridden in loadDevaultValues and tested for this in my code but thought I would raise in case it was undesired in general.\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/142826786","html_url":"https://github.com/yiisoft/yii2/issues/9759#issuecomment-142826786","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/9759","id":142826786,"user":{"login":"nineinchnick","id":795177,"avatar_url":"https://avatars.githubusercontent.com/u/795177?v=3","gravatar_id":"","url":"https://api.github.com/users/nineinchnick","html_url":"https://github.com/nineinchnick","followers_url":"https://api.github.com/users/nineinchnick/followers","following_url":"https://api.github.com/users/nineinchnick/following{/other_user}","gists_url":"https://api.github.com/users/nineinchnick/gists{/gist_id}","starred_url":"https://api.github.com/users/nineinchnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nineinchnick/subscriptions","organizations_url":"https://api.github.com/users/nineinchnick/orgs","repos_url":"https://api.github.com/users/nineinchnick/repos","events_url":"https://api.github.com/users/nineinchnick/events{/privacy}","received_events_url":"https://api.github.com/users/nineinchnick/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T06:29:18Z","updated_at":"2015-09-24T06:29:18Z","body":"Core issue here is there is no support for sql expressions as default values, only scalar constants."}}