{"action":"created","comment":{"url":"https://api.github.com/repos/lotus/lotus/pulls/comments/25510841","id":25510841,"diff_hunk":"@@ -0,0 +1,69 @@\n+require 'lotus/router'\n+require 'lotus/model'\n+\n+module Lotus\n+  module Commands\n+    class DB\n+\n+      DEFAULT_STEP = 1 \n+      APP_MIGRATION_DIRECOTRY = \"apps/web/db/migrations\".freeze\n+      MIGRATION_DIRECTORY = \"db/migrations\".freeze\n+\n+      def initialize(name=nil, environment)\n+        @name         = name\n+        @environment  = environment\n+        @options      = @environment.to_options\n+        load_environment\n+        @migrator     = Lotus::Model::Migrator.new(adapter_config)","path":"lib/lotus/commands/db.rb","position":17,"original_position":17,"commit_id":"fac936e0c5e115dab13457210cad541704c41527","original_commit_id":"fac936e0c5e115dab13457210cad541704c41527","user":{"login":"joneslee85","id":135605,"avatar_url":"https://avatars.githubusercontent.com/u/135605?v=3","gravatar_id":"","url":"https://api.github.com/users/joneslee85","html_url":"https://github.com/joneslee85","followers_url":"https://api.github.com/users/joneslee85/followers","following_url":"https://api.github.com/users/joneslee85/following{/other_user}","gists_url":"https://api.github.com/users/joneslee85/gists{/gist_id}","starred_url":"https://api.github.com/users/joneslee85/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joneslee85/subscriptions","organizations_url":"https://api.github.com/users/joneslee85/orgs","repos_url":"https://api.github.com/users/joneslee85/repos","events_url":"https://api.github.com/users/joneslee85/events{/privacy}","received_events_url":"https://api.github.com/users/joneslee85/received_events","type":"User","site_admin":false},"body":"Can you please set `logger: Lotus::Logger.new`? In our lotus/model constructor, I use `::Logger`, however we should take advantage of the lotus logger here instead. Please see reference (https://github.com/lotus/model/pull/144/files#diff-baefffc88152883d05db7211163864e0R126)","created_at":"2015-02-27T14:51:51Z","updated_at":"2015-02-27T14:51:51Z","html_url":"https://github.com/lotus/lotus/pull/161#discussion_r25510841","pull_request_url":"https://api.github.com/repos/lotus/lotus/pulls/161","_links":{"self":{"href":"https://api.github.com/repos/lotus/lotus/pulls/comments/25510841"},"html":{"href":"https://github.com/lotus/lotus/pull/161#discussion_r25510841"},"pull_request":{"href":"https://api.github.com/repos/lotus/lotus/pulls/161"}}},"pull_request":{"url":"https://api.github.com/repos/lotus/lotus/pulls/161","id":29866773,"html_url":"https://github.com/lotus/lotus/pull/161","diff_url":"https://github.com/lotus/lotus/pull/161.diff","patch_url":"https://github.com/lotus/lotus/pull/161.patch","issue_url":"https://api.github.com/repos/lotus/lotus/issues/161","number":161,"state":"open","locked":false,"title":"CLI db migrate/rollback ","user":{"login":"vinioliveira","id":341918,"avatar_url":"https://avatars.githubusercontent.com/u/341918?v=3","gravatar_id":"","url":"https://api.github.com/users/vinioliveira","html_url":"https://github.com/vinioliveira","followers_url":"https://api.github.com/users/vinioliveira/followers","following_url":"https://api.github.com/users/vinioliveira/following{/other_user}","gists_url":"https://api.github.com/users/vinioliveira/gists{/gist_id}","starred_url":"https://api.github.com/users/vinioliveira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinioliveira/subscriptions","organizations_url":"https://api.github.com/users/vinioliveira/orgs","repos_url":"https://api.github.com/users/vinioliveira/repos","events_url":"https://api.github.com/users/vinioliveira/events{/privacy}","received_events_url":"https://api.github.com/users/vinioliveira/received_events","type":"User","site_admin":false},"body":"As discussed here: #137 and #138\r\n\r\nI haven't finished yet, still missing clean up the code as well, implement more tests. \r\nHowever, I've opened the PR to see what you guys think. \r\nAs it's my first contribution, I tried to follow same pattern that I found, let me know if you have any guideline or style guide.\r\n\r\n\r\n###NOTE\r\nI did `db rollback --step=1` instead of `db rollback STEP=1`\r\nI'd prefer Thor's options style instead of nested subcommand or environment variable. \r\nI think it's more explicit and it can be found on lotus CLI help.\r\n","created_at":"2015-02-24T02:42:49Z","updated_at":"2015-02-27T14:51:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50c42df7ea8cdcbde9336bc0afd7469489c59858","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lotus/lotus/pulls/161/commits","review_comments_url":"https://api.github.com/repos/lotus/lotus/pulls/161/comments","review_comment_url":"https://api.github.com/repos/lotus/lotus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lotus/lotus/issues/161/comments","statuses_url":"https://api.github.com/repos/lotus/lotus/statuses/fac936e0c5e115dab13457210cad541704c41527","head":{"label":"vinioliveira:cli-db-migrations","ref":"cli-db-migrations","sha":"fac936e0c5e115dab13457210cad541704c41527","user":{"login":"vinioliveira","id":341918,"avatar_url":"https://avatars.githubusercontent.com/u/341918?v=3","gravatar_id":"","url":"https://api.github.com/users/vinioliveira","html_url":"https://github.com/vinioliveira","followers_url":"https://api.github.com/users/vinioliveira/followers","following_url":"https://api.github.com/users/vinioliveira/following{/other_user}","gists_url":"https://api.github.com/users/vinioliveira/gists{/gist_id}","starred_url":"https://api.github.com/users/vinioliveira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinioliveira/subscriptions","organizations_url":"https://api.github.com/users/vinioliveira/orgs","repos_url":"https://api.github.com/users/vinioliveira/repos","events_url":"https://api.github.com/users/vinioliveira/events{/privacy}","received_events_url":"https://api.github.com/users/vinioliveira/received_events","type":"User","site_admin":false},"repo":{"id":30841450,"name":"lotus","full_name":"vinioliveira/lotus","owner":{"login":"vinioliveira","id":341918,"avatar_url":"https://avatars.githubusercontent.com/u/341918?v=3","gravatar_id":"","url":"https://api.github.com/users/vinioliveira","html_url":"https://github.com/vinioliveira","followers_url":"https://api.github.com/users/vinioliveira/followers","following_url":"https://api.github.com/users/vinioliveira/following{/other_user}","gists_url":"https://api.github.com/users/vinioliveira/gists{/gist_id}","starred_url":"https://api.github.com/users/vinioliveira/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinioliveira/subscriptions","organizations_url":"https://api.github.com/users/vinioliveira/orgs","repos_url":"https://api.github.com/users/vinioliveira/repos","events_url":"https://api.github.com/users/vinioliveira/events{/privacy}","received_events_url":"https://api.github.com/users/vinioliveira/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vinioliveira/lotus","description":"A complete web framework for Ruby","fork":true,"url":"https://api.github.com/repos/vinioliveira/lotus","forks_url":"https://api.github.com/repos/vinioliveira/lotus/forks","keys_url":"https://api.github.com/repos/vinioliveira/lotus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vinioliveira/lotus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vinioliveira/lotus/teams","hooks_url":"https://api.github.com/repos/vinioliveira/lotus/hooks","issue_events_url":"https://api.github.com/repos/vinioliveira/lotus/issues/events{/number}","events_url":"https://api.github.com/repos/vinioliveira/lotus/events","assignees_url":"https://api.github.com/repos/vinioliveira/lotus/assignees{/user}","branches_url":"https://api.github.com/repos/vinioliveira/lotus/branches{/branch}","tags_url":"https://api.github.com/repos/vinioliveira/lotus/tags","blobs_url":"https://api.github.com/repos/vinioliveira/lotus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vinioliveira/lotus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vinioliveira/lotus/git/refs{/sha}","trees_url":"https://api.github.com/repos/vinioliveira/lotus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vinioliveira/lotus/statuses/{sha}","languages_url":"https://api.github.com/repos/vinioliveira/lotus/languages","stargazers_url":"https://api.github.com/repos/vinioliveira/lotus/stargazers","contributors_url":"https://api.github.com/repos/vinioliveira/lotus/contributors","subscribers_url":"https://api.github.com/repos/vinioliveira/lotus/subscribers","subscription_url":"https://api.github.com/repos/vinioliveira/lotus/subscription","commits_url":"https://api.github.com/repos/vinioliveira/lotus/commits{/sha}","git_commits_url":"https://api.github.com/repos/vinioliveira/lotus/git/commits{/sha}","comments_url":"https://api.github.com/repos/vinioliveira/lotus/comments{/number}","issue_comment_url":"https://api.github.com/repos/vinioliveira/lotus/issues/comments{/number}","contents_url":"https://api.github.com/repos/vinioliveira/lotus/contents/{+path}","compare_url":"https://api.github.com/repos/vinioliveira/lotus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vinioliveira/lotus/merges","archive_url":"https://api.github.com/repos/vinioliveira/lotus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vinioliveira/lotus/downloads","issues_url":"https://api.github.com/repos/vinioliveira/lotus/issues{/number}","pulls_url":"https://api.github.com/repos/vinioliveira/lotus/pulls{/number}","milestones_url":"https://api.github.com/repos/vinioliveira/lotus/milestones{/number}","notifications_url":"https://api.github.com/repos/vinioliveira/lotus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vinioliveira/lotus/labels{/name}","releases_url":"https://api.github.com/repos/vinioliveira/lotus/releases{/id}","created_at":"2015-02-15T20:46:52Z","updated_at":"2015-02-27T04:20:11Z","pushed_at":"2015-02-27T04:26:51Z","git_url":"git://github.com/vinioliveira/lotus.git","ssh_url":"git@github.com:vinioliveira/lotus.git","clone_url":"https://github.com/vinioliveira/lotus.git","svn_url":"https://github.com/vinioliveira/lotus","homepage":"http://lotusrb.org","size":589,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"lotus:master","ref":"master","sha":"f9c41dd8ba9d9f3ea4918d7c07e394aba1396294","user":{"login":"lotus","id":3210273,"avatar_url":"https://avatars.githubusercontent.com/u/3210273?v=3","gravatar_id":"","url":"https://api.github.com/users/lotus","html_url":"https://github.com/lotus","followers_url":"https://api.github.com/users/lotus/followers","following_url":"https://api.github.com/users/lotus/following{/other_user}","gists_url":"https://api.github.com/users/lotus/gists{/gist_id}","starred_url":"https://api.github.com/users/lotus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lotus/subscriptions","organizations_url":"https://api.github.com/users/lotus/orgs","repos_url":"https://api.github.com/users/lotus/repos","events_url":"https://api.github.com/users/lotus/events{/privacy}","received_events_url":"https://api.github.com/users/lotus/received_events","type":"Organization","site_admin":false},"repo":{"id":12004006,"name":"lotus","full_name":"lotus/lotus","owner":{"login":"lotus","id":3210273,"avatar_url":"https://avatars.githubusercontent.com/u/3210273?v=3","gravatar_id":"","url":"https://api.github.com/users/lotus","html_url":"https://github.com/lotus","followers_url":"https://api.github.com/users/lotus/followers","following_url":"https://api.github.com/users/lotus/following{/other_user}","gists_url":"https://api.github.com/users/lotus/gists{/gist_id}","starred_url":"https://api.github.com/users/lotus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lotus/subscriptions","organizations_url":"https://api.github.com/users/lotus/orgs","repos_url":"https://api.github.com/users/lotus/repos","events_url":"https://api.github.com/users/lotus/events{/privacy}","received_events_url":"https://api.github.com/users/lotus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lotus/lotus","description":"A complete web framework for Ruby","fork":false,"url":"https://api.github.com/repos/lotus/lotus","forks_url":"https://api.github.com/repos/lotus/lotus/forks","keys_url":"https://api.github.com/repos/lotus/lotus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lotus/lotus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lotus/lotus/teams","hooks_url":"https://api.github.com/repos/lotus/lotus/hooks","issue_events_url":"https://api.github.com/repos/lotus/lotus/issues/events{/number}","events_url":"https://api.github.com/repos/lotus/lotus/events","assignees_url":"https://api.github.com/repos/lotus/lotus/assignees{/user}","branches_url":"https://api.github.com/repos/lotus/lotus/branches{/branch}","tags_url":"https://api.github.com/repos/lotus/lotus/tags","blobs_url":"https://api.github.com/repos/lotus/lotus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lotus/lotus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lotus/lotus/git/refs{/sha}","trees_url":"https://api.github.com/repos/lotus/lotus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lotus/lotus/statuses/{sha}","languages_url":"https://api.github.com/repos/lotus/lotus/languages","stargazers_url":"https://api.github.com/repos/lotus/lotus/stargazers","contributors_url":"https://api.github.com/repos/lotus/lotus/contributors","subscribers_url":"https://api.github.com/repos/lotus/lotus/subscribers","subscription_url":"https://api.github.com/repos/lotus/lotus/subscription","commits_url":"https://api.github.com/repos/lotus/lotus/commits{/sha}","git_commits_url":"https://api.github.com/repos/lotus/lotus/git/commits{/sha}","comments_url":"https://api.github.com/repos/lotus/lotus/comments{/number}","issue_comment_url":"https://api.github.com/repos/lotus/lotus/issues/comments{/number}","contents_url":"https://api.github.com/repos/lotus/lotus/contents/{+path}","compare_url":"https://api.github.com/repos/lotus/lotus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lotus/lotus/merges","archive_url":"https://api.github.com/repos/lotus/lotus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lotus/lotus/downloads","issues_url":"https://api.github.com/repos/lotus/lotus/issues{/number}","pulls_url":"https://api.github.com/repos/lotus/lotus/pulls{/number}","milestones_url":"https://api.github.com/repos/lotus/lotus/milestones{/number}","notifications_url":"https://api.github.com/repos/lotus/lotus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lotus/lotus/labels{/name}","releases_url":"https://api.github.com/repos/lotus/lotus/releases{/id}","created_at":"2013-08-09T15:24:44Z","updated_at":"2015-02-27T12:01:09Z","pushed_at":"2015-02-27T12:01:08Z","git_url":"git://github.com/lotus/lotus.git","ssh_url":"git@github.com:lotus/lotus.git","clone_url":"https://github.com/lotus/lotus.git","svn_url":"https://github.com/lotus/lotus","homepage":"http://lotusrb.org","size":2676,"stargazers_count":1470,"watchers_count":1470,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":133,"mirror_url":null,"open_issues_count":13,"forks":133,"open_issues":13,"watchers":1470,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lotus/lotus/pulls/161"},"html":{"href":"https://github.com/lotus/lotus/pull/161"},"issue":{"href":"https://api.github.com/repos/lotus/lotus/issues/161"},"comments":{"href":"https://api.github.com/repos/lotus/lotus/issues/161/comments"},"review_comments":{"href":"https://api.github.com/repos/lotus/lotus/pulls/161/comments"},"review_comment":{"href":"https://api.github.com/repos/lotus/lotus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lotus/lotus/pulls/161/commits"},"statuses":{"href":"https://api.github.com/repos/lotus/lotus/statuses/fac936e0c5e115dab13457210cad541704c41527"}}}}