reviewdb.proto: Rearrange messages

Messages for enclosing classes are moved to the messages of their inner
classes.

Change-Id: I29fd3d8451fba0549ef52551eefc72d12203d3af
diff --git a/proto/reviewdb.proto b/proto/reviewdb.proto
index f26cbb8..bc45eea 100644
--- a/proto/reviewdb.proto
+++ b/proto/reviewdb.proto
@@ -24,91 +24,12 @@
   required int32 id = 1;
 }
 
-// Serialized form of com.google.gerrit.reviewdb.client.ChangeMessage.
-// Next ID: 3
-message ChangeMessage_Key {
-  required Change_Id change_id = 1;
-  required string uuid = 2;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.PatchSet.Id.
-// Next ID: 3
-message PatchSet_Id {
-  required Change_Id change_id = 1;
-  required int32 patch_set_id = 2;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.Patch.Key.
-// Next ID: 3
-message Patch_Key {
-  required PatchSet_Id patch_set_id = 1;
-  required string file_name = 2;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.PatchLineComment.Key.
-// Next ID: 3
-message PatchLineComment_Key {
-  required Patch_Key patch_key = 1;
-  required string uuid = 2;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.Account.Id.
-// Next ID: 2
-message Account_Id {
-  required int32 id = 1;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.LabelId.
-// Next ID: 2
-message LabelId {
-  required string id = 1;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.PatchSetApproval.Key.
-// Next ID: 4
-message PatchSetApproval_Key {
-  required PatchSet_Id patch_set_id = 1;
-  required Account_Id account_id = 2;
-  required LabelId category_id = 3;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.CurrentSchemaVersion.Key.
-// Next ID: 2
-message CurrentSchemaVersion_Key {
-  required string one = 1;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.ChangeMessage.
-// Next ID: 8
-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;
-}
-
 // Serialized form of com.google.gerrit.reviewdb.client.Change.Key.
 // Next ID: 2
 message Change_Key {
   optional string id = 1;
 }
 
-// Serialized form of com.google.gerrit.reviewdb.client.Project.NameKey.
-// Next ID: 2
-message Project_NameKey {
-  optional string name = 1;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.Branch.NameKey.
-// Next ID: 3
-message Branch_NameKey {
-  optional Project_NameKey project_name = 1;
-  optional string branch_name = 2;
-}
-
 // Serialized form of com.google.gerrit.reviewdb.client.Change.
 // Next ID: 24
 message Change {
@@ -140,13 +61,60 @@
   reserved 16; // mergeable
 }
 
-// Serialized form of com.google.gerrit.reviewdb.client.CommentRange.
-// Next ID: 5
-message CommentRange {
-  optional int32 start_line = 1;
-  optional int32 start_character = 2;
-  optional int32 end_line = 3;
-  optional int32 end_character = 4;
+// Serialized form of com.google.gerrit.reviewdb.client.ChangeMessage.
+// Next ID: 3
+message ChangeMessage_Key {
+  required Change_Id change_id = 1;
+  required string uuid = 2;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.ChangeMessage.
+// Next ID: 8
+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;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.Patch.Key.
+// Next ID: 3
+message Patch_Key {
+  required PatchSet_Id patch_set_id = 1;
+  required string file_name = 2;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.PatchSet.Id.
+// Next ID: 3
+message PatchSet_Id {
+  required Change_Id change_id = 1;
+  required int32 patch_set_id = 2;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.PatchSet.
+// Next ID: 10
+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;
+
+  // Deleted fields, should not be reused:
+  reserved 5;  // draft
+  reserved 7;  // pushCertficate
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.PatchLineComment.Key.
+// Next ID: 3
+message PatchLineComment_Key {
+  required Patch_Key patch_key = 1;
+  required string uuid = 2;
 }
 
 // Serialized form of com.google.gerrit.reviewdb.client.PatchLineComment.
@@ -166,6 +134,26 @@
   optional bool unresolved = 12;
 }
 
+// Serialized form of com.google.gerrit.reviewdb.client.Account.Id.
+// Next ID: 2
+message Account_Id {
+  required int32 id = 1;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.LabelId.
+// Next ID: 2
+message LabelId {
+  required string id = 1;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.PatchSetApproval.Key.
+// Next ID: 4
+message PatchSetApproval_Key {
+  required PatchSet_Id patch_set_id = 1;
+  required Account_Id account_id = 2;
+  required LabelId category_id = 3;
+}
+
 // Serialized form of com.google.gerrit.reviewdb.client.PatchSetApproval.
 // Next ID: 9
 message PatchSetApproval {
@@ -181,26 +169,10 @@
   reserved 5;  // changeSortKey
 }
 
-// Serialized form of com.google.gerrit.reviewdb.client.RevId.
+// Serialized form of com.google.gerrit.reviewdb.client.CurrentSchemaVersion.Key.
 // Next ID: 2
-message RevId {
-  optional string id = 1;
-}
-
-// Serialized form of com.google.gerrit.reviewdb.client.PatchSet.
-// Next ID: 10
-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;
-
-  // Deleted fields, should not be reused:
-  reserved 5;  // draft
-  reserved 7;  // pushCertficate
+message CurrentSchemaVersion_Key {
+  required string one = 1;
 }
 
 // Serialized form of com.google.gerrit.reviewdb.client.CurrentSchemaVersion.
@@ -209,3 +181,31 @@
   required CurrentSchemaVersion_Key singleton = 1;
   optional int32 version_nbr = 2;
 }
+
+// Serialized form of com.google.gerrit.reviewdb.client.Project.NameKey.
+// Next ID: 2
+message Project_NameKey {
+  optional string name = 1;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.Branch.NameKey.
+// Next ID: 3
+message Branch_NameKey {
+  optional Project_NameKey project_name = 1;
+  optional string branch_name = 2;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.CommentRange.
+// Next ID: 5
+message CommentRange {
+  optional int32 start_line = 1;
+  optional int32 start_character = 2;
+  optional int32 end_line = 3;
+  optional int32 end_character = 4;
+}
+
+// Serialized form of com.google.gerrit.reviewdb.client.RevId.
+// Next ID: 2
+message RevId {
+  optional string id = 1;
+}