| // Copyright (C) 2018 The Android Open Source Project | 
 | // | 
 | // Licensed under the Apache License, Version 2.0 (the "License"); | 
 | // you may not use this file except in compliance with the License. | 
 | // You may obtain a copy of the License at | 
 | // | 
 | // http://www.apache.org/licenses/LICENSE-2.0 | 
 | // | 
 | // Unless required by applicable law or agreed to in writing, software | 
 | // distributed under the License is distributed on an "AS IS" BASIS, | 
 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
 | // See the License for the specific language governing permissions and | 
 | // limitations under the License. | 
 |  | 
 | syntax = "proto2"; | 
 |  | 
 | option java_package = "com.google.gerrit.proto.reviewdb"; | 
 |  | 
 | package devtools.gerritcodereview; | 
 | message Change_Id { | 
 | 	required int32 id = 1; | 
 | } | 
 |  | 
 | message ChangeMessage_Key { | 
 | 	required Change_Id change_id = 1; | 
 | 	required string uuid = 2; | 
 | } | 
 |  | 
 | message PatchSet_Id { | 
 | 	required Change_Id change_id = 1; | 
 | 	required int32 patch_set_id = 2; | 
 | } | 
 |  | 
 | message Patch_Key { | 
 | 	required PatchSet_Id patch_set_id = 1; | 
 | 	required string file_name = 2; | 
 | } | 
 |  | 
 | message PatchLineComment_Key { | 
 | 	required Patch_Key patch_key = 1; | 
 | 	required string uuid = 2; | 
 | } | 
 |  | 
 | message Account_Id { | 
 | 	required int32 id = 1; | 
 | } | 
 |  | 
 | message LabelId { | 
 | 	required string id = 1; | 
 | } | 
 |  | 
 | message PatchSetApproval_Key { | 
 | 	required PatchSet_Id patch_set_id = 1; | 
 | 	required Account_Id account_id = 2; | 
 | 	required LabelId category_id = 3; | 
 | } | 
 |  | 
 | message CurrentSchemaVersion_Key { | 
 | 	required string one = 1; | 
 | } | 
 |  | 
 | message ChangeMessage { | 
 | 	required ChangeMessage_Key key = 1; | 
 | 	optional Account_Id author_id = 2; | 
 | 	optional fixed64 written_on = 3; | 
 | 	optional string message = 4; | 
 | 	optional PatchSet_Id patchset = 5; | 
 | 	optional string tag = 6; | 
 | 	optional Account_Id real_author = 7; | 
 | } | 
 |  | 
 | message Change_Key { | 
 | 	optional string id = 1; | 
 | } | 
 |  | 
 | message Project_NameKey { | 
 | 	optional string name = 1; | 
 | } | 
 |  | 
 | message Branch_NameKey { | 
 | 	optional Project_NameKey project_name = 1; | 
 | 	optional string branch_name = 2; | 
 | } | 
 |  | 
 | message Change { | 
 | 	required Change_Id change_id = 1; | 
 | 	optional Change_Key change_key = 2; | 
 | 	optional int32 row_version = 3; | 
 | 	optional fixed64 created_on = 4; | 
 | 	optional fixed64 last_updated_on = 5; | 
 | 	optional Account_Id owner_account_id = 7; | 
 | 	optional Branch_NameKey dest = 8; | 
 | 	optional uint32 status = 10; | 
 | 	optional int32 current_patch_set_id = 12; | 
 | 	optional string subject = 13; | 
 | 	optional string topic = 14; | 
 | 	optional string original_subject = 17; | 
 | 	optional string submission_id = 18; | 
 | 	optional Account_Id assignee = 19; | 
 | 	optional bool is_private = 20; | 
 | 	optional bool work_in_progress = 21; | 
 | 	optional bool review_started = 22; | 
 | 	optional Change_Id revert_of = 23; | 
 | 	optional string note_db_state = 101; | 
 | } | 
 |  | 
 | message CommentRange { | 
 | 	optional int32 start_line = 1; | 
 | 	optional int32 start_character = 2; | 
 | 	optional int32 end_line = 3; | 
 | 	optional int32 end_character = 4; | 
 | } | 
 |  | 
 | message PatchLineComment { | 
 | 	required PatchLineComment_Key key = 1; | 
 | 	optional int32 line_nbr = 2; | 
 | 	optional Account_Id author_id = 3; | 
 | 	optional fixed64 written_on = 4; | 
 | 	optional uint32 status = 5; | 
 | 	optional int32 side = 6; | 
 | 	optional string message = 7; | 
 | 	optional string parent_uuid = 8; | 
 | 	optional CommentRange range = 9; | 
 | 	optional string tag = 10; | 
 | 	optional Account_Id real_author = 11; | 
 | 	optional bool unresolved = 12; | 
 | } | 
 |  | 
 | message PatchSetApproval { | 
 | 	required PatchSetApproval_Key key = 1; | 
 | 	optional int32 value = 2; | 
 | 	optional fixed64 granted = 3; | 
 | 	optional string tag = 6; | 
 | 	optional Account_Id real_account_id = 7; | 
 | 	optional bool post_submit = 8; | 
 | } | 
 |  | 
 | message RevId { | 
 | 	optional string id = 1; | 
 | } | 
 |  | 
 | message PatchSet { | 
 | 	required PatchSet_Id id = 1; | 
 | 	optional RevId revision = 2; | 
 | 	optional Account_Id uploader_account_id = 3; | 
 | 	optional fixed64 created_on = 4; | 
 | 	optional string groups = 6; | 
 | 	optional string push_certificate = 8; | 
 | 	optional string description = 9; | 
 | } | 
 |  | 
 | message CurrentSchemaVersion { | 
 | 	required CurrentSchemaVersion_Key singleton = 1; | 
 | 	optional int32 version_nbr = 2; | 
 | } | 
 |  | 
 | message AnyReviewDbPrimaryKey { | 
 | 	optional CurrentSchemaVersion_Key schema_version = 1; | 
 | 	optional Change_Id changes = 21; | 
 | 	optional PatchSetApproval_Key patch_set_approvals = 22; | 
 | 	optional ChangeMessage_Key change_messages = 23; | 
 | 	optional PatchSet_Id patch_sets = 24; | 
 | 	optional PatchLineComment_Key patch_comments = 26; | 
 | } | 
 |  | 
 | message AnyReviewDb { | 
 | 	optional CurrentSchemaVersion schema_version = 1; | 
 | 	optional Change changes = 21; | 
 | 	optional PatchSetApproval patch_set_approvals = 22; | 
 | 	optional ChangeMessage change_messages = 23; | 
 | 	optional PatchSet patch_sets = 24; | 
 | 	optional PatchLineComment patch_comments = 26; | 
 | } |