{"action":"created","comment":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/72189513","id":72189513,"diff_hunk":"@@ -6,15 +6,145 @@ var chai = require('chai')\n   , Support = require(__dirname + '/../../support')\n   , dialect = Support.getTestDialect()\n   , DataTypes = require(__dirname + '/../../../../lib/data-types')\n+  , Sequelize = require('../../../../index')\n+  , Promise = Sequelize.Promise\n   , _ = require('lodash');\n \n+\n if (dialect.match(/^postgres/)) {\n   describe('[POSTGRES Specific] QueryInterface', function () {\n     beforeEach(function () {\n       this.sequelize.options.quoteIdenifiers = true;\n       this.queryInterface = this.sequelize.getQueryInterface();\n     });\n \n+    describe('createFunction', function () {\n+\n+      beforeEach( function () {\n+        //make sure we don't have a pre-existing function called create_job\n+        //this is needed to cover the edge case of afterEach not getting called because of an unexpected issue or stopage with the \n+        //test suite causing a failure of afterEach's cleanup to be called.\n+        return this.queryInterface.dropFunction('create_job',[{type:'varchar',name:'test'}])\n+        //suppress errors here. if create_job doesn't exist thats ok.\n+        .catch( err => {});\n+      });\n+\n+      afterEach( function () {","path":"test/integration/dialects/postgres/query-interface.test.js","position":27,"original_position":27,"commit_id":"b5a2e5772059cbc19fc3efe9c8fe01c30f755509","original_commit_id":"b5a2e5772059cbc19fc3efe9c8fe01c30f755509","user":{"login":"sushantdhiman","id":9989487,"avatar_url":"https://avatars.githubusercontent.com/u/9989487?v=3","gravatar_id":"","url":"https://api.github.com/users/sushantdhiman","html_url":"https://github.com/sushantdhiman","followers_url":"https://api.github.com/users/sushantdhiman/followers","following_url":"https://api.github.com/users/sushantdhiman/following{/other_user}","gists_url":"https://api.github.com/users/sushantdhiman/gists{/gist_id}","starred_url":"https://api.github.com/users/sushantdhiman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sushantdhiman/subscriptions","organizations_url":"https://api.github.com/users/sushantdhiman/orgs","repos_url":"https://api.github.com/users/sushantdhiman/repos","events_url":"https://api.github.com/users/sushantdhiman/events{/privacy}","received_events_url":"https://api.github.com/users/sushantdhiman/received_events","type":"User","site_admin":false},"body":"As we discussed `beforeEach` is definitely required to cover edge cases, but we can remove `afterEach`","created_at":"2016-07-26T05:23:37Z","updated_at":"2016-07-26T05:23:37Z","html_url":"https://github.com/sequelize/sequelize/pull/6279#discussion_r72189513","pull_request_url":"https://api.github.com/repos/sequelize/sequelize/pulls/6279","_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments/72189513"},"html":{"href":"https://github.com/sequelize/sequelize/pull/6279#discussion_r72189513"},"pull_request":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/6279"}}},"pull_request":{"url":"https://api.github.com/repos/sequelize/sequelize/pulls/6279","id":77562055,"html_url":"https://github.com/sequelize/sequelize/pull/6279","diff_url":"https://github.com/sequelize/sequelize/pull/6279.diff","patch_url":"https://github.com/sequelize/sequelize/pull/6279.patch","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/6279","number":6279,"state":"open","locked":false,"title":"Update postgres query interface","user":{"login":"turbofoxwave","id":1470999,"avatar_url":"https://avatars.githubusercontent.com/u/1470999?v=3","gravatar_id":"","url":"https://api.github.com/users/turbofoxwave","html_url":"https://github.com/turbofoxwave","followers_url":"https://api.github.com/users/turbofoxwave/followers","following_url":"https://api.github.com/users/turbofoxwave/following{/other_user}","gists_url":"https://api.github.com/users/turbofoxwave/gists{/gist_id}","starred_url":"https://api.github.com/users/turbofoxwave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turbofoxwave/subscriptions","organizations_url":"https://api.github.com/users/turbofoxwave/orgs","repos_url":"https://api.github.com/users/turbofoxwave/repos","events_url":"https://api.github.com/users/turbofoxwave/events{/privacy}","received_events_url":"https://api.github.com/users/turbofoxwave/received_events","type":"User","site_admin":false},"body":"### Pull Request check-list\r\n\r\n_Please make sure to review and check all of these items:_\r\n\r\n- [x] Does `npm run test` or `npm run test-DIALECT` pass with this change (including linting)\r\nI have 1 failing testing on my system with the current master branch before adding my changes \r\nFailing test:\r\n[POSTGRES] DataTypes should parse an empty GEOMETRY field:\r\n     SequelizeDatabaseError: Too few ordinates in GeoJSON\r\nAll others are passing.\r\n\r\n- [x] Does your issue contain a link to existing issue (Closes #[issue]) or a description of the issue you are solving?\r\nno\r\n\r\n- [x] Have you added new tests to prevent regressions? yes\r\n- [x] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?  na\r\n- [x] Have you added an entry under `Future` in the changelog? yes\r\n\r\n\r\n### Description of change\r\nChanges are around the postgres query generator to address some issues I found when attempting to use dropFunction and createFunction. The root cause of the issue was due to the function expandFunctionParamList. Along the way I also found an issue with dropFunction in which the generated sql lacked a space after the keyword 'FUNCTION' ex: \"FUNCTION myfunc\" vs \"FUNCTIONmyfunc\".  I've also added tests for createFunction and dropFunction and I've stubbed out some tests for renameFunction.\r\n","created_at":"2016-07-15T04:29:29Z","updated_at":"2016-07-26T05:23:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a98ecc673a08c293ca2bf3eba9c19c7ae3d17e9a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sequelize/sequelize/pulls/6279/commits","review_comments_url":"https://api.github.com/repos/sequelize/sequelize/pulls/6279/comments","review_comment_url":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/6279/comments","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/b5a2e5772059cbc19fc3efe9c8fe01c30f755509","head":{"label":"turbofoxwave:update-postgres-query-interface","ref":"update-postgres-query-interface","sha":"b5a2e5772059cbc19fc3efe9c8fe01c30f755509","user":{"login":"turbofoxwave","id":1470999,"avatar_url":"https://avatars.githubusercontent.com/u/1470999?v=3","gravatar_id":"","url":"https://api.github.com/users/turbofoxwave","html_url":"https://github.com/turbofoxwave","followers_url":"https://api.github.com/users/turbofoxwave/followers","following_url":"https://api.github.com/users/turbofoxwave/following{/other_user}","gists_url":"https://api.github.com/users/turbofoxwave/gists{/gist_id}","starred_url":"https://api.github.com/users/turbofoxwave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turbofoxwave/subscriptions","organizations_url":"https://api.github.com/users/turbofoxwave/orgs","repos_url":"https://api.github.com/users/turbofoxwave/repos","events_url":"https://api.github.com/users/turbofoxwave/events{/privacy}","received_events_url":"https://api.github.com/users/turbofoxwave/received_events","type":"User","site_admin":false},"repo":{"id":58289069,"name":"sequelize","full_name":"turbofoxwave/sequelize","owner":{"login":"turbofoxwave","id":1470999,"avatar_url":"https://avatars.githubusercontent.com/u/1470999?v=3","gravatar_id":"","url":"https://api.github.com/users/turbofoxwave","html_url":"https://github.com/turbofoxwave","followers_url":"https://api.github.com/users/turbofoxwave/followers","following_url":"https://api.github.com/users/turbofoxwave/following{/other_user}","gists_url":"https://api.github.com/users/turbofoxwave/gists{/gist_id}","starred_url":"https://api.github.com/users/turbofoxwave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/turbofoxwave/subscriptions","organizations_url":"https://api.github.com/users/turbofoxwave/orgs","repos_url":"https://api.github.com/users/turbofoxwave/repos","events_url":"https://api.github.com/users/turbofoxwave/events{/privacy}","received_events_url":"https://api.github.com/users/turbofoxwave/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/turbofoxwave/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":true,"url":"https://api.github.com/repos/turbofoxwave/sequelize","forks_url":"https://api.github.com/repos/turbofoxwave/sequelize/forks","keys_url":"https://api.github.com/repos/turbofoxwave/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/turbofoxwave/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/turbofoxwave/sequelize/teams","hooks_url":"https://api.github.com/repos/turbofoxwave/sequelize/hooks","issue_events_url":"https://api.github.com/repos/turbofoxwave/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/turbofoxwave/sequelize/events","assignees_url":"https://api.github.com/repos/turbofoxwave/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/turbofoxwave/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/turbofoxwave/sequelize/tags","blobs_url":"https://api.github.com/repos/turbofoxwave/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/turbofoxwave/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/turbofoxwave/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/turbofoxwave/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/turbofoxwave/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/turbofoxwave/sequelize/languages","stargazers_url":"https://api.github.com/repos/turbofoxwave/sequelize/stargazers","contributors_url":"https://api.github.com/repos/turbofoxwave/sequelize/contributors","subscribers_url":"https://api.github.com/repos/turbofoxwave/sequelize/subscribers","subscription_url":"https://api.github.com/repos/turbofoxwave/sequelize/subscription","commits_url":"https://api.github.com/repos/turbofoxwave/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/turbofoxwave/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/turbofoxwave/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/turbofoxwave/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/turbofoxwave/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/turbofoxwave/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/turbofoxwave/sequelize/merges","archive_url":"https://api.github.com/repos/turbofoxwave/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/turbofoxwave/sequelize/downloads","issues_url":"https://api.github.com/repos/turbofoxwave/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/turbofoxwave/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/turbofoxwave/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/turbofoxwave/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/turbofoxwave/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/turbofoxwave/sequelize/releases{/id}","deployments_url":"https://api.github.com/repos/turbofoxwave/sequelize/deployments","created_at":"2016-05-07T23:49:00Z","updated_at":"2016-05-07T23:49:07Z","pushed_at":"2016-07-26T04:00:33Z","git_url":"git://github.com/turbofoxwave/sequelize.git","ssh_url":"git@github.com:turbofoxwave/sequelize.git","clone_url":"https://github.com/turbofoxwave/sequelize.git","svn_url":"https://github.com/turbofoxwave/sequelize","homepage":"http://sequelizejs.com","size":18256,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sequelize:master","ref":"master","sha":"8a4f5280b3103635a3ccfa3352e1518bb9040e9c","user":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"repo":{"id":790359,"name":"sequelize","full_name":"sequelize/sequelize","owner":{"login":"sequelize","id":3591786,"avatar_url":"https://avatars.githubusercontent.com/u/3591786?v=3","gravatar_id":"","url":"https://api.github.com/users/sequelize","html_url":"https://github.com/sequelize","followers_url":"https://api.github.com/users/sequelize/followers","following_url":"https://api.github.com/users/sequelize/following{/other_user}","gists_url":"https://api.github.com/users/sequelize/gists{/gist_id}","starred_url":"https://api.github.com/users/sequelize/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sequelize/subscriptions","organizations_url":"https://api.github.com/users/sequelize/orgs","repos_url":"https://api.github.com/users/sequelize/repos","events_url":"https://api.github.com/users/sequelize/events{/privacy}","received_events_url":"https://api.github.com/users/sequelize/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sequelize/sequelize","description":"Sequelize is an easy-to-use multi sql dialect ORM for Node.js & io.js. It currently supports MySQL, MariaDB, SQLite, PostgreSQL and MSSQL.","fork":false,"url":"https://api.github.com/repos/sequelize/sequelize","forks_url":"https://api.github.com/repos/sequelize/sequelize/forks","keys_url":"https://api.github.com/repos/sequelize/sequelize/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sequelize/sequelize/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sequelize/sequelize/teams","hooks_url":"https://api.github.com/repos/sequelize/sequelize/hooks","issue_events_url":"https://api.github.com/repos/sequelize/sequelize/issues/events{/number}","events_url":"https://api.github.com/repos/sequelize/sequelize/events","assignees_url":"https://api.github.com/repos/sequelize/sequelize/assignees{/user}","branches_url":"https://api.github.com/repos/sequelize/sequelize/branches{/branch}","tags_url":"https://api.github.com/repos/sequelize/sequelize/tags","blobs_url":"https://api.github.com/repos/sequelize/sequelize/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sequelize/sequelize/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sequelize/sequelize/git/refs{/sha}","trees_url":"https://api.github.com/repos/sequelize/sequelize/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sequelize/sequelize/statuses/{sha}","languages_url":"https://api.github.com/repos/sequelize/sequelize/languages","stargazers_url":"https://api.github.com/repos/sequelize/sequelize/stargazers","contributors_url":"https://api.github.com/repos/sequelize/sequelize/contributors","subscribers_url":"https://api.github.com/repos/sequelize/sequelize/subscribers","subscription_url":"https://api.github.com/repos/sequelize/sequelize/subscription","commits_url":"https://api.github.com/repos/sequelize/sequelize/commits{/sha}","git_commits_url":"https://api.github.com/repos/sequelize/sequelize/git/commits{/sha}","comments_url":"https://api.github.com/repos/sequelize/sequelize/comments{/number}","issue_comment_url":"https://api.github.com/repos/sequelize/sequelize/issues/comments{/number}","contents_url":"https://api.github.com/repos/sequelize/sequelize/contents/{+path}","compare_url":"https://api.github.com/repos/sequelize/sequelize/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sequelize/sequelize/merges","archive_url":"https://api.github.com/repos/sequelize/sequelize/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sequelize/sequelize/downloads","issues_url":"https://api.github.com/repos/sequelize/sequelize/issues{/number}","pulls_url":"https://api.github.com/repos/sequelize/sequelize/pulls{/number}","milestones_url":"https://api.github.com/repos/sequelize/sequelize/milestones{/number}","notifications_url":"https://api.github.com/repos/sequelize/sequelize/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sequelize/sequelize/labels{/name}","releases_url":"https://api.github.com/repos/sequelize/sequelize/releases{/id}","deployments_url":"https://api.github.com/repos/sequelize/sequelize/deployments","created_at":"2010-07-22T07:11:11Z","updated_at":"2016-07-25T23:32:37Z","pushed_at":"2016-07-26T04:00:34Z","git_url":"git://github.com/sequelize/sequelize.git","ssh_url":"git@github.com:sequelize/sequelize.git","clone_url":"https://github.com/sequelize/sequelize.git","svn_url":"https://github.com/sequelize/sequelize","homepage":"http://sequelizejs.com","size":55498,"stargazers_count":7102,"watchers_count":7102,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1487,"mirror_url":null,"open_issues_count":671,"forks":1487,"open_issues":671,"watchers":7102,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/6279"},"html":{"href":"https://github.com/sequelize/sequelize/pull/6279"},"issue":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/6279"},"comments":{"href":"https://api.github.com/repos/sequelize/sequelize/issues/6279/comments"},"review_comments":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/6279/comments"},"review_comment":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sequelize/sequelize/pulls/6279/commits"},"statuses":{"href":"https://api.github.com/repos/sequelize/sequelize/statuses/b5a2e5772059cbc19fc3efe9c8fe01c30f755509"}}}}
{"actor":{"display_login":"sushantdhiman"}}