{"action":"created","comment":{"url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/comments/27903879","id":27903879,"diff_hunk":"@@ -40,33 +40,31 @@ def self.rename_class old_name, new_name\n         ODBClient.command \"alter class #{old_name} name #{new_name}\"\n         return true\n       else\n-        puts \"#{class_name} doesn't exist\"\n         return false\n       end\n     end\n \n-    def self.add_property class_name, property_name, type,property_options={}\n+    def self.add_property class_name, property_name, type, property_options={}\n+      assert_class_exists!(class_name)\n       ODBClient.create_property class_name,property_name,type, property_options\n     end\n \n     def self.drop_property class_name, property_name\n+      assert_class_exists!(class_name)\n+      assert_property_exists!(class_name, property_name)\n       ODBClient.command \"drop property #{class_name}.#{property_name}\"\n     end\n \n     def self.alter_property class_name, property_name, attribute_name, new_value\n+      assert_class_exists!(class_name)\n+      assert_property_exists!(class_name, property_name)\n       ODBClient.command \"alter property #{class_name}.#{property_name} #{attribute_name} #{new_value}\"\n     end\n \n-    def self.add_index class_name, index_name, property_name, type\n-      # schema has to exist.\n-      # check if property exists first, if not ask to create property.\n-      if property_exists? class_name, property_name\n-        ODBClient.command \"create index #{index_name} on #{class_name} (#{property_name}) #{type}\"\n-        return true\n-      else\n-        puts \"please create property #{property_name} first\"\n-        return false\n-      end\n+    def self.add_index class_name, property_name, index_name, type\n+      assert_class_exists!(class_name)\n+      assert_property_exists!(class_name, property_name)\n+      ODBClient.command \"create index #{index_name} on #{class_name} (#{property_name}) #{type}\"\n     end\n \n     def self.drop_index index_name","path":"lib/orientdb_schema_migrator/migration.rb","position":63,"original_position":63,"commit_id":"969f8877bd61a15341a903815dc35475eed1d4d9","original_commit_id":"969f8877bd61a15341a903815dc35475eed1d4d9","user":{"login":"lukeasrodgers","id":816444,"avatar_url":"https://avatars.githubusercontent.com/u/816444?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeasrodgers","html_url":"https://github.com/lukeasrodgers","followers_url":"https://api.github.com/users/lukeasrodgers/followers","following_url":"https://api.github.com/users/lukeasrodgers/following{/other_user}","gists_url":"https://api.github.com/users/lukeasrodgers/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeasrodgers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeasrodgers/subscriptions","organizations_url":"https://api.github.com/users/lukeasrodgers/orgs","repos_url":"https://api.github.com/users/lukeasrodgers/repos","events_url":"https://api.github.com/users/lukeasrodgers/events{/privacy}","received_events_url":"https://api.github.com/users/lukeasrodgers/received_events","type":"User","site_admin":false},"body":"Good question(s) -- I think ODB doesn't care in these situations, but I will double check.","created_at":"2015-04-07T18:05:52Z","updated_at":"2015-04-07T18:05:52Z","html_url":"https://github.com/Headlinerfm/orientdb-schema-migrator/pull/1#discussion_r27903879","pull_request_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/comments/27903879"},"html":{"href":"https://github.com/Headlinerfm/orientdb-schema-migrator/pull/1#discussion_r27903879"},"pull_request":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1","id":32444580,"html_url":"https://github.com/Headlinerfm/orientdb-schema-migrator/pull/1","diff_url":"https://github.com/Headlinerfm/orientdb-schema-migrator/pull/1.diff","patch_url":"https://github.com/Headlinerfm/orientdb-schema-migrator/pull/1.patch","issue_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/1","number":1,"state":"open","locked":false,"title":"Gemify","user":{"login":"lukeasrodgers","id":816444,"avatar_url":"https://avatars.githubusercontent.com/u/816444?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeasrodgers","html_url":"https://github.com/lukeasrodgers","followers_url":"https://api.github.com/users/lukeasrodgers/followers","following_url":"https://api.github.com/users/lukeasrodgers/following{/other_user}","gists_url":"https://api.github.com/users/lukeasrodgers/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeasrodgers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeasrodgers/subscriptions","organizations_url":"https://api.github.com/users/lukeasrodgers/orgs","repos_url":"https://api.github.com/users/lukeasrodgers/repos","events_url":"https://api.github.com/users/lukeasrodgers/events{/privacy}","received_events_url":"https://api.github.com/users/lukeasrodgers/received_events","type":"User","site_admin":false},"body":"Converts this repo into a gem.\r\n\r\nStill working on integration with our rails app, making sure migration generation works, etc.","created_at":"2015-04-01T18:09:14Z","updated_at":"2015-04-07T18:05:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7326a8588ecdec8680f38d42297d19f9355acb79","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/1/comments","statuses_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/statuses/969f8877bd61a15341a903815dc35475eed1d4d9","head":{"label":"Headlinerfm:gemify","ref":"gemify","sha":"969f8877bd61a15341a903815dc35475eed1d4d9","user":{"login":"Headlinerfm","id":849820,"avatar_url":"https://avatars.githubusercontent.com/u/849820?v=3","gravatar_id":"","url":"https://api.github.com/users/Headlinerfm","html_url":"https://github.com/Headlinerfm","followers_url":"https://api.github.com/users/Headlinerfm/followers","following_url":"https://api.github.com/users/Headlinerfm/following{/other_user}","gists_url":"https://api.github.com/users/Headlinerfm/gists{/gist_id}","starred_url":"https://api.github.com/users/Headlinerfm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Headlinerfm/subscriptions","organizations_url":"https://api.github.com/users/Headlinerfm/orgs","repos_url":"https://api.github.com/users/Headlinerfm/repos","events_url":"https://api.github.com/users/Headlinerfm/events{/privacy}","received_events_url":"https://api.github.com/users/Headlinerfm/received_events","type":"Organization","site_admin":false},"repo":{"id":32886006,"name":"orientdb-schema-migrator","full_name":"Headlinerfm/orientdb-schema-migrator","owner":{"login":"Headlinerfm","id":849820,"avatar_url":"https://avatars.githubusercontent.com/u/849820?v=3","gravatar_id":"","url":"https://api.github.com/users/Headlinerfm","html_url":"https://github.com/Headlinerfm","followers_url":"https://api.github.com/users/Headlinerfm/followers","following_url":"https://api.github.com/users/Headlinerfm/following{/other_user}","gists_url":"https://api.github.com/users/Headlinerfm/gists{/gist_id}","starred_url":"https://api.github.com/users/Headlinerfm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Headlinerfm/subscriptions","organizations_url":"https://api.github.com/users/Headlinerfm/orgs","repos_url":"https://api.github.com/users/Headlinerfm/repos","events_url":"https://api.github.com/users/Headlinerfm/events{/privacy}","received_events_url":"https://api.github.com/users/Headlinerfm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Headlinerfm/orientdb-schema-migrator","description":"OrientDB Schema Migrator","fork":false,"url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator","forks_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/forks","keys_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/teams","hooks_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/hooks","issue_events_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/events{/number}","events_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/events","assignees_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/assignees{/user}","branches_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/branches{/branch}","tags_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/tags","blobs_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/statuses/{sha}","languages_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/languages","stargazers_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/stargazers","contributors_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/contributors","subscribers_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/subscribers","subscription_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/subscription","commits_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/contents/{+path}","compare_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/merges","archive_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/downloads","issues_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues{/number}","pulls_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls{/number}","milestones_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/milestones{/number}","notifications_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/labels{/name}","releases_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/releases{/id}","created_at":"2015-03-25T19:24:18Z","updated_at":"2015-03-25T22:09:57Z","pushed_at":"2015-04-02T14:58:55Z","git_url":"git://github.com/Headlinerfm/orientdb-schema-migrator.git","ssh_url":"git@github.com:Headlinerfm/orientdb-schema-migrator.git","clone_url":"https://github.com/Headlinerfm/orientdb-schema-migrator.git","svn_url":"https://github.com/Headlinerfm/orientdb-schema-migrator","homepage":null,"size":224,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Headlinerfm:master","ref":"master","sha":"26fc176784f1e14271a05f3809daac91fadd0f94","user":{"login":"Headlinerfm","id":849820,"avatar_url":"https://avatars.githubusercontent.com/u/849820?v=3","gravatar_id":"","url":"https://api.github.com/users/Headlinerfm","html_url":"https://github.com/Headlinerfm","followers_url":"https://api.github.com/users/Headlinerfm/followers","following_url":"https://api.github.com/users/Headlinerfm/following{/other_user}","gists_url":"https://api.github.com/users/Headlinerfm/gists{/gist_id}","starred_url":"https://api.github.com/users/Headlinerfm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Headlinerfm/subscriptions","organizations_url":"https://api.github.com/users/Headlinerfm/orgs","repos_url":"https://api.github.com/users/Headlinerfm/repos","events_url":"https://api.github.com/users/Headlinerfm/events{/privacy}","received_events_url":"https://api.github.com/users/Headlinerfm/received_events","type":"Organization","site_admin":false},"repo":{"id":32886006,"name":"orientdb-schema-migrator","full_name":"Headlinerfm/orientdb-schema-migrator","owner":{"login":"Headlinerfm","id":849820,"avatar_url":"https://avatars.githubusercontent.com/u/849820?v=3","gravatar_id":"","url":"https://api.github.com/users/Headlinerfm","html_url":"https://github.com/Headlinerfm","followers_url":"https://api.github.com/users/Headlinerfm/followers","following_url":"https://api.github.com/users/Headlinerfm/following{/other_user}","gists_url":"https://api.github.com/users/Headlinerfm/gists{/gist_id}","starred_url":"https://api.github.com/users/Headlinerfm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Headlinerfm/subscriptions","organizations_url":"https://api.github.com/users/Headlinerfm/orgs","repos_url":"https://api.github.com/users/Headlinerfm/repos","events_url":"https://api.github.com/users/Headlinerfm/events{/privacy}","received_events_url":"https://api.github.com/users/Headlinerfm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Headlinerfm/orientdb-schema-migrator","description":"OrientDB Schema Migrator","fork":false,"url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator","forks_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/forks","keys_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/teams","hooks_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/hooks","issue_events_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/events{/number}","events_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/events","assignees_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/assignees{/user}","branches_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/branches{/branch}","tags_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/tags","blobs_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/refs{/sha}","trees_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/statuses/{sha}","languages_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/languages","stargazers_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/stargazers","contributors_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/contributors","subscribers_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/subscribers","subscription_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/subscription","commits_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/commits{/sha}","git_commits_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/git/commits{/sha}","comments_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/comments{/number}","issue_comment_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/comments{/number}","contents_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/contents/{+path}","compare_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/merges","archive_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/downloads","issues_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues{/number}","pulls_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls{/number}","milestones_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/milestones{/number}","notifications_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/labels{/name}","releases_url":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/releases{/id}","created_at":"2015-03-25T19:24:18Z","updated_at":"2015-03-25T22:09:57Z","pushed_at":"2015-04-02T14:58:55Z","git_url":"git://github.com/Headlinerfm/orientdb-schema-migrator.git","ssh_url":"git@github.com:Headlinerfm/orientdb-schema-migrator.git","clone_url":"https://github.com/Headlinerfm/orientdb-schema-migrator.git","svn_url":"https://github.com/Headlinerfm/orientdb-schema-migrator","homepage":null,"size":224,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1"},"html":{"href":"https://github.com/Headlinerfm/orientdb-schema-migrator/pull/1"},"issue":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/1"},"comments":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Headlinerfm/orientdb-schema-migrator/statuses/969f8877bd61a15341a903815dc35475eed1d4d9"}}}}