{"action":"opened","number":1362,"pull_request":{"url":"https://api.github.com/repos/tgriesser/knex/pulls/1362","id":67424831,"html_url":"https://github.com/tgriesser/knex/pull/1362","diff_url":"https://github.com/tgriesser/knex/pull/1362.diff","patch_url":"https://github.com/tgriesser/knex/pull/1362.patch","issue_url":"https://api.github.com/repos/tgriesser/knex/issues/1362","number":1362,"state":"open","locked":false,"title":"Mssql fixes","user":{"login":"wolfgang42","id":2261204,"avatar_url":"https://avatars.githubusercontent.com/u/2261204?v=3","gravatar_id":"","url":"https://api.github.com/users/wolfgang42","html_url":"https://github.com/wolfgang42","followers_url":"https://api.github.com/users/wolfgang42/followers","following_url":"https://api.github.com/users/wolfgang42/following{/other_user}","gists_url":"https://api.github.com/users/wolfgang42/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfgang42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfgang42/subscriptions","organizations_url":"https://api.github.com/users/wolfgang42/orgs","repos_url":"https://api.github.com/users/wolfgang42/repos","events_url":"https://api.github.com/users/wolfgang42/events{/privacy}","received_events_url":"https://api.github.com/users/wolfgang42/received_events","type":"User","site_admin":false},"body":"This PR fixes the `mssql` driver's `createTableIfNotExists()` function, which previously (due to an inverted condition) would never actually create the table.\r\n\r\nIt also gets the integration tests *mostly* working; there's one last error I haven't resolved yet:\r\n```\r\n  1) Integration Tests mssql | mssql Schema createTable rejects setting foreign key where tableName is not typeof === string:\r\n     TypeError: Cannot read property 'sql' of undefined\r\n      at TableCompiler.alterTableForCreate (lib/schema/tablecompiler.js:9:10850)\r\n      at TableCompiler.create (lib/schema/tablecompiler.js:9:2125)\r\n      at TableCompiler.toSQL (lib/schema/tablecompiler.js:9:1456)\r\n      at TableBuilder.toSQL (lib/schema/tablebuilder.js:9:1630)\r\n      at SchemaCompiler.createTable (lib/schema/compiler.js:9:2304)\r\n      at SchemaCompiler.toSQL (lib/schema/compiler.js:9:1782)\r\n      at SchemaBuilder.toSQL (lib/schema/builder.js:9:2260)\r\n      at lib/runner.js:9:1117\r\n  From previous event:\r\n      at Runner.run (lib/runner.js:9:733)\r\n      at SchemaBuilder.Target.then (lib/interface.js:9:1345)\r\n```\r\n\r\nThanks to @elhigu for all the help understanding how the knex internals work.\r\n","created_at":"2016-04-21T21:23:49Z","updated_at":"2016-04-21T21:23:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tgriesser/knex/pulls/1362/commits","review_comments_url":"https://api.github.com/repos/tgriesser/knex/pulls/1362/comments","review_comment_url":"https://api.github.com/repos/tgriesser/knex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tgriesser/knex/issues/1362/comments","statuses_url":"https://api.github.com/repos/tgriesser/knex/statuses/a7f609aa4f5b5a1aafd3b2b565d944650f28bb6b","head":{"label":"wolfgang42:mssql-fixes","ref":"mssql-fixes","sha":"a7f609aa4f5b5a1aafd3b2b565d944650f28bb6b","user":{"login":"wolfgang42","id":2261204,"avatar_url":"https://avatars.githubusercontent.com/u/2261204?v=3","gravatar_id":"","url":"https://api.github.com/users/wolfgang42","html_url":"https://github.com/wolfgang42","followers_url":"https://api.github.com/users/wolfgang42/followers","following_url":"https://api.github.com/users/wolfgang42/following{/other_user}","gists_url":"https://api.github.com/users/wolfgang42/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfgang42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfgang42/subscriptions","organizations_url":"https://api.github.com/users/wolfgang42/orgs","repos_url":"https://api.github.com/users/wolfgang42/repos","events_url":"https://api.github.com/users/wolfgang42/events{/privacy}","received_events_url":"https://api.github.com/users/wolfgang42/received_events","type":"User","site_admin":false},"repo":{"id":56805923,"name":"knex","full_name":"wolfgang42/knex","owner":{"login":"wolfgang42","id":2261204,"avatar_url":"https://avatars.githubusercontent.com/u/2261204?v=3","gravatar_id":"","url":"https://api.github.com/users/wolfgang42","html_url":"https://github.com/wolfgang42","followers_url":"https://api.github.com/users/wolfgang42/followers","following_url":"https://api.github.com/users/wolfgang42/following{/other_user}","gists_url":"https://api.github.com/users/wolfgang42/gists{/gist_id}","starred_url":"https://api.github.com/users/wolfgang42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolfgang42/subscriptions","organizations_url":"https://api.github.com/users/wolfgang42/orgs","repos_url":"https://api.github.com/users/wolfgang42/repos","events_url":"https://api.github.com/users/wolfgang42/events{/privacy}","received_events_url":"https://api.github.com/users/wolfgang42/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wolfgang42/knex","description":"A query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.","fork":true,"url":"https://api.github.com/repos/wolfgang42/knex","forks_url":"https://api.github.com/repos/wolfgang42/knex/forks","keys_url":"https://api.github.com/repos/wolfgang42/knex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wolfgang42/knex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wolfgang42/knex/teams","hooks_url":"https://api.github.com/repos/wolfgang42/knex/hooks","issue_events_url":"https://api.github.com/repos/wolfgang42/knex/issues/events{/number}","events_url":"https://api.github.com/repos/wolfgang42/knex/events","assignees_url":"https://api.github.com/repos/wolfgang42/knex/assignees{/user}","branches_url":"https://api.github.com/repos/wolfgang42/knex/branches{/branch}","tags_url":"https://api.github.com/repos/wolfgang42/knex/tags","blobs_url":"https://api.github.com/repos/wolfgang42/knex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wolfgang42/knex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wolfgang42/knex/git/refs{/sha}","trees_url":"https://api.github.com/repos/wolfgang42/knex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wolfgang42/knex/statuses/{sha}","languages_url":"https://api.github.com/repos/wolfgang42/knex/languages","stargazers_url":"https://api.github.com/repos/wolfgang42/knex/stargazers","contributors_url":"https://api.github.com/repos/wolfgang42/knex/contributors","subscribers_url":"https://api.github.com/repos/wolfgang42/knex/subscribers","subscription_url":"https://api.github.com/repos/wolfgang42/knex/subscription","commits_url":"https://api.github.com/repos/wolfgang42/knex/commits{/sha}","git_commits_url":"https://api.github.com/repos/wolfgang42/knex/git/commits{/sha}","comments_url":"https://api.github.com/repos/wolfgang42/knex/comments{/number}","issue_comment_url":"https://api.github.com/repos/wolfgang42/knex/issues/comments{/number}","contents_url":"https://api.github.com/repos/wolfgang42/knex/contents/{+path}","compare_url":"https://api.github.com/repos/wolfgang42/knex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wolfgang42/knex/merges","archive_url":"https://api.github.com/repos/wolfgang42/knex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wolfgang42/knex/downloads","issues_url":"https://api.github.com/repos/wolfgang42/knex/issues{/number}","pulls_url":"https://api.github.com/repos/wolfgang42/knex/pulls{/number}","milestones_url":"https://api.github.com/repos/wolfgang42/knex/milestones{/number}","notifications_url":"https://api.github.com/repos/wolfgang42/knex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wolfgang42/knex/labels{/name}","releases_url":"https://api.github.com/repos/wolfgang42/knex/releases{/id}","deployments_url":"https://api.github.com/repos/wolfgang42/knex/deployments","created_at":"2016-04-21T21:11:43Z","updated_at":"2016-04-21T21:11:44Z","pushed_at":"2016-04-21T21:12:38Z","git_url":"git://github.com/wolfgang42/knex.git","ssh_url":"git@github.com:wolfgang42/knex.git","clone_url":"https://github.com/wolfgang42/knex.git","svn_url":"https://github.com/wolfgang42/knex","homepage":"knexjs.org","size":6877,"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":"tgriesser:master","ref":"master","sha":"85403e8302cba5ef0895760212574808ad29787b","user":{"login":"tgriesser","id":154748,"avatar_url":"https://avatars.githubusercontent.com/u/154748?v=3","gravatar_id":"","url":"https://api.github.com/users/tgriesser","html_url":"https://github.com/tgriesser","followers_url":"https://api.github.com/users/tgriesser/followers","following_url":"https://api.github.com/users/tgriesser/following{/other_user}","gists_url":"https://api.github.com/users/tgriesser/gists{/gist_id}","starred_url":"https://api.github.com/users/tgriesser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgriesser/subscriptions","organizations_url":"https://api.github.com/users/tgriesser/orgs","repos_url":"https://api.github.com/users/tgriesser/repos","events_url":"https://api.github.com/users/tgriesser/events{/privacy}","received_events_url":"https://api.github.com/users/tgriesser/received_events","type":"User","site_admin":false},"repo":{"id":7363211,"name":"knex","full_name":"tgriesser/knex","owner":{"login":"tgriesser","id":154748,"avatar_url":"https://avatars.githubusercontent.com/u/154748?v=3","gravatar_id":"","url":"https://api.github.com/users/tgriesser","html_url":"https://github.com/tgriesser","followers_url":"https://api.github.com/users/tgriesser/followers","following_url":"https://api.github.com/users/tgriesser/following{/other_user}","gists_url":"https://api.github.com/users/tgriesser/gists{/gist_id}","starred_url":"https://api.github.com/users/tgriesser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgriesser/subscriptions","organizations_url":"https://api.github.com/users/tgriesser/orgs","repos_url":"https://api.github.com/users/tgriesser/repos","events_url":"https://api.github.com/users/tgriesser/events{/privacy}","received_events_url":"https://api.github.com/users/tgriesser/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tgriesser/knex","description":"A query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.","fork":false,"url":"https://api.github.com/repos/tgriesser/knex","forks_url":"https://api.github.com/repos/tgriesser/knex/forks","keys_url":"https://api.github.com/repos/tgriesser/knex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tgriesser/knex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tgriesser/knex/teams","hooks_url":"https://api.github.com/repos/tgriesser/knex/hooks","issue_events_url":"https://api.github.com/repos/tgriesser/knex/issues/events{/number}","events_url":"https://api.github.com/repos/tgriesser/knex/events","assignees_url":"https://api.github.com/repos/tgriesser/knex/assignees{/user}","branches_url":"https://api.github.com/repos/tgriesser/knex/branches{/branch}","tags_url":"https://api.github.com/repos/tgriesser/knex/tags","blobs_url":"https://api.github.com/repos/tgriesser/knex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tgriesser/knex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tgriesser/knex/git/refs{/sha}","trees_url":"https://api.github.com/repos/tgriesser/knex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tgriesser/knex/statuses/{sha}","languages_url":"https://api.github.com/repos/tgriesser/knex/languages","stargazers_url":"https://api.github.com/repos/tgriesser/knex/stargazers","contributors_url":"https://api.github.com/repos/tgriesser/knex/contributors","subscribers_url":"https://api.github.com/repos/tgriesser/knex/subscribers","subscription_url":"https://api.github.com/repos/tgriesser/knex/subscription","commits_url":"https://api.github.com/repos/tgriesser/knex/commits{/sha}","git_commits_url":"https://api.github.com/repos/tgriesser/knex/git/commits{/sha}","comments_url":"https://api.github.com/repos/tgriesser/knex/comments{/number}","issue_comment_url":"https://api.github.com/repos/tgriesser/knex/issues/comments{/number}","contents_url":"https://api.github.com/repos/tgriesser/knex/contents/{+path}","compare_url":"https://api.github.com/repos/tgriesser/knex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tgriesser/knex/merges","archive_url":"https://api.github.com/repos/tgriesser/knex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tgriesser/knex/downloads","issues_url":"https://api.github.com/repos/tgriesser/knex/issues{/number}","pulls_url":"https://api.github.com/repos/tgriesser/knex/pulls{/number}","milestones_url":"https://api.github.com/repos/tgriesser/knex/milestones{/number}","notifications_url":"https://api.github.com/repos/tgriesser/knex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tgriesser/knex/labels{/name}","releases_url":"https://api.github.com/repos/tgriesser/knex/releases{/id}","deployments_url":"https://api.github.com/repos/tgriesser/knex/deployments","created_at":"2012-12-29T05:18:25Z","updated_at":"2016-04-21T21:06:28Z","pushed_at":"2016-04-14T04:03:49Z","git_url":"git://github.com/tgriesser/knex.git","ssh_url":"git@github.com:tgriesser/knex.git","clone_url":"https://github.com/tgriesser/knex.git","svn_url":"https://github.com/tgriesser/knex","homepage":"knexjs.org","size":7791,"stargazers_count":2697,"watchers_count":2697,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":402,"mirror_url":null,"open_issues_count":319,"forks":402,"open_issues":319,"watchers":2697,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/1362"},"html":{"href":"https://github.com/tgriesser/knex/pull/1362"},"issue":{"href":"https://api.github.com/repos/tgriesser/knex/issues/1362"},"comments":{"href":"https://api.github.com/repos/tgriesser/knex/issues/1362/comments"},"review_comments":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/1362/comments"},"review_comment":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tgriesser/knex/pulls/1362/commits"},"statuses":{"href":"https://api.github.com/repos/tgriesser/knex/statuses/a7f609aa4f5b5a1aafd3b2b565d944650f28bb6b"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":7,"deletions":7,"changed_files":2}}