{"comment":{"url":"https://api.github.com/repos/vshl/openmrs-core/comments/18975777","html_url":"https://github.com/vshl/openmrs-core/commit/ad49cd14bfe2006f6271d81a147874b0fea53296#commitcomment-18975777","id":18975777,"user":{"login":"vshl","id":193819,"avatar_url":"https://avatars.githubusercontent.com/u/193819?v=3","gravatar_id":"","url":"https://api.github.com/users/vshl","html_url":"https://github.com/vshl","followers_url":"https://api.github.com/users/vshl/followers","following_url":"https://api.github.com/users/vshl/following{/other_user}","gists_url":"https://api.github.com/users/vshl/gists{/gist_id}","starred_url":"https://api.github.com/users/vshl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vshl/subscriptions","organizations_url":"https://api.github.com/users/vshl/orgs","repos_url":"https://api.github.com/users/vshl/repos","events_url":"https://api.github.com/users/vshl/events{/privacy}","received_events_url":"https://api.github.com/users/vshl/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"ad49cd14bfe2006f6271d81a147874b0fea53296","created_at":"2016-09-11T02:27:02Z","updated_at":"2016-09-11T02:27:02Z","body":"@wluyima  I added it in the previous commit. Then again, I have to incorporate the new primary key column cohort_member_id as suggested by you.\r\n \r\n```\r\n    <changeSet author=\"ben (generated)\" id=\"1227303685425-2\">\r\n        <createTable tableName=\"cohort_member\">\r\n            <column defaultValueNumeric=\"0\" name=\"cohort_id\" type=\"int\">\r\n                <constraints nullable=\"false\"/>\r\n            </column>\r\n            <column defaultValueNumeric=\"0\" name=\"patient_id\" type=\"int\">\r\n                <constraints nullable=\"false\"/>\r\n            </column>\r\n        </createTable>\r\n    </changeSet>\r\n    <changeSet author=\"vshankar\" id=\"TRUNK-4096-1\">\r\n        <preConditions onFail=\"MARK_RAN\">\r\n            <not>\r\n                <columnExists tableName=\"cohort_member\" columnName=\"start_date\"/>\r\n            </not>\r\n        </preConditions>\r\n        <addColumn tableName=\"cohort_member\">\r\n            <column name=\"start_date\" type=\"datetime\"/>\r\n        </addColumn>\r\n    </changeSet>\r\n    <changeSet author=\"vshankar\" id=\"TRUNK-4096-2\">\r\n        <preConditions onFail=\"MARK_RAN\">\r\n            <not>\r\n                <columnExists tableName=\"cohort_member\" columnName=\"end_date\"/>\r\n            </not>\r\n        </preConditions>\r\n        <addColumn tableName=\"cohort_member\">\r\n            <column name=\"end_date\" type=\"datetime\"/>\r\n        </addColumn>\r\n    </changeSet>\r\n```\r\n\r\nThis is what I'm doing to add a primary key:\r\n\r\n```\r\n    <changeSet author=\"vshankar\" id=\"TRUNK-4906-3\">\r\n        <preConditions>\r\n            <primaryKeyExists tableName=\"cohort_member\"/>\r\n        </preConditions>\r\n        <dropPrimaryKey constraintName=\"\" tableName=\"cohort_member\"/>\r\n    </changeSet>\r\n    <changeSet author=\"vshankar\" id=\"TRUNK-4906-4\">\r\n        <preConditions>\r\n            <not>\r\n                <primaryKeyExists tableName=\"cohort_member\"/>\r\n            </not>\r\n        </preConditions>\r\n        <addPrimaryKey tableName=\"cohort_member\" columnNames=\"cohort_member_id\"/>\r\n    </changeSet>\r\n```\r\n\r\nHope it is correct?!"}}
{"actor":{"display_login":"vshl"}}