{"action":"created","comment":{"url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/comments/44976146","id":44976146,"diff_hunk":"@@ -352,60 +352,96 @@ def is_reserved(self):\n         \"\"\"Return true if the PID has not yet been reserved.\"\"\"\n         return self.status == PIDStatus.RESERVED\n \n-    def log(self, action, message, id_pid_as_null=False):\n-        \"\"\"\n-        Store action and message in log.\n-\n-        If 'id_pid_as_null' the foreign key to PID will not be set.\n-        \"\"\"\n-        if self.pid_type and self.pid_value:\n-            message = \"[{0}:{1}] {2}\".format(\n-                self.pid_type, self.pid_value, message)\n-        id_pid = None if id_pid_as_null else self.id\n-        with db.session.begin_nested():\n-            p = PidLog(id_pid=id_pid, action=action, message=message)\n-            db.session.add(p)\n+    def __repr__(self):\n+        \"\"\"Get representation of object.\"\"\"\n+        return \"<PersistentIdentifier {0}:{1}{3} ({2})>\".format(\n+            self.pid_type, self.pid_value, self.status,\n+            \" / {0}:{1}\".format(self.object_type, self.object_uuid) if\n+            self.object_type else \"\"\n+        )\n \n \n-class PidLog(db.Model):\n-    \"\"\"Audit log of actions happening to persistent identifiers.\n+class Redirect(db.Model, Timestamp):\n+    \"\"\"Redirect for a persistent identifier.\"\"\"\n \n-    This model is primarily used through PersistentIdentifier.log and rarely\n-    created manually.\n-    \"\"\"\n-\n-    __tablename__ = 'pidLOG'\n+    __tablename__ = 'pidstore_redirect'\n     __table_args__ = (\n-        db.Index('idx_action', 'action'),\n+        db.ForeignKeyConstraint(\n+            ['pid_type', 'pid_value'],\n+            [PersistentIdentifier.pid_type, PersistentIdentifier.pid_value]),\n     )\n \n-    id = db.Column(\n-        db.Integer,\n-        primary_key=True\n-    )\n-    \"\"\"Id of persistent identifier entry.\"\"\"\n+    id = db.Column(UUIDType, default=uuid.uuid4, primary_key=True)\n+    \"\"\"Id of redirect entry.\"\"\"\n \n-    id_pid = db.Column(\n-        db.Integer,\n-        db.ForeignKey(PersistentIdentifier.id),\n-        nullable=True,\n-    )\n-    \"\"\"PID.\"\"\"\n+    pid_type = db.Column(db.String(6), nullable=False)\n+    \"\"\"Persistent Identifier scheme.\"\"\"\n+\n+    pid_value = db.Column(db.String(255), nullable=False)\n+    \"\"\"Persistent identifier value.\"\"\"\n \n-    timestamp = db.Column(db.DateTime(), nullable=False, default=datetime.now)\n-    \"\"\"Creation datetime of entry.\"\"\"\n \n-    action = db.Column(db.String(10), nullable=False)\n-    \"\"\"Action identifier.\"\"\"\n+class RecordIdentifier(db.Model):\n+    \"\"\"Sequence generator for integer record identifiers.\n \n-    message = db.Column(db.Text(), nullable=False)\n-    \"\"\"Log message.\"\"\"\n+    The sole purpose of this model is to generate integer record identifiers in\n+    sequence using the underlying database's auto increment features in a\n+    transaction friendly manner. The feature is primarily provided to support\n+    legacy Invenio instances to continue their current record identifier\n+    scheme. For new instances we strong encourage to not use auto incrementing\n+    record identifiers, but instead use e.g. UUIDs as record identifiers.\n \n-    # Relationship\n-    pid = db.relationship(\"PersistentIdentifier\", backref=\"logs\")\n+    .. warning::\n+\n+       Only use the provided API to","path":"invenio_pidstore/models.py","position":611,"original_position":611,"commit_id":"9dda851b8d882a851dbd30876ca2ede26efd63eb","original_commit_id":"9dda851b8d882a851dbd30876ca2ede26efd63eb","user":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"body":"missing rest of the sentence ...","created_at":"2015-11-16T20:13:10Z","updated_at":"2015-11-16T20:13:10Z","html_url":"https://github.com/inveniosoftware/invenio-pidstore/pull/31#discussion_r44976146","pull_request_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/comments/44976146"},"html":{"href":"https://github.com/inveniosoftware/invenio-pidstore/pull/31#discussion_r44976146"},"pull_request":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31","id":50665032,"html_url":"https://github.com/inveniosoftware/invenio-pidstore/pull/31","diff_url":"https://github.com/inveniosoftware/invenio-pidstore/pull/31.diff","patch_url":"https://github.com/inveniosoftware/invenio-pidstore/pull/31.patch","issue_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/issues/31","number":31,"state":"open","locked":false,"title":"global: pidstore rewrite","user":{"login":"lnielsen","id":1698163,"avatar_url":"https://avatars.githubusercontent.com/u/1698163?v=3","gravatar_id":"","url":"https://api.github.com/users/lnielsen","html_url":"https://github.com/lnielsen","followers_url":"https://api.github.com/users/lnielsen/followers","following_url":"https://api.github.com/users/lnielsen/following{/other_user}","gists_url":"https://api.github.com/users/lnielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/lnielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnielsen/subscriptions","organizations_url":"https://api.github.com/users/lnielsen/orgs","repos_url":"https://api.github.com/users/lnielsen/repos","events_url":"https://api.github.com/users/lnielsen/events{/privacy}","received_events_url":"https://api.github.com/users/lnielsen/received_events","type":"User","site_admin":false},"body":"* INCOMPATIBLE Major rewrite of PIDStore in order to fix performance\r\n  issues and clean up programmatic API.\r\n\r\n* Adds support for redirecting persistent identifiers.\r\n\r\n* Adds support for integer record identifier minting.\r\n\r\nSigned-off-by: Lars Holm Nielsen <lars.holm.nielsen@cern.ch>","created_at":"2015-11-13T17:02:29Z","updated_at":"2015-11-16T20:13:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eb4aef69b57e2b58e5086f6cd2c4f65edd45741","assignee":{"login":"lnielsen","id":1698163,"avatar_url":"https://avatars.githubusercontent.com/u/1698163?v=3","gravatar_id":"","url":"https://api.github.com/users/lnielsen","html_url":"https://github.com/lnielsen","followers_url":"https://api.github.com/users/lnielsen/followers","following_url":"https://api.github.com/users/lnielsen/following{/other_user}","gists_url":"https://api.github.com/users/lnielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/lnielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnielsen/subscriptions","organizations_url":"https://api.github.com/users/lnielsen/orgs","repos_url":"https://api.github.com/users/lnielsen/repos","events_url":"https://api.github.com/users/lnielsen/events{/privacy}","received_events_url":"https://api.github.com/users/lnielsen/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/milestones/7","html_url":"https://github.com/inveniosoftware/invenio-pidstore/milestones/v1.0.0","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/milestones/7/labels","id":1363884,"number":7,"title":"v1.0.0","description":null,"creator":{"login":"jirikuncar","id":189798,"avatar_url":"https://avatars.githubusercontent.com/u/189798?v=3","gravatar_id":"","url":"https://api.github.com/users/jirikuncar","html_url":"https://github.com/jirikuncar","followers_url":"https://api.github.com/users/jirikuncar/followers","following_url":"https://api.github.com/users/jirikuncar/following{/other_user}","gists_url":"https://api.github.com/users/jirikuncar/gists{/gist_id}","starred_url":"https://api.github.com/users/jirikuncar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirikuncar/subscriptions","organizations_url":"https://api.github.com/users/jirikuncar/orgs","repos_url":"https://api.github.com/users/jirikuncar/repos","events_url":"https://api.github.com/users/jirikuncar/events{/privacy}","received_events_url":"https://api.github.com/users/jirikuncar/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":5,"state":"open","created_at":"2015-10-19T13:13:43Z","updated_at":"2015-11-13T17:02:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31/commits","review_comments_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31/comments","review_comment_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/issues/31/comments","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/statuses/9dda851b8d882a851dbd30876ca2ede26efd63eb","head":{"label":"lnielsen:master-rewrite","ref":"master-rewrite","sha":"9dda851b8d882a851dbd30876ca2ede26efd63eb","user":{"login":"lnielsen","id":1698163,"avatar_url":"https://avatars.githubusercontent.com/u/1698163?v=3","gravatar_id":"","url":"https://api.github.com/users/lnielsen","html_url":"https://github.com/lnielsen","followers_url":"https://api.github.com/users/lnielsen/followers","following_url":"https://api.github.com/users/lnielsen/following{/other_user}","gists_url":"https://api.github.com/users/lnielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/lnielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnielsen/subscriptions","organizations_url":"https://api.github.com/users/lnielsen/orgs","repos_url":"https://api.github.com/users/lnielsen/repos","events_url":"https://api.github.com/users/lnielsen/events{/privacy}","received_events_url":"https://api.github.com/users/lnielsen/received_events","type":"User","site_admin":false},"repo":{"id":41531871,"name":"invenio-pidstore","full_name":"lnielsen/invenio-pidstore","owner":{"login":"lnielsen","id":1698163,"avatar_url":"https://avatars.githubusercontent.com/u/1698163?v=3","gravatar_id":"","url":"https://api.github.com/users/lnielsen","html_url":"https://github.com/lnielsen","followers_url":"https://api.github.com/users/lnielsen/followers","following_url":"https://api.github.com/users/lnielsen/following{/other_user}","gists_url":"https://api.github.com/users/lnielsen/gists{/gist_id}","starred_url":"https://api.github.com/users/lnielsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lnielsen/subscriptions","organizations_url":"https://api.github.com/users/lnielsen/orgs","repos_url":"https://api.github.com/users/lnielsen/repos","events_url":"https://api.github.com/users/lnielsen/events{/privacy}","received_events_url":"https://api.github.com/users/lnielsen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lnielsen/invenio-pidstore","description":"Invenio module that stores and registers persistent identifiers.","fork":true,"url":"https://api.github.com/repos/lnielsen/invenio-pidstore","forks_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/forks","keys_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/teams","hooks_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/hooks","issue_events_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/issues/events{/number}","events_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/events","assignees_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/assignees{/user}","branches_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/branches{/branch}","tags_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/tags","blobs_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/statuses/{sha}","languages_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/languages","stargazers_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/stargazers","contributors_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/contributors","subscribers_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/subscribers","subscription_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/subscription","commits_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/contents/{+path}","compare_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/merges","archive_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/downloads","issues_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/issues{/number}","pulls_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/pulls{/number}","milestones_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/milestones{/number}","notifications_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/labels{/name}","releases_url":"https://api.github.com/repos/lnielsen/invenio-pidstore/releases{/id}","created_at":"2015-08-28T06:50:18Z","updated_at":"2015-08-28T06:50:18Z","pushed_at":"2015-11-16T16:39:32Z","git_url":"git://github.com/lnielsen/invenio-pidstore.git","ssh_url":"git@github.com:lnielsen/invenio-pidstore.git","clone_url":"https://github.com/lnielsen/invenio-pidstore.git","svn_url":"https://github.com/lnielsen/invenio-pidstore","homepage":"","size":222,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"inveniosoftware:master","ref":"master","sha":"9fd2e5410d44fd1b3416542e502247d9b9d3436e","user":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"repo":{"id":39133678,"name":"invenio-pidstore","full_name":"inveniosoftware/invenio-pidstore","owner":{"login":"inveniosoftware","id":1157480,"avatar_url":"https://avatars.githubusercontent.com/u/1157480?v=3","gravatar_id":"","url":"https://api.github.com/users/inveniosoftware","html_url":"https://github.com/inveniosoftware","followers_url":"https://api.github.com/users/inveniosoftware/followers","following_url":"https://api.github.com/users/inveniosoftware/following{/other_user}","gists_url":"https://api.github.com/users/inveniosoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/inveniosoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/inveniosoftware/subscriptions","organizations_url":"https://api.github.com/users/inveniosoftware/orgs","repos_url":"https://api.github.com/users/inveniosoftware/repos","events_url":"https://api.github.com/users/inveniosoftware/events{/privacy}","received_events_url":"https://api.github.com/users/inveniosoftware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/inveniosoftware/invenio-pidstore","description":"Invenio module that stores and registers persistent identifiers.","fork":false,"url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore","forks_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/forks","keys_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/teams","hooks_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/hooks","issue_events_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/issues/events{/number}","events_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/events","assignees_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/assignees{/user}","branches_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/branches{/branch}","tags_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/tags","blobs_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/git/refs{/sha}","trees_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/statuses/{sha}","languages_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/languages","stargazers_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/stargazers","contributors_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/contributors","subscribers_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/subscribers","subscription_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/subscription","commits_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/commits{/sha}","git_commits_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/git/commits{/sha}","comments_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/comments{/number}","issue_comment_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/issues/comments{/number}","contents_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/contents/{+path}","compare_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/merges","archive_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/downloads","issues_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/issues{/number}","pulls_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls{/number}","milestones_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/milestones{/number}","notifications_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/labels{/name}","releases_url":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/releases{/id}","created_at":"2015-07-15T11:40:54Z","updated_at":"2015-08-19T12:52:03Z","pushed_at":"2015-11-16T16:39:32Z","git_url":"git://github.com/inveniosoftware/invenio-pidstore.git","ssh_url":"git@github.com:inveniosoftware/invenio-pidstore.git","clone_url":"https://github.com/inveniosoftware/invenio-pidstore.git","svn_url":"https://github.com/inveniosoftware/invenio-pidstore","homepage":"","size":479,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":10,"forks":12,"open_issues":10,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31"},"html":{"href":"https://github.com/inveniosoftware/invenio-pidstore/pull/31"},"issue":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/issues/31"},"comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/inveniosoftware/invenio-pidstore/statuses/9dda851b8d882a851dbd30876ca2ede26efd63eb"}}}}