{"action":"created","comment":{"url":"https://api.github.com/repos/mediachain/L-SPACE/pulls/comments/58242879","id":58242879,"diff_hunk":"@@ -83,9 +84,38 @@ class LSpaceMigrations extends ODBMigrations with OrientSchema {\n       }\n     }\n \n+  // add \"external_ids\" property and index\n+  def migration3: ODBSession[Unit] =\n+    ODBSession {implicit db: ODatabaseDocumentTx =>\n+\n+      val idsProp = MapProperty(\"external_ids\")\n+        .mandatory(true)\n+        .defaultValue(Map[String,String]())\n+\n+\n+      val classNames =\n+        List(\"ImageBlob\", \"Person\")\n+          .map(\"V_\" + _)\n+\n+      val classOpts = classNames.map(db.findClass)\n+      for {\n+        classOpt <- classOpts\n+        klass <- classOpt.toList\n+      } yield klass + idsProp\n+\n+      classNames.foreach { klass =>\n+        val sql =\n+          s\"CREATE INDEX ${klass}ExternalIdsIndex \" +\n+            s\"ON V_$klass (external_ids BY KEY) NOTUNIQUE_HASH_INDEX STRING\"","path":"l_space/src/main/scala/io/mediachain/util/orient/LSpaceMigrations.scala","position":40,"original_position":40,"commit_id":"4980e3decb007da108ed9f0d1291fa10c82b8232","original_commit_id":"4980e3decb007da108ed9f0d1291fa10c82b8232","user":{"login":"yusefnapora","id":678715,"avatar_url":"https://avatars.githubusercontent.com/u/678715?v=3","gravatar_id":"","url":"https://api.github.com/users/yusefnapora","html_url":"https://github.com/yusefnapora","followers_url":"https://api.github.com/users/yusefnapora/followers","following_url":"https://api.github.com/users/yusefnapora/following{/other_user}","gists_url":"https://api.github.com/users/yusefnapora/gists{/gist_id}","starred_url":"https://api.github.com/users/yusefnapora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yusefnapora/subscriptions","organizations_url":"https://api.github.com/users/yusefnapora/orgs","repos_url":"https://api.github.com/users/yusefnapora/repos","events_url":"https://api.github.com/users/yusefnapora/events{/privacy}","received_events_url":"https://api.github.com/users/yusefnapora/received_events","type":"User","site_admin":false},"body":"You don't need the `V_` prefix here, since you added it to `classNames` above.  otherwise everything looks right :+1: ","created_at":"2016-04-01T17:58:17Z","updated_at":"2016-04-01T17:58:17Z","html_url":"https://github.com/mediachain/L-SPACE/pull/46#discussion_r58242879","pull_request_url":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/mediachain/L-SPACE/pulls/comments/58242879"},"html":{"href":"https://github.com/mediachain/L-SPACE/pull/46#discussion_r58242879"},"pull_request":{"href":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46","id":64972711,"html_url":"https://github.com/mediachain/L-SPACE/pull/46","diff_url":"https://github.com/mediachain/L-SPACE/pull/46.diff","patch_url":"https://github.com/mediachain/L-SPACE/pull/46.patch","issue_url":"https://api.github.com/repos/mediachain/L-SPACE/issues/46","number":46,"state":"open","locked":false,"title":"Extract external IDs","user":{"login":"parkan","id":204986,"avatar_url":"https://avatars.githubusercontent.com/u/204986?v=3","gravatar_id":"","url":"https://api.github.com/users/parkan","html_url":"https://github.com/parkan","followers_url":"https://api.github.com/users/parkan/followers","following_url":"https://api.github.com/users/parkan/following{/other_user}","gists_url":"https://api.github.com/users/parkan/gists{/gist_id}","starred_url":"https://api.github.com/users/parkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parkan/subscriptions","organizations_url":"https://api.github.com/users/parkan/orgs","repos_url":"https://api.github.com/users/parkan/repos","events_url":"https://api.github.com/users/parkan/events{/privacy}","received_events_url":"https://api.github.com/users/parkan/received_events","type":"User","site_admin":false},"body":"This isn't the final schema but conveys the general idea: external ids that we extract get an \"orgname:orKeyName\" key (case preserving) and the original value as string. This fixes the duplicate issues with Tate.\r\n\r\nI've also refactored the translator spec to use a generalized approach. The idea is to test the translator in isolation, so we don't use the corresponding loader (likewise, for the loader we use a noop translator)\r\n\r\nThe specs2 case class matcher doesn't quite do the magic I wanted, so we have to match the members manually (but, on the plus side, only in one place)","created_at":"2016-04-01T16:46:29Z","updated_at":"2016-04-01T17:58:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68d8b17dc93296877cf6765df783e7eff1ad4513","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46/commits","review_comments_url":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46/comments","review_comment_url":"https://api.github.com/repos/mediachain/L-SPACE/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mediachain/L-SPACE/issues/46/comments","statuses_url":"https://api.github.com/repos/mediachain/L-SPACE/statuses/4980e3decb007da108ed9f0d1291fa10c82b8232","head":{"label":"mediachain:ak-extractids","ref":"ak-extractids","sha":"4980e3decb007da108ed9f0d1291fa10c82b8232","user":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"repo":{"id":52026576,"name":"L-SPACE","full_name":"mediachain/L-SPACE","owner":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediachain/L-SPACE","description":"Books = Knowledge = Power = (Mass x Distance^2) / Time^3","fork":false,"url":"https://api.github.com/repos/mediachain/L-SPACE","forks_url":"https://api.github.com/repos/mediachain/L-SPACE/forks","keys_url":"https://api.github.com/repos/mediachain/L-SPACE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediachain/L-SPACE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediachain/L-SPACE/teams","hooks_url":"https://api.github.com/repos/mediachain/L-SPACE/hooks","issue_events_url":"https://api.github.com/repos/mediachain/L-SPACE/issues/events{/number}","events_url":"https://api.github.com/repos/mediachain/L-SPACE/events","assignees_url":"https://api.github.com/repos/mediachain/L-SPACE/assignees{/user}","branches_url":"https://api.github.com/repos/mediachain/L-SPACE/branches{/branch}","tags_url":"https://api.github.com/repos/mediachain/L-SPACE/tags","blobs_url":"https://api.github.com/repos/mediachain/L-SPACE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediachain/L-SPACE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediachain/L-SPACE/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediachain/L-SPACE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediachain/L-SPACE/statuses/{sha}","languages_url":"https://api.github.com/repos/mediachain/L-SPACE/languages","stargazers_url":"https://api.github.com/repos/mediachain/L-SPACE/stargazers","contributors_url":"https://api.github.com/repos/mediachain/L-SPACE/contributors","subscribers_url":"https://api.github.com/repos/mediachain/L-SPACE/subscribers","subscription_url":"https://api.github.com/repos/mediachain/L-SPACE/subscription","commits_url":"https://api.github.com/repos/mediachain/L-SPACE/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediachain/L-SPACE/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediachain/L-SPACE/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediachain/L-SPACE/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediachain/L-SPACE/contents/{+path}","compare_url":"https://api.github.com/repos/mediachain/L-SPACE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediachain/L-SPACE/merges","archive_url":"https://api.github.com/repos/mediachain/L-SPACE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediachain/L-SPACE/downloads","issues_url":"https://api.github.com/repos/mediachain/L-SPACE/issues{/number}","pulls_url":"https://api.github.com/repos/mediachain/L-SPACE/pulls{/number}","milestones_url":"https://api.github.com/repos/mediachain/L-SPACE/milestones{/number}","notifications_url":"https://api.github.com/repos/mediachain/L-SPACE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediachain/L-SPACE/labels{/name}","releases_url":"https://api.github.com/repos/mediachain/L-SPACE/releases{/id}","deployments_url":"https://api.github.com/repos/mediachain/L-SPACE/deployments","created_at":"2016-02-18T17:50:32Z","updated_at":"2016-03-28T09:57:50Z","pushed_at":"2016-04-01T17:56:06Z","git_url":"git://github.com/mediachain/L-SPACE.git","ssh_url":"git@github.com:mediachain/L-SPACE.git","clone_url":"https://github.com/mediachain/L-SPACE.git","svn_url":"https://github.com/mediachain/L-SPACE","homepage":null,"size":796,"stargazers_count":7,"watchers_count":7,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":7,"default_branch":"master"}},"base":{"label":"mediachain:master","ref":"master","sha":"7dc40ffce2826493ede893ced0a996244d00fb68","user":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"repo":{"id":52026576,"name":"L-SPACE","full_name":"mediachain/L-SPACE","owner":{"login":"mediachain","id":16711838,"avatar_url":"https://avatars.githubusercontent.com/u/16711838?v=3","gravatar_id":"","url":"https://api.github.com/users/mediachain","html_url":"https://github.com/mediachain","followers_url":"https://api.github.com/users/mediachain/followers","following_url":"https://api.github.com/users/mediachain/following{/other_user}","gists_url":"https://api.github.com/users/mediachain/gists{/gist_id}","starred_url":"https://api.github.com/users/mediachain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediachain/subscriptions","organizations_url":"https://api.github.com/users/mediachain/orgs","repos_url":"https://api.github.com/users/mediachain/repos","events_url":"https://api.github.com/users/mediachain/events{/privacy}","received_events_url":"https://api.github.com/users/mediachain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mediachain/L-SPACE","description":"Books = Knowledge = Power = (Mass x Distance^2) / Time^3","fork":false,"url":"https://api.github.com/repos/mediachain/L-SPACE","forks_url":"https://api.github.com/repos/mediachain/L-SPACE/forks","keys_url":"https://api.github.com/repos/mediachain/L-SPACE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mediachain/L-SPACE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mediachain/L-SPACE/teams","hooks_url":"https://api.github.com/repos/mediachain/L-SPACE/hooks","issue_events_url":"https://api.github.com/repos/mediachain/L-SPACE/issues/events{/number}","events_url":"https://api.github.com/repos/mediachain/L-SPACE/events","assignees_url":"https://api.github.com/repos/mediachain/L-SPACE/assignees{/user}","branches_url":"https://api.github.com/repos/mediachain/L-SPACE/branches{/branch}","tags_url":"https://api.github.com/repos/mediachain/L-SPACE/tags","blobs_url":"https://api.github.com/repos/mediachain/L-SPACE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mediachain/L-SPACE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mediachain/L-SPACE/git/refs{/sha}","trees_url":"https://api.github.com/repos/mediachain/L-SPACE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mediachain/L-SPACE/statuses/{sha}","languages_url":"https://api.github.com/repos/mediachain/L-SPACE/languages","stargazers_url":"https://api.github.com/repos/mediachain/L-SPACE/stargazers","contributors_url":"https://api.github.com/repos/mediachain/L-SPACE/contributors","subscribers_url":"https://api.github.com/repos/mediachain/L-SPACE/subscribers","subscription_url":"https://api.github.com/repos/mediachain/L-SPACE/subscription","commits_url":"https://api.github.com/repos/mediachain/L-SPACE/commits{/sha}","git_commits_url":"https://api.github.com/repos/mediachain/L-SPACE/git/commits{/sha}","comments_url":"https://api.github.com/repos/mediachain/L-SPACE/comments{/number}","issue_comment_url":"https://api.github.com/repos/mediachain/L-SPACE/issues/comments{/number}","contents_url":"https://api.github.com/repos/mediachain/L-SPACE/contents/{+path}","compare_url":"https://api.github.com/repos/mediachain/L-SPACE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mediachain/L-SPACE/merges","archive_url":"https://api.github.com/repos/mediachain/L-SPACE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mediachain/L-SPACE/downloads","issues_url":"https://api.github.com/repos/mediachain/L-SPACE/issues{/number}","pulls_url":"https://api.github.com/repos/mediachain/L-SPACE/pulls{/number}","milestones_url":"https://api.github.com/repos/mediachain/L-SPACE/milestones{/number}","notifications_url":"https://api.github.com/repos/mediachain/L-SPACE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mediachain/L-SPACE/labels{/name}","releases_url":"https://api.github.com/repos/mediachain/L-SPACE/releases{/id}","deployments_url":"https://api.github.com/repos/mediachain/L-SPACE/deployments","created_at":"2016-02-18T17:50:32Z","updated_at":"2016-03-28T09:57:50Z","pushed_at":"2016-04-01T17:56:06Z","git_url":"git://github.com/mediachain/L-SPACE.git","ssh_url":"git@github.com:mediachain/L-SPACE.git","clone_url":"https://github.com/mediachain/L-SPACE.git","svn_url":"https://github.com/mediachain/L-SPACE","homepage":null,"size":796,"stargazers_count":7,"watchers_count":7,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":24,"forks":0,"open_issues":24,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46"},"html":{"href":"https://github.com/mediachain/L-SPACE/pull/46"},"issue":{"href":"https://api.github.com/repos/mediachain/L-SPACE/issues/46"},"comments":{"href":"https://api.github.com/repos/mediachain/L-SPACE/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/mediachain/L-SPACE/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mediachain/L-SPACE/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/mediachain/L-SPACE/statuses/4980e3decb007da108ed9f0d1291fa10c82b8232"}}}}