{"action":"created","comment":{"url":"https://api.github.com/repos/SolutionGuidance/psm/pulls/comments/185064029","pull_request_review_id":116381592,"id":185064029,"diff_hunk":"@@ -0,0 +1,31 @@\n+# MIGRATIONS\n+The PSM uses [Liquibase](http://liquibase.org/) to manage migrations. Review the [Liquibase best practices](http://www.liquibase.org/bestpractices.html) to understand the structure of this project's migrations.\n+\n+Migrations are stored in a `changelog` folder within the `psm-app/db/` project.  The `db-changelog-master.xml` is the root changelog.\n+\n+Changes to the database are registered inside of `ChangeLog` files. Each change in a ChangeLog is called a `ChangeSet`. ChangeSets should be as atomic as possible, and should also contain `rollback` instructions which allows them to be undone.\n+\n+## Running Migrations\n+To run migrations","path":"docs/MIGRATIONS.md","position":9,"original_position":9,"commit_id":"7e9de37961249bd5fe8d1f79f84c46554ee2c03d","original_commit_id":"7e9de37961249bd5fe8d1f79f84c46554ee2c03d","user":{"login":"jasonaowen","id":1494855,"avatar_url":"https://avatars0.githubusercontent.com/u/1494855?v=4","gravatar_id":"","url":"https://api.github.com/users/jasonaowen","html_url":"https://github.com/jasonaowen","followers_url":"https://api.github.com/users/jasonaowen/followers","following_url":"https://api.github.com/users/jasonaowen/following{/other_user}","gists_url":"https://api.github.com/users/jasonaowen/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonaowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonaowen/subscriptions","organizations_url":"https://api.github.com/users/jasonaowen/orgs","repos_url":"https://api.github.com/users/jasonaowen/repos","events_url":"https://api.github.com/users/jasonaowen/events{/privacy}","received_events_url":"https://api.github.com/users/jasonaowen/received_events","type":"User","site_admin":false},"body":"Actually, maybe it'd be most useful to document how to get help! `./gradlew db:tasks` has super useful output, including such highlights as:\r\n\r\n```\r\nLiquibase tasks\r\n---------------\r\nchangelogSync - Mark all changes as executed in the database.\r\nchangelogSyncSQL - Writes SQL to mark all changes as executed in the database to STDOUT.\r\nmarkNextChangesetRan - Mark the next change set as executed in the database.\r\nrollback - Rolls back the database to the state it was in when the <liquibaseCommandValue> tag was applied.\r\nrollbackToDate - Rolls back the database to the state it was in at the <liquibaseCommandValue> date/time.\r\nupdate - Updates the database to the current version.\r\nupdateSQL - Writes SQL to update the database to the current version to STDOUT.\r\nvalidate - Checks the changelog for errors.\r\n```\r\n\r\nAlthough I'm not sure what `<liquibaseCommandValue>` is; do you know, @slifty?","created_at":"2018-04-30T18:09:57Z","updated_at":"2018-04-30T18:09:57Z","html_url":"https://github.com/SolutionGuidance/psm/pull/798#discussion_r185064029","pull_request_url":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/SolutionGuidance/psm/pulls/comments/185064029"},"html":{"href":"https://github.com/SolutionGuidance/psm/pull/798#discussion_r185064029"},"pull_request":{"href":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798"}},"in_reply_to_id":185048158},"pull_request":{"url":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798","id":184380460,"html_url":"https://github.com/SolutionGuidance/psm/pull/798","diff_url":"https://github.com/SolutionGuidance/psm/pull/798.diff","patch_url":"https://github.com/SolutionGuidance/psm/pull/798.patch","issue_url":"https://api.github.com/repos/SolutionGuidance/psm/issues/798","number":798,"state":"open","locked":false,"title":"WIP Migrations","user":{"login":"slifty","id":208884,"avatar_url":"https://avatars1.githubusercontent.com/u/208884?v=4","gravatar_id":"","url":"https://api.github.com/users/slifty","html_url":"https://github.com/slifty","followers_url":"https://api.github.com/users/slifty/followers","following_url":"https://api.github.com/users/slifty/following{/other_user}","gists_url":"https://api.github.com/users/slifty/gists{/gist_id}","starred_url":"https://api.github.com/users/slifty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slifty/subscriptions","organizations_url":"https://api.github.com/users/slifty/orgs","repos_url":"https://api.github.com/users/slifty/repos","events_url":"https://api.github.com/users/slifty/events{/privacy}","received_events_url":"https://api.github.com/users/slifty/received_events","type":"User","site_admin":false},"body":"We're moving our database setup to Liquibase migrations.  This PR contains the initial setup of that change as well an initial changeset just to get things started.  In future each ChangeSet will get its own commit; this was a special case because the files didn't exist yet, so there were no changes to patch into them.\r\n\r\nSome review process thoughts:\r\n\r\n* The bulk of the migration scripts themselves will be separate PRs.\r\n* I don't think tests are going to pass since the CI server doesn't know how to run migrations yet.\r\n* We may want to consider having the migration PRs be off of *this* branch (which means this PR would eventually become a mega PR, which should be OK since all future commits will have been reviewed on their own).  That way master is never in \"limbo\" between seed.sql and migrations\r\n\r\nTwo other important notes:\r\n\r\n1) We had talked about having the liquibase tasks be part of an existing project; this made sense initially, but our directory structure already places `db` as its own project (which is also best practice). By mirroring this structure in gradle we get much more intuitive migration commands (e.g. `db:update` instead of `service:update`), which feels much more natural to me.\r\n\r\nI feel like this is using the concept of projects appropriately -- and that the database is an encapsulated, independent component of the system (basically, it is reasonable to organize its management logic as such.)\r\n\r\n2) I spent a little bit of time looking for the right place to put automated liquibase code as part of service startup, I decided not to go through with it for this PR.  I feel that the gradle approach gives full control while still script-able and therefore potentially automated as part of deployment scripts.  Embedding migrations into code, on the other hand, would remove agency from developers and administrators who might not want migrations to be run outside of formal deployments.\r\n\r\nIn other words: whenever an updated version of the application is deployed it should be trivial to include a line to the deployment script to run the migrations (whereas it would not be trivial to have migrations NOT run when the application is started, if calls to migrations were hard coded into service).\r\n\r\nHappy to discuss either point in more detail.","created_at":"2018-04-26T15:33:44Z","updated_at":"2018-04-30T18:09:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"002f428e38c9152a536123a3661903c23ccc780d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":845480562,"url":"https://api.github.com/repos/SolutionGuidance/psm/labels/review","name":"review","color":"ededed","default":false}],"milestone":{"url":"https://api.github.com/repos/SolutionGuidance/psm/milestones/16","html_url":"https://github.com/SolutionGuidance/psm/milestone/16","labels_url":"https://api.github.com/repos/SolutionGuidance/psm/milestones/16/labels","id":3229133,"number":16,"title":"June 2018","description":"","creator":{"login":"cecilia-donnelly","id":1497818,"avatar_url":"https://avatars0.githubusercontent.com/u/1497818?v=4","gravatar_id":"","url":"https://api.github.com/users/cecilia-donnelly","html_url":"https://github.com/cecilia-donnelly","followers_url":"https://api.github.com/users/cecilia-donnelly/followers","following_url":"https://api.github.com/users/cecilia-donnelly/following{/other_user}","gists_url":"https://api.github.com/users/cecilia-donnelly/gists{/gist_id}","starred_url":"https://api.github.com/users/cecilia-donnelly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cecilia-donnelly/subscriptions","organizations_url":"https://api.github.com/users/cecilia-donnelly/orgs","repos_url":"https://api.github.com/users/cecilia-donnelly/repos","events_url":"https://api.github.com/users/cecilia-donnelly/events{/privacy}","received_events_url":"https://api.github.com/users/cecilia-donnelly/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":11,"state":"open","created_at":"2018-03-29T16:19:15Z","updated_at":"2018-04-26T15:44:51Z","due_on":"2018-07-13T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798/commits","review_comments_url":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798/comments","review_comment_url":"https://api.github.com/repos/SolutionGuidance/psm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SolutionGuidance/psm/issues/798/comments","statuses_url":"https://api.github.com/repos/SolutionGuidance/psm/statuses/7e9de37961249bd5fe8d1f79f84c46554ee2c03d","head":{"label":"SolutionGuidance:254-migration-setup","ref":"254-migration-setup","sha":"7e9de37961249bd5fe8d1f79f84c46554ee2c03d","user":{"login":"SolutionGuidance","id":28989268,"avatar_url":"https://avatars2.githubusercontent.com/u/28989268?v=4","gravatar_id":"","url":"https://api.github.com/users/SolutionGuidance","html_url":"https://github.com/SolutionGuidance","followers_url":"https://api.github.com/users/SolutionGuidance/followers","following_url":"https://api.github.com/users/SolutionGuidance/following{/other_user}","gists_url":"https://api.github.com/users/SolutionGuidance/gists{/gist_id}","starred_url":"https://api.github.com/users/SolutionGuidance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolutionGuidance/subscriptions","organizations_url":"https://api.github.com/users/SolutionGuidance/orgs","repos_url":"https://api.github.com/users/SolutionGuidance/repos","events_url":"https://api.github.com/users/SolutionGuidance/events{/privacy}","received_events_url":"https://api.github.com/users/SolutionGuidance/received_events","type":"Organization","site_admin":false},"repo":{"id":66302616,"name":"psm","full_name":"SolutionGuidance/psm","owner":{"login":"SolutionGuidance","id":28989268,"avatar_url":"https://avatars2.githubusercontent.com/u/28989268?v=4","gravatar_id":"","url":"https://api.github.com/users/SolutionGuidance","html_url":"https://github.com/SolutionGuidance","followers_url":"https://api.github.com/users/SolutionGuidance/followers","following_url":"https://api.github.com/users/SolutionGuidance/following{/other_user}","gists_url":"https://api.github.com/users/SolutionGuidance/gists{/gist_id}","starred_url":"https://api.github.com/users/SolutionGuidance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolutionGuidance/subscriptions","organizations_url":"https://api.github.com/users/SolutionGuidance/orgs","repos_url":"https://api.github.com/users/SolutionGuidance/repos","events_url":"https://api.github.com/users/SolutionGuidance/events{/privacy}","received_events_url":"https://api.github.com/users/SolutionGuidance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SolutionGuidance/psm","description":"Welcome to the Medicare/Medicaid Provider Enrollment Screening Portal","fork":false,"url":"https://api.github.com/repos/SolutionGuidance/psm","forks_url":"https://api.github.com/repos/SolutionGuidance/psm/forks","keys_url":"https://api.github.com/repos/SolutionGuidance/psm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SolutionGuidance/psm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SolutionGuidance/psm/teams","hooks_url":"https://api.github.com/repos/SolutionGuidance/psm/hooks","issue_events_url":"https://api.github.com/repos/SolutionGuidance/psm/issues/events{/number}","events_url":"https://api.github.com/repos/SolutionGuidance/psm/events","assignees_url":"https://api.github.com/repos/SolutionGuidance/psm/assignees{/user}","branches_url":"https://api.github.com/repos/SolutionGuidance/psm/branches{/branch}","tags_url":"https://api.github.com/repos/SolutionGuidance/psm/tags","blobs_url":"https://api.github.com/repos/SolutionGuidance/psm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SolutionGuidance/psm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SolutionGuidance/psm/git/refs{/sha}","trees_url":"https://api.github.com/repos/SolutionGuidance/psm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SolutionGuidance/psm/statuses/{sha}","languages_url":"https://api.github.com/repos/SolutionGuidance/psm/languages","stargazers_url":"https://api.github.com/repos/SolutionGuidance/psm/stargazers","contributors_url":"https://api.github.com/repos/SolutionGuidance/psm/contributors","subscribers_url":"https://api.github.com/repos/SolutionGuidance/psm/subscribers","subscription_url":"https://api.github.com/repos/SolutionGuidance/psm/subscription","commits_url":"https://api.github.com/repos/SolutionGuidance/psm/commits{/sha}","git_commits_url":"https://api.github.com/repos/SolutionGuidance/psm/git/commits{/sha}","comments_url":"https://api.github.com/repos/SolutionGuidance/psm/comments{/number}","issue_comment_url":"https://api.github.com/repos/SolutionGuidance/psm/issues/comments{/number}","contents_url":"https://api.github.com/repos/SolutionGuidance/psm/contents/{+path}","compare_url":"https://api.github.com/repos/SolutionGuidance/psm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SolutionGuidance/psm/merges","archive_url":"https://api.github.com/repos/SolutionGuidance/psm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SolutionGuidance/psm/downloads","issues_url":"https://api.github.com/repos/SolutionGuidance/psm/issues{/number}","pulls_url":"https://api.github.com/repos/SolutionGuidance/psm/pulls{/number}","milestones_url":"https://api.github.com/repos/SolutionGuidance/psm/milestones{/number}","notifications_url":"https://api.github.com/repos/SolutionGuidance/psm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SolutionGuidance/psm/labels{/name}","releases_url":"https://api.github.com/repos/SolutionGuidance/psm/releases{/id}","deployments_url":"https://api.github.com/repos/SolutionGuidance/psm/deployments","created_at":"2016-08-22T19:40:02Z","updated_at":"2018-04-27T21:50:09Z","pushed_at":"2018-04-30T03:40:39Z","git_url":"git://github.com/SolutionGuidance/psm.git","ssh_url":"git@github.com:SolutionGuidance/psm.git","clone_url":"https://github.com/SolutionGuidance/psm.git","svn_url":"https://github.com/SolutionGuidance/psm","homepage":"","size":222924,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":192,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":192,"watchers":15,"default_branch":"master"}},"base":{"label":"SolutionGuidance:master","ref":"master","sha":"558ac4d464f4b87d41488b9566cb33d1e6c83e40","user":{"login":"SolutionGuidance","id":28989268,"avatar_url":"https://avatars2.githubusercontent.com/u/28989268?v=4","gravatar_id":"","url":"https://api.github.com/users/SolutionGuidance","html_url":"https://github.com/SolutionGuidance","followers_url":"https://api.github.com/users/SolutionGuidance/followers","following_url":"https://api.github.com/users/SolutionGuidance/following{/other_user}","gists_url":"https://api.github.com/users/SolutionGuidance/gists{/gist_id}","starred_url":"https://api.github.com/users/SolutionGuidance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolutionGuidance/subscriptions","organizations_url":"https://api.github.com/users/SolutionGuidance/orgs","repos_url":"https://api.github.com/users/SolutionGuidance/repos","events_url":"https://api.github.com/users/SolutionGuidance/events{/privacy}","received_events_url":"https://api.github.com/users/SolutionGuidance/received_events","type":"Organization","site_admin":false},"repo":{"id":66302616,"name":"psm","full_name":"SolutionGuidance/psm","owner":{"login":"SolutionGuidance","id":28989268,"avatar_url":"https://avatars2.githubusercontent.com/u/28989268?v=4","gravatar_id":"","url":"https://api.github.com/users/SolutionGuidance","html_url":"https://github.com/SolutionGuidance","followers_url":"https://api.github.com/users/SolutionGuidance/followers","following_url":"https://api.github.com/users/SolutionGuidance/following{/other_user}","gists_url":"https://api.github.com/users/SolutionGuidance/gists{/gist_id}","starred_url":"https://api.github.com/users/SolutionGuidance/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolutionGuidance/subscriptions","organizations_url":"https://api.github.com/users/SolutionGuidance/orgs","repos_url":"https://api.github.com/users/SolutionGuidance/repos","events_url":"https://api.github.com/users/SolutionGuidance/events{/privacy}","received_events_url":"https://api.github.com/users/SolutionGuidance/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SolutionGuidance/psm","description":"Welcome to the Medicare/Medicaid Provider Enrollment Screening Portal","fork":false,"url":"https://api.github.com/repos/SolutionGuidance/psm","forks_url":"https://api.github.com/repos/SolutionGuidance/psm/forks","keys_url":"https://api.github.com/repos/SolutionGuidance/psm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SolutionGuidance/psm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SolutionGuidance/psm/teams","hooks_url":"https://api.github.com/repos/SolutionGuidance/psm/hooks","issue_events_url":"https://api.github.com/repos/SolutionGuidance/psm/issues/events{/number}","events_url":"https://api.github.com/repos/SolutionGuidance/psm/events","assignees_url":"https://api.github.com/repos/SolutionGuidance/psm/assignees{/user}","branches_url":"https://api.github.com/repos/SolutionGuidance/psm/branches{/branch}","tags_url":"https://api.github.com/repos/SolutionGuidance/psm/tags","blobs_url":"https://api.github.com/repos/SolutionGuidance/psm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SolutionGuidance/psm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SolutionGuidance/psm/git/refs{/sha}","trees_url":"https://api.github.com/repos/SolutionGuidance/psm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SolutionGuidance/psm/statuses/{sha}","languages_url":"https://api.github.com/repos/SolutionGuidance/psm/languages","stargazers_url":"https://api.github.com/repos/SolutionGuidance/psm/stargazers","contributors_url":"https://api.github.com/repos/SolutionGuidance/psm/contributors","subscribers_url":"https://api.github.com/repos/SolutionGuidance/psm/subscribers","subscription_url":"https://api.github.com/repos/SolutionGuidance/psm/subscription","commits_url":"https://api.github.com/repos/SolutionGuidance/psm/commits{/sha}","git_commits_url":"https://api.github.com/repos/SolutionGuidance/psm/git/commits{/sha}","comments_url":"https://api.github.com/repos/SolutionGuidance/psm/comments{/number}","issue_comment_url":"https://api.github.com/repos/SolutionGuidance/psm/issues/comments{/number}","contents_url":"https://api.github.com/repos/SolutionGuidance/psm/contents/{+path}","compare_url":"https://api.github.com/repos/SolutionGuidance/psm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SolutionGuidance/psm/merges","archive_url":"https://api.github.com/repos/SolutionGuidance/psm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SolutionGuidance/psm/downloads","issues_url":"https://api.github.com/repos/SolutionGuidance/psm/issues{/number}","pulls_url":"https://api.github.com/repos/SolutionGuidance/psm/pulls{/number}","milestones_url":"https://api.github.com/repos/SolutionGuidance/psm/milestones{/number}","notifications_url":"https://api.github.com/repos/SolutionGuidance/psm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SolutionGuidance/psm/labels{/name}","releases_url":"https://api.github.com/repos/SolutionGuidance/psm/releases{/id}","deployments_url":"https://api.github.com/repos/SolutionGuidance/psm/deployments","created_at":"2016-08-22T19:40:02Z","updated_at":"2018-04-27T21:50:09Z","pushed_at":"2018-04-30T03:40:39Z","git_url":"git://github.com/SolutionGuidance/psm.git","ssh_url":"git@github.com:SolutionGuidance/psm.git","clone_url":"https://github.com/SolutionGuidance/psm.git","svn_url":"https://github.com/SolutionGuidance/psm","homepage":"","size":222924,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":12,"mirror_url":null,"archived":false,"open_issues_count":192,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":12,"open_issues":192,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798"},"html":{"href":"https://github.com/SolutionGuidance/psm/pull/798"},"issue":{"href":"https://api.github.com/repos/SolutionGuidance/psm/issues/798"},"comments":{"href":"https://api.github.com/repos/SolutionGuidance/psm/issues/798/comments"},"review_comments":{"href":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798/comments"},"review_comment":{"href":"https://api.github.com/repos/SolutionGuidance/psm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SolutionGuidance/psm/pulls/798/commits"},"statuses":{"href":"https://api.github.com/repos/SolutionGuidance/psm/statuses/7e9de37961249bd5fe8d1f79f84c46554ee2c03d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jasonaowen"}}