normalizeLegacyMetadata mutates meta in place to match the canonical IndexMetadata.expressions contract. Idempotent and cheap on canonical input.
(meta *storepb.DatabaseSchemaMetadata)
| 38 | // normalizeLegacyMetadata mutates meta in place to match the canonical |
| 39 | // IndexMetadata.expressions contract. Idempotent and cheap on canonical input. |
| 40 | func normalizeLegacyMetadata(meta *storepb.DatabaseSchemaMetadata) { |
| 41 | if meta == nil { |
| 42 | return |
| 43 | } |
| 44 | for _, s := range meta.GetSchemas() { |
| 45 | for _, t := range s.GetTables() { |
| 46 | canonicalizeIndexExpressions(t.GetIndexes()) |
| 47 | for _, p := range t.GetPartitions() { |
| 48 | canonicalizePartitionIndexes(p) |
| 49 | } |
| 50 | } |
| 51 | for _, mv := range s.GetMaterializedViews() { |
| 52 | canonicalizeIndexExpressions(mv.GetIndexes()) |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func canonicalizePartitionIndexes(p *storepb.TablePartitionMetadata) { |
| 58 | if p == nil { |