{"action":"created","issue":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/1991","repository_url":"https://api.github.com/repos/typeorm/typeorm","labels_url":"https://api.github.com/repos/typeorm/typeorm/issues/1991/labels{/name}","comments_url":"https://api.github.com/repos/typeorm/typeorm/issues/1991/comments","events_url":"https://api.github.com/repos/typeorm/typeorm/issues/1991/events","html_url":"https://github.com/typeorm/typeorm/issues/1991","id":316580604,"number":1991,"title":"@CreateDateColumn() and @UpdateDateColumn() bug on {synchronize: true} (mssql)","user":{"login":"periman2","id":20288716,"avatar_url":"https://avatars0.githubusercontent.com/u/20288716?v=4","gravatar_id":"","url":"https://api.github.com/users/periman2","html_url":"https://github.com/periman2","followers_url":"https://api.github.com/users/periman2/followers","following_url":"https://api.github.com/users/periman2/following{/other_user}","gists_url":"https://api.github.com/users/periman2/gists{/gist_id}","starred_url":"https://api.github.com/users/periman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/periman2/subscriptions","organizations_url":"https://api.github.com/users/periman2/orgs","repos_url":"https://api.github.com/users/periman2/repos","events_url":"https://api.github.com/users/periman2/events{/privacy}","received_events_url":"https://api.github.com/users/periman2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-22T13:48:57Z","updated_at":"2018-04-25T10:09:33Z","closed_at":null,"author_association":"NONE","body":"**Issue type:**\r\n\r\n[ ] question\r\n[x] bug report\r\n[ ] feature request\r\n[ ] documentation issue\r\n\r\n**Database system/driver:**\r\n\r\n[ ] `cordova`\r\n[ ] `mongodb`\r\n[x] `mssql`\r\n[ ] `mysql` / `mariadb`\r\n[ ] `oracle`\r\n[ ] `postgres`\r\n[ ] `sqlite`\r\n[ ] `sqljs`\r\n[ ] `react-native`\r\n\r\n**TypeORM version:**\r\n\r\n[x] `latest`\r\n[ ] `@next`\r\n[ ] `0.x.x` (or put your version here)\r\n\r\n**Steps to reproduce or a small repository showing the problem:**\r\n\r\nI found a bug when using the update and create custom columns provided by typeorm in mssql:\r\n```\r\n@CreateDateColumn()\r\n    public createdAt: string;\r\n\r\n@UpdateDateColumn()\r\npublic updatedAt: string;\r\n```\r\n\r\nWhen I add them in my entity and I enable **synchronize: true** in the db options the first time it runs okay and it created the tables. The second time and all the next one it crashes with this error:\r\n```\r\n.\r\nQueryFailedError: Error: Could not create constraint or index. See previous errors.\r\n    at new QueryFailedError (C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\node_\r\nmodules\\typeorm\\error\\QueryFailedError.js:27:28)\r\n    at C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\node_modules\\typeorm\\driver\r\n\\sqlserver\\SqlServerQueryRunner.js:265:61\r\n    at _query (C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\node_modules\\mssql\\\r\nlib\\base.js:1253:25)\r\n    at Request.tds.Request.err [as userCallback] (C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\node_modules\\mssql\\lib\\tedious.js:620:15)\r\n    at Request._this.callback (C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\nod\r\ne_modules\\tedious\\lib\\request.js:60:27)\r\n    at Connection.endOfMessageMarkerReceived (C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\node_modules\\tedious\\lib\\connection.js:1777:20)\r\n    at Connection.dispatchEvent (C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\n\r\node_modules\\tedious\\lib\\connection.js:863:38)\r\n    at Parser.<anonymous> (C:\\Users\\FRONTEND01\\Documents\\Visual Studio 2017\\Projects\\project\\project\\node_mo\r\ndules\\tedious\\lib\\connection.js:684:18)\r\n    at emitOne (events.js:115:13)\r\n```\r\nI only have two entities in my database so far and the one that I added the columns into has a OneToMany relation with the other entity. I don't know if that plays any role on resolving the issue though."},"comment":{"url":"https://api.github.com/repos/typeorm/typeorm/issues/comments/384235219","html_url":"https://github.com/typeorm/typeorm/issues/1991#issuecomment-384235219","issue_url":"https://api.github.com/repos/typeorm/typeorm/issues/1991","id":384235219,"user":{"login":"periman2","id":20288716,"avatar_url":"https://avatars0.githubusercontent.com/u/20288716?v=4","gravatar_id":"","url":"https://api.github.com/users/periman2","html_url":"https://github.com/periman2","followers_url":"https://api.github.com/users/periman2/followers","following_url":"https://api.github.com/users/periman2/following{/other_user}","gists_url":"https://api.github.com/users/periman2/gists{/gist_id}","starred_url":"https://api.github.com/users/periman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/periman2/subscriptions","organizations_url":"https://api.github.com/users/periman2/orgs","repos_url":"https://api.github.com/users/periman2/repos","events_url":"https://api.github.com/users/periman2/events{/privacy}","received_events_url":"https://api.github.com/users/periman2/received_events","type":"User","site_admin":false},"created_at":"2018-04-25T10:09:33Z","updated_at":"2018-04-25T10:09:33Z","author_association":"NONE","body":"@pleerock Will do ASAP. "}}
{"actor":{"display_login":"periman2"}}