How to make migration for defined proto schema?

243 views Asked by At

I have defined a proto with an array(repeated) and redefine it later to a map after some years. How to migrate the jsons written with previous defined proto format to the new redefined format?

PS : I don't want the users to manually change it

Example : The following is what I have defined in previous version

syntax = "proto3";
repeated Foo models = 1;
message Foo {
  string id = 1;
  string module = 2;
  string pattern = 3;
}

I redefine it to the following :

syntax = "proto3";
map<string,Foo> models = 1;
message Foo {
  string module = 1;
  string pattern = 2;
}
0

There are 0 answers