{"action":"created","issue":{"url":"https://api.github.com/repos/lotus/model/issues/144","labels_url":"https://api.github.com/repos/lotus/model/issues/144/labels{/name}","comments_url":"https://api.github.com/repos/lotus/model/issues/144/comments","events_url":"https://api.github.com/repos/lotus/model/issues/144/events","html_url":"https://github.com/lotus/model/pull/144","id":55412236,"number":144,"title":"Add Lotus::Model::Migration","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},"labels":[{"url":"https://api.github.com/repos/lotus/model/labels/wip","name":"wip","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":30,"created_at":"2015-01-25T11:52:33Z","updated_at":"2015-02-16T13:43:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lotus/model/pulls/144","html_url":"https://github.com/lotus/model/pull/144","diff_url":"https://github.com/lotus/model/pull/144.diff","patch_url":"https://github.com/lotus/model/pull/144.patch"},"body":"This adds the basic migration feature for Lotus.\r\n\r\nIt purely base on Sequel::Migration and thus share the same interface as Sequel::Migration:\r\n\r\n```ruby\r\nclass MyMigration < Lotus::Model::Migration\r\n  def up\r\n  end\r\n\r\n  def down\r\n  end\r\nend\r\n```\r\n\r\nMigration files are located inside `LOTUS_ROOT/db/migrations` folder.\r\n\r\nTo migrate, we use Migrator:\r\n\r\n```ruby\r\nrequire 'lotus/model/migration'\r\nadapter_cfg = Lotus::Model::Config::Adapter.new(type: :sql, uri: DATABASE_URI)\r\nLotus::Model::Migrator.new(adapter_cfg).run\r\n```\r\n\r\nThe logger is set to default `Lotus::Logger` which pipe to STDOUT\r\n"},"comment":{"url":"https://api.github.com/repos/lotus/model/issues/comments/74509804","html_url":"https://github.com/lotus/model/pull/144#issuecomment-74509804","issue_url":"https://api.github.com/repos/lotus/model/issues/144","id":74509804,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2015-02-16T13:43:58Z","updated_at":"2015-02-16T13:43:58Z","body":"\n[![Coverage Status](https://coveralls.io/builds/1936440/badge)](https://coveralls.io/builds/1936440)\n\nCoverage decreased (-0.51%) to 95.9% when pulling **2a86e9d6600dabb0f523f514625ce6162e71cdde on joneslee85:model-migration** into **78d06c1a6f7b8afe95ea1fd45d0ce614b693e31b on lotus:master**.\n"}}