Skip to content

Commit

Permalink
feat: rename enum value to fix java problem
Browse files Browse the repository at this point in the history
Signed-off-by: Manan Gupta <manan@planetscale.com>
  • Loading branch information
GuptaManan100 committed Oct 17, 2023
1 parent 0f4e9d0 commit 7419ab6
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 104 deletions.
2 changes: 1 addition & 1 deletion go/test/vschemawrapper/vschema_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (vw *VSchemaWrapper) PlannerWarning(_ string) {

func (vw *VSchemaWrapper) ForeignKeyMode(keyspace string) (vschemapb.Keyspace_ForeignKeyMode, error) {
defaultFkMode := vschemapb.Keyspace_unmanaged
if vw.V.Keyspaces[keyspace] != nil && vw.V.Keyspaces[keyspace].ForeignKeyMode != vschemapb.Keyspace_default {
if vw.V.Keyspaces[keyspace] != nil && vw.V.Keyspaces[keyspace].ForeignKeyMode != vschemapb.Keyspace_unspecified {
return vw.V.Keyspaces[keyspace].ForeignKeyMode, nil
}
return defaultFkMode, nil
Expand Down
184 changes: 92 additions & 92 deletions go/vt/proto/vschema/vschema.pb.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go/vt/vtgate/semantics/FakeSI.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (s *FakeSI) ForeignKeyMode(keyspace string) (vschemapb.Keyspace_ForeignKeyM
if s.KsForeignKeyMode != nil {
fkMode, isPresent := s.KsForeignKeyMode[keyspace]
if !isPresent {
return vschemapb.Keyspace_default, fmt.Errorf("%v keyspace not found", keyspace)
return vschemapb.Keyspace_unspecified, fmt.Errorf("%v keyspace not found", keyspace)
}
return fkMode, nil
}
Expand Down
8 changes: 4 additions & 4 deletions go/vt/vtgate/vindexes/vschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func buildKeyspaces(source *vschemapb.SrvVSchema, vschema *VSchema) {
Name: ksname,
Sharded: ks.Sharded,
},
ForeignKeyMode: replaceDefaultForeignKeyMode(ks.ForeignKeyMode),
ForeignKeyMode: replaceUnspecifiedForeignKeyMode(ks.ForeignKeyMode),
Tables: make(map[string]*Table),
Vindexes: make(map[string]Vindex),
}
Expand All @@ -335,9 +335,9 @@ func buildKeyspaces(source *vschemapb.SrvVSchema, vschema *VSchema) {
}
}

// replaceDefaultForeignKeyMode replaces the default value of the foreign key mode enum with the default we want to keep.
func replaceDefaultForeignKeyMode(fkMode vschemapb.Keyspace_ForeignKeyMode) vschemapb.Keyspace_ForeignKeyMode {
if fkMode == vschemapb.Keyspace_default {
// replaceUnspecifiedForeignKeyMode replaces the default value of the foreign key mode enum with the default we want to keep.
func replaceUnspecifiedForeignKeyMode(fkMode vschemapb.Keyspace_ForeignKeyMode) vschemapb.Keyspace_ForeignKeyMode {
if fkMode == vschemapb.Keyspace_unspecified {
return vschemapb.Keyspace_unmanaged
}
return fkMode
Expand Down
2 changes: 1 addition & 1 deletion proto/vschema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ message Keyspace {
ForeignKeyMode foreign_key_mode = 5;

enum ForeignKeyMode {
default = 0;
unspecified = 0;
disallow = 1;
unmanaged = 2;
managed = 3;
Expand Down
2 changes: 1 addition & 1 deletion web/vtadmin/src/proto/vtadmin.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions web/vtadmin/src/proto/vtadmin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7419ab6

Please sign in to comment.