(table *v1pb.TableMetadata)
| 923 | } |
| 924 | |
| 925 | func convertV1TableMetadata(table *v1pb.TableMetadata) *storepb.TableMetadata { |
| 926 | t := &storepb.TableMetadata{ |
| 927 | Name: table.Name, |
| 928 | Engine: table.Engine, |
| 929 | Collation: table.Collation, |
| 930 | RowCount: table.RowCount, |
| 931 | DataSize: table.DataSize, |
| 932 | IndexSize: table.IndexSize, |
| 933 | DataFree: table.DataFree, |
| 934 | CreateOptions: table.CreateOptions, |
| 935 | Comment: table.Comment, |
| 936 | Charset: table.Charset, |
| 937 | Owner: table.Owner, |
| 938 | SortingKeys: table.SortingKeys, |
| 939 | SkipDump: table.SkipDump, |
| 940 | } |
| 941 | for _, column := range table.Columns { |
| 942 | if column == nil { |
| 943 | continue |
| 944 | } |
| 945 | t.Columns = append(t.Columns, convertV1ColumnMetadata(column)) |
| 946 | } |
| 947 | for _, index := range table.Indexes { |
| 948 | if index == nil { |
| 949 | continue |
| 950 | } |
| 951 | t.Indexes = append(t.Indexes, convertV1IndexMetadata(index)) |
| 952 | } |
| 953 | for _, foreignKey := range table.ForeignKeys { |
| 954 | if foreignKey == nil { |
| 955 | continue |
| 956 | } |
| 957 | t.ForeignKeys = append(t.ForeignKeys, &storepb.ForeignKeyMetadata{ |
| 958 | Name: foreignKey.Name, |
| 959 | Columns: foreignKey.Columns, |
| 960 | ReferencedSchema: foreignKey.ReferencedSchema, |
| 961 | ReferencedTable: foreignKey.ReferencedTable, |
| 962 | ReferencedColumns: foreignKey.ReferencedColumns, |
| 963 | OnDelete: foreignKey.OnDelete, |
| 964 | OnUpdate: foreignKey.OnUpdate, |
| 965 | MatchType: foreignKey.MatchType, |
| 966 | }) |
| 967 | } |
| 968 | for _, partition := range table.Partitions { |
| 969 | if partition == nil { |
| 970 | continue |
| 971 | } |
| 972 | t.Partitions = append(t.Partitions, convertV1TablePartitionMetadata(partition)) |
| 973 | } |
| 974 | for _, check := range table.CheckConstraints { |
| 975 | if check == nil { |
| 976 | continue |
| 977 | } |
| 978 | t.CheckConstraints = append(t.CheckConstraints, &storepb.CheckConstraintMetadata{ |
| 979 | Name: check.Name, |
| 980 | Expression: check.Expression, |
| 981 | }) |
| 982 | } |
no test coverage detected