{"action":"created","comment":{"url":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/comments/26000760","id":26000760,"diff_hunk":"@@ -1,5 +1,7 @@\n (ns clj-sql-up.create)\n \n+(def ^:dynamic *default-migration-dir* \"migrations\")","path":"src/clj_sql_up/create.clj","position":3,"original_position":3,"commit_id":"d364abe6f9480991f6bf13f81f303e54bacb2d2d","original_commit_id":"d364abe6f9480991f6bf13f81f303e54bacb2d2d","user":{"login":"icambron","id":244988,"avatar_url":"https://avatars.githubusercontent.com/u/244988?v=3","gravatar_id":"","url":"https://api.github.com/users/icambron","html_url":"https://github.com/icambron","followers_url":"https://api.github.com/users/icambron/followers","following_url":"https://api.github.com/users/icambron/following{/other_user}","gists_url":"https://api.github.com/users/icambron/gists{/gist_id}","starred_url":"https://api.github.com/users/icambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icambron/subscriptions","organizations_url":"https://api.github.com/users/icambron/orgs","repos_url":"https://api.github.com/users/icambron/repos","events_url":"https://api.github.com/users/icambron/events{/privacy}","received_events_url":"https://api.github.com/users/icambron/received_events","type":"User","site_admin":false},"body":"We certainly can -- my proposal would be that it go in `migration-files`, which would make more sense to the caller:\r\n\r\n```clj\r\n(binding [clj-sql-up.migration-files/*migrations-dir* \"/foo\"]\r\n   (create [\"my-cool-migration\"]))\r\n```\r\n\r\nI'll make that fix.\r\n\r\nAs an aside, that `create` signature is awkward for us users who call your functions directly, rather than through lein. I'd suggest the following:\r\n\r\n```clj\r\n(defn create [name]\r\n  (create-migrations-dir)\r\n  (create-migration-file name))\r\n\r\n(defn create-lein [args]\r\n  (-> args first name create))\r\n```\r\n\r\nand change the lein code to call `create-lein` (or, if you don't like references to lein in your non-lein code, that second function could go in the lein code instead).","created_at":"2015-03-07T23:53:47Z","updated_at":"2015-03-07T23:53:47Z","html_url":"https://github.com/ckuttruff/clj-sql-up/pull/10#discussion_r26000760","pull_request_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/comments/26000760"},"html":{"href":"https://github.com/ckuttruff/clj-sql-up/pull/10#discussion_r26000760"},"pull_request":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10","id":30707902,"html_url":"https://github.com/ckuttruff/clj-sql-up/pull/10","diff_url":"https://github.com/ckuttruff/clj-sql-up/pull/10.diff","patch_url":"https://github.com/ckuttruff/clj-sql-up/pull/10.patch","issue_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/issues/10","number":10,"state":"open","locked":false,"title":"Allow the caller to change where migrations get created","user":{"login":"icambron","id":244988,"avatar_url":"https://avatars.githubusercontent.com/u/244988?v=3","gravatar_id":"","url":"https://api.github.com/users/icambron","html_url":"https://github.com/icambron","followers_url":"https://api.github.com/users/icambron/followers","following_url":"https://api.github.com/users/icambron/following{/other_user}","gists_url":"https://api.github.com/users/icambron/gists{/gist_id}","starred_url":"https://api.github.com/users/icambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icambron/subscriptions","organizations_url":"https://api.github.com/users/icambron/orgs","repos_url":"https://api.github.com/users/icambron/repos","events_url":"https://api.github.com/users/icambron/events{/privacy}","received_events_url":"https://api.github.com/users/icambron/received_events","type":"User","site_admin":false},"body":"I noticed that you allow the caller to dynamically set the location of migration files, but only for migrate/rollback, not for creation. This PR adds that ability.\r\n\r\nI kept the same name -- `*default-migration-dir*` -- for the dynamic var, but FWIW, I think it's wrong in both places, and should just be `*migration-dir*`. When we rebind it, we're changing the actual directory; its *value* merely starts out as the default. Or more generally, it's confusing to change something called \"default\" unless you expect some more granular process to possibly override it.","created_at":"2015-03-07T19:30:03Z","updated_at":"2015-03-07T23:53:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67702d82ec1eedb35a4738e44d3e19b7271ba34e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10/commits","review_comments_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10/comments","review_comment_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/issues/10/comments","statuses_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/statuses/d364abe6f9480991f6bf13f81f303e54bacb2d2d","head":{"label":"icambron:dynamic-create-location","ref":"dynamic-create-location","sha":"d364abe6f9480991f6bf13f81f303e54bacb2d2d","user":{"login":"icambron","id":244988,"avatar_url":"https://avatars.githubusercontent.com/u/244988?v=3","gravatar_id":"","url":"https://api.github.com/users/icambron","html_url":"https://github.com/icambron","followers_url":"https://api.github.com/users/icambron/followers","following_url":"https://api.github.com/users/icambron/following{/other_user}","gists_url":"https://api.github.com/users/icambron/gists{/gist_id}","starred_url":"https://api.github.com/users/icambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icambron/subscriptions","organizations_url":"https://api.github.com/users/icambron/orgs","repos_url":"https://api.github.com/users/icambron/repos","events_url":"https://api.github.com/users/icambron/events{/privacy}","received_events_url":"https://api.github.com/users/icambron/received_events","type":"User","site_admin":false},"repo":{"id":31823486,"name":"clj-sql-up","full_name":"icambron/clj-sql-up","owner":{"login":"icambron","id":244988,"avatar_url":"https://avatars.githubusercontent.com/u/244988?v=3","gravatar_id":"","url":"https://api.github.com/users/icambron","html_url":"https://github.com/icambron","followers_url":"https://api.github.com/users/icambron/followers","following_url":"https://api.github.com/users/icambron/following{/other_user}","gists_url":"https://api.github.com/users/icambron/gists{/gist_id}","starred_url":"https://api.github.com/users/icambron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/icambron/subscriptions","organizations_url":"https://api.github.com/users/icambron/orgs","repos_url":"https://api.github.com/users/icambron/repos","events_url":"https://api.github.com/users/icambron/events{/privacy}","received_events_url":"https://api.github.com/users/icambron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/icambron/clj-sql-up","description":"A simple leiningen plugin for managing SQL database migrations with clojure / jdbc","fork":true,"url":"https://api.github.com/repos/icambron/clj-sql-up","forks_url":"https://api.github.com/repos/icambron/clj-sql-up/forks","keys_url":"https://api.github.com/repos/icambron/clj-sql-up/keys{/key_id}","collaborators_url":"https://api.github.com/repos/icambron/clj-sql-up/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/icambron/clj-sql-up/teams","hooks_url":"https://api.github.com/repos/icambron/clj-sql-up/hooks","issue_events_url":"https://api.github.com/repos/icambron/clj-sql-up/issues/events{/number}","events_url":"https://api.github.com/repos/icambron/clj-sql-up/events","assignees_url":"https://api.github.com/repos/icambron/clj-sql-up/assignees{/user}","branches_url":"https://api.github.com/repos/icambron/clj-sql-up/branches{/branch}","tags_url":"https://api.github.com/repos/icambron/clj-sql-up/tags","blobs_url":"https://api.github.com/repos/icambron/clj-sql-up/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/icambron/clj-sql-up/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/icambron/clj-sql-up/git/refs{/sha}","trees_url":"https://api.github.com/repos/icambron/clj-sql-up/git/trees{/sha}","statuses_url":"https://api.github.com/repos/icambron/clj-sql-up/statuses/{sha}","languages_url":"https://api.github.com/repos/icambron/clj-sql-up/languages","stargazers_url":"https://api.github.com/repos/icambron/clj-sql-up/stargazers","contributors_url":"https://api.github.com/repos/icambron/clj-sql-up/contributors","subscribers_url":"https://api.github.com/repos/icambron/clj-sql-up/subscribers","subscription_url":"https://api.github.com/repos/icambron/clj-sql-up/subscription","commits_url":"https://api.github.com/repos/icambron/clj-sql-up/commits{/sha}","git_commits_url":"https://api.github.com/repos/icambron/clj-sql-up/git/commits{/sha}","comments_url":"https://api.github.com/repos/icambron/clj-sql-up/comments{/number}","issue_comment_url":"https://api.github.com/repos/icambron/clj-sql-up/issues/comments{/number}","contents_url":"https://api.github.com/repos/icambron/clj-sql-up/contents/{+path}","compare_url":"https://api.github.com/repos/icambron/clj-sql-up/compare/{base}...{head}","merges_url":"https://api.github.com/repos/icambron/clj-sql-up/merges","archive_url":"https://api.github.com/repos/icambron/clj-sql-up/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/icambron/clj-sql-up/downloads","issues_url":"https://api.github.com/repos/icambron/clj-sql-up/issues{/number}","pulls_url":"https://api.github.com/repos/icambron/clj-sql-up/pulls{/number}","milestones_url":"https://api.github.com/repos/icambron/clj-sql-up/milestones{/number}","notifications_url":"https://api.github.com/repos/icambron/clj-sql-up/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/icambron/clj-sql-up/labels{/name}","releases_url":"https://api.github.com/repos/icambron/clj-sql-up/releases{/id}","created_at":"2015-03-07T18:56:49Z","updated_at":"2015-03-07T18:56:50Z","pushed_at":"2015-03-07T19:24:50Z","git_url":"git://github.com/icambron/clj-sql-up.git","ssh_url":"git@github.com:icambron/clj-sql-up.git","clone_url":"https://github.com/icambron/clj-sql-up.git","svn_url":"https://github.com/icambron/clj-sql-up","homepage":"","size":111,"stargazers_count":0,"watchers_count":0,"language":"Clojure","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":"ckuttruff:master","ref":"master","sha":"1fced6136efdd1992d5e08d0c552574450fd88ca","user":{"login":"ckuttruff","id":253577,"avatar_url":"https://avatars.githubusercontent.com/u/253577?v=3","gravatar_id":"","url":"https://api.github.com/users/ckuttruff","html_url":"https://github.com/ckuttruff","followers_url":"https://api.github.com/users/ckuttruff/followers","following_url":"https://api.github.com/users/ckuttruff/following{/other_user}","gists_url":"https://api.github.com/users/ckuttruff/gists{/gist_id}","starred_url":"https://api.github.com/users/ckuttruff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckuttruff/subscriptions","organizations_url":"https://api.github.com/users/ckuttruff/orgs","repos_url":"https://api.github.com/users/ckuttruff/repos","events_url":"https://api.github.com/users/ckuttruff/events{/privacy}","received_events_url":"https://api.github.com/users/ckuttruff/received_events","type":"User","site_admin":false},"repo":{"id":11231728,"name":"clj-sql-up","full_name":"ckuttruff/clj-sql-up","owner":{"login":"ckuttruff","id":253577,"avatar_url":"https://avatars.githubusercontent.com/u/253577?v=3","gravatar_id":"","url":"https://api.github.com/users/ckuttruff","html_url":"https://github.com/ckuttruff","followers_url":"https://api.github.com/users/ckuttruff/followers","following_url":"https://api.github.com/users/ckuttruff/following{/other_user}","gists_url":"https://api.github.com/users/ckuttruff/gists{/gist_id}","starred_url":"https://api.github.com/users/ckuttruff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ckuttruff/subscriptions","organizations_url":"https://api.github.com/users/ckuttruff/orgs","repos_url":"https://api.github.com/users/ckuttruff/repos","events_url":"https://api.github.com/users/ckuttruff/events{/privacy}","received_events_url":"https://api.github.com/users/ckuttruff/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ckuttruff/clj-sql-up","description":"A simple leiningen plugin for managing SQL database migrations with clojure / jdbc","fork":false,"url":"https://api.github.com/repos/ckuttruff/clj-sql-up","forks_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/forks","keys_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/teams","hooks_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/hooks","issue_events_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/issues/events{/number}","events_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/events","assignees_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/assignees{/user}","branches_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/branches{/branch}","tags_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/tags","blobs_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/git/refs{/sha}","trees_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/statuses/{sha}","languages_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/languages","stargazers_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/stargazers","contributors_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/contributors","subscribers_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/subscribers","subscription_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/subscription","commits_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/commits{/sha}","git_commits_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/git/commits{/sha}","comments_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/comments{/number}","issue_comment_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/issues/comments{/number}","contents_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/contents/{+path}","compare_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/merges","archive_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/downloads","issues_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/issues{/number}","pulls_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls{/number}","milestones_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/milestones{/number}","notifications_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/labels{/name}","releases_url":"https://api.github.com/repos/ckuttruff/clj-sql-up/releases{/id}","created_at":"2013-07-07T10:10:04Z","updated_at":"2015-03-07T00:59:43Z","pushed_at":"2015-01-17T20:43:51Z","git_url":"git://github.com/ckuttruff/clj-sql-up.git","ssh_url":"git@github.com:ckuttruff/clj-sql-up.git","clone_url":"https://github.com/ckuttruff/clj-sql-up.git","svn_url":"https://github.com/ckuttruff/clj-sql-up","homepage":"","size":332,"stargazers_count":59,"watchers_count":59,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":1,"forks":7,"open_issues":1,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10"},"html":{"href":"https://github.com/ckuttruff/clj-sql-up/pull/10"},"issue":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/issues/10"},"comments":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/ckuttruff/clj-sql-up/statuses/d364abe6f9480991f6bf13f81f303e54bacb2d2d"}}}}