{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/4001","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/4001/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/4001/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/4001/events","html_url":"https://github.com/sequelize/sequelize/issues/4001","id":90728147,"number":4001,"title":"Unhandled rejection SequelizeDatabaseError: type \"enum_templates_type\" already exists on PostgreSql","user":{"login":"marcingasior","id":743521,"avatar_url":"https://avatars.githubusercontent.com/u/743521?v=3","gravatar_id":"","url":"https://api.github.com/users/marcingasior","html_url":"https://github.com/marcingasior","followers_url":"https://api.github.com/users/marcingasior/followers","following_url":"https://api.github.com/users/marcingasior/following{/other_user}","gists_url":"https://api.github.com/users/marcingasior/gists{/gist_id}","starred_url":"https://api.github.com/users/marcingasior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcingasior/subscriptions","organizations_url":"https://api.github.com/users/marcingasior/orgs","repos_url":"https://api.github.com/users/marcingasior/repos","events_url":"https://api.github.com/users/marcingasior/events{/privacy}","received_events_url":"https://api.github.com/users/marcingasior/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-06-24T16:37:28Z","updated_at":"2015-06-25T11:24:25Z","closed_at":"2015-06-25T11:24:25Z","body":"With every sync, sequelize tries to create a type\r\nExecuting (default): CREATE TYPE \"enum_templates_type\" AS ENUM('TEMPLATE', 'FRAGMENT');\r\nwhich fails with: \r\n\r\nUnhandled rejection SequelizeDatabaseError: type \"enum_templates_type\" already exists\r\n    at Query.formatError (~node_modules/sequelize/lib/dialects/postgres/query.js:423:14)\r\n    at null.<anonymous> ~node_modules/sequelize/lib/dialects/postgres/query.js:104:19)\r\n    at EventEmitter.emit (events.js:95:17)\r\n    at Query.handleError (~node_modules/pg/lib/query.js:99:8)\r\n    at null.<anonymous> (~node_modules/pg/lib/client.js:163:26)\r\n    at EventEmitter.emit (events.js:95:17)\r\n    at Socket.<anonymous> (~node_modules/pg/lib/connection.js:109:12)\r\n    at Socket.EventEmitter.emit (events.js:95:17)\r\n\r\n\r\nMy model looks like:\r\n    var Template = sequelize.define(\"template\",\r\n\r\n        {\r\n            id: {\r\n                type: DataTypes.UUID,\r\n                primaryKey: true,\r\n                defaultValue: DataTypes.UUIDV4,\r\n                allowNull: false\r\n            },\r\n\r\n            type: {\r\n                type: DataTypes.ENUM('TEMPLATE','FRAGMENT')\r\n            }\r\n});\r\n"},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/115214810","html_url":"https://github.com/sequelize/sequelize/issues/4001#issuecomment-115214810","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/4001","id":115214810,"user":{"login":"marcingasior","id":743521,"avatar_url":"https://avatars.githubusercontent.com/u/743521?v=3","gravatar_id":"","url":"https://api.github.com/users/marcingasior","html_url":"https://github.com/marcingasior","followers_url":"https://api.github.com/users/marcingasior/followers","following_url":"https://api.github.com/users/marcingasior/following{/other_user}","gists_url":"https://api.github.com/users/marcingasior/gists{/gist_id}","starred_url":"https://api.github.com/users/marcingasior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcingasior/subscriptions","organizations_url":"https://api.github.com/users/marcingasior/orgs","repos_url":"https://api.github.com/users/marcingasior/repos","events_url":"https://api.github.com/users/marcingasior/events{/privacy}","received_events_url":"https://api.github.com/users/marcingasior/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T11:24:25Z","updated_at":"2015-06-25T11:24:25Z","body":"@janmeier \r\nI get it working on latest 3.3.2, the only change I had to make is specify schema when creating Sequelize object.\r\n\r\nThanks for help."}}