
select CONCAT('ALTER TABLE `',TABLE_NAME,'` MODIFY COLUMN `',column_name,'` ',data_type,' NOT NULL DEFAULT ''0000-00-00'' ;')  as sss
from information_schema.columns 
where table_schema='zentao' and (DATA_TYPE = 'date' or DATA_TYPE = 'datetime')  and TABLE_NAME='zt_story' ;



ALTER TABLE `zt_burn` MODIFY COLUMN `date` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_conferenceaction` MODIFY COLUMN `date` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_message` MODIFY COLUMN `date` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_chatuser` MODIFY COLUMN `join` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_chatuser` MODIFY COLUMN `quit` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_score` MODIFY COLUMN `time` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_action` MODIFY COLUMN `date` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_chat` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_chat` MODIFY COLUMN `editedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_chat` MODIFY COLUMN `lastActiveTime` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_chat` MODIFY COLUMN `dismissDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_extension` MODIFY COLUMN `installedTime` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_jenkins` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_jenkins` MODIFY COLUMN `editedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_log` MODIFY COLUMN `date` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_repo` MODIFY COLUMN `lastSync` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_client` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_client` MODIFY COLUMN `editedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_user` MODIFY COLUMN `birthday` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_user` MODIFY COLUMN `join` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_user` MODIFY COLUMN `locked` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_taskestimate` MODIFY COLUMN `date` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_effort` MODIFY COLUMN `date` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_effort` MODIFY COLUMN `begin` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_effort` MODIFY COLUMN `end` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_cron` MODIFY COLUMN `lastTime` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_file` MODIFY COLUMN `addedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_conference` MODIFY COLUMN `openedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testresult` MODIFY COLUMN `date` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testtask` MODIFY COLUMN `begin` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testtask` MODIFY COLUMN `end` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testsuite` MODIFY COLUMN `addedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testsuite` MODIFY COLUMN `lastEditedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testrun` MODIFY COLUMN `lastRunDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_doc` MODIFY COLUMN `addedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_doc` MODIFY COLUMN `editedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_case` MODIFY COLUMN `scriptedDate` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_case` MODIFY COLUMN `openedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_case` MODIFY COLUMN `reviewedDate` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_case` MODIFY COLUMN `lastEditedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_case` MODIFY COLUMN `lastRunDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_entry` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_entry` MODIFY COLUMN `editedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_todo` MODIFY COLUMN `date` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_todo` MODIFY COLUMN `assignedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_todo` MODIFY COLUMN `finishedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_todo` MODIFY COLUMN `closedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_bug` MODIFY COLUMN `activatedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_bug` MODIFY COLUMN `openedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_bug` MODIFY COLUMN `assignedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_bug` MODIFY COLUMN `deadline` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_bug` MODIFY COLUMN `resolvedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_bug` MODIFY COLUMN `closedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_bug` MODIFY COLUMN `lastEditedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_job` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_job` MODIFY COLUMN `editedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_job` MODIFY COLUMN `lastExec` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_webhook` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_webhook` MODIFY COLUMN `editedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_repohistory` MODIFY COLUMN `time` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibz_systpl` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibz_systpl` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibzpro_system` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibzpro_system` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_compile` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_compile` MODIFY COLUMN `updateDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_notify` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_notify` MODIFY COLUMN `sendTime` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_queue` MODIFY COLUMN `addDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_im_queue` MODIFY COLUMN `processDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzorg` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzorg` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzrole` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzrole` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzemp` MODIFY COLUMN `BIRTHDAY` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzemp` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzemp` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_build` MODIFY COLUMN `date` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_team` MODIFY COLUMN `join` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzcfg` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzdataaudit` MODIFY COLUMN `OPTIME` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibz_top` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibz_top` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzpermission` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzpermission` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzrole_permission` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzrole_permission` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzuser` MODIFY COLUMN `BIRTHDAY` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `deadline` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `openedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `assignedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `estStarted` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `realStarted` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `finishedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `canceledDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `closedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_task` MODIFY COLUMN `lastEditedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `databasechangelog` MODIFY COLUMN `DATEEXECUTED` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `databasechangeloglock` MODIFY COLUMN `LOCKGRANTED` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_story` MODIFY COLUMN `openedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_story` MODIFY COLUMN `assignedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_story` MODIFY COLUMN `lastEditedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_story` MODIFY COLUMN `reviewedDate` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_story` MODIFY COLUMN `closedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzfile` MODIFY COLUMN `CREATEDATE` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzfile` MODIFY COLUMN `UPDATEDATE` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzauthlog` MODIFY COLUMN `AUTHTIME` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzuser_role` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzuser_role` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzdept` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `ibzdept` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibz_favorites` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibz_favorites` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_taskmsgrecord` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_taskmsgrecord` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_product` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_productplan` MODIFY COLUMN `begin` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_productplan` MODIFY COLUMN `end` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testreport` MODIFY COLUMN `begin` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testreport` MODIFY COLUMN `end` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_testreport` MODIFY COLUMN `createdDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibzpro_systpl` MODIFY COLUMN `CREATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `t_ibzpro_systpl` MODIFY COLUMN `UPDATEDATE` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_release` MODIFY COLUMN `date` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_project` MODIFY COLUMN `begin` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_project` MODIFY COLUMN `end` date NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_project` MODIFY COLUMN `openedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_project` MODIFY COLUMN `closedDate` datetime NOT NULL DEFAULT '0000-00-00' ;
ALTER TABLE `zt_project` MODIFY COLUMN `canceledDate` datetime NOT NULL DEFAULT '0000-00-00' ;