You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: main.go
    path of file: ./repos/magma/lte/cloud/go/tools/migrations/m013_relay_split
    
    the code of the file until where you have to start completion: /*
 Copyright 2020 The Magma Authors.

 This source code is licensed under the BSD-style license found in the
 LICENSE file in the root directory of this source tree.

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License fo
    
func migrateNetworkEpcConfigs(tx *sql.Tx, builder squirrel.StatementBuilderType) error {
	// First read in all the old lte_network configs
	b := builder.
		Select(nwcIDCol, nwcValCol).
		From(networkConfigTable).
		Where(squirrel.Eq{nwcTypeCol: cellularNetworkConfigType})
	sqlStr, args, _ := b.ToSql()
	glog.Infof("[RUN] %s %v", sqlStr, args)
	rows, err := b.RunWith(tx).Query()
	if err != nil {
		return fmt.Errorf("get lte_network configs: %w", err)
	}
	oldByNid := map[string]types.OldNetworkCellularConfigs{}
	for rows.Next() {
		var nid string
		var confBytes []byte
		err = rows.Scan(&nid, &confBytes)
		if err != nil {
			return fmt.Errorf("scan lte_network config: %w", err)
		}
		old := types.OldNetworkCellularConfigs{}
		err = json.Unmarshal(confBytes, &old)
		if err != nil {
			return fmt.Errorf("unmarshal existing lte_network config: %w", err)
		}
		oldByNid[nid] = old
	}
	err = rows.Err()
	if err != nil {
		return fmt.Errorf("get existing lte_network configs: SQL rows error: %w", err)
	}

	// Convert network configs to new versions
	updateConfByNid := map[string][]byte{}
	for nid, old := range oldByNid {
		oldEpc := old.Epc
		newConf := types.NetworkCellularConfigs{
			Epc: &types.NetworkEpcConfigs{
				CloudSubscriberdbEnabled: oldEpc.CloudSubscriberdbEnabled,
				DefaultRuleID:            oldEpc.DefaultRuleID,
				GxGyRelayEnabled:         oldEpc.RelayEnabled,
				HssRelayEnabled:          oldEpc.RelayEnabled,
				LteAuthAmf:               oldEpc.LteAuthAmf,
				LteAuthOp:                oldEpc.LteAuthOp,
				Mcc:                      oldEpc.Mcc,
				Mnc:                      oldEpc.Mnc,
				Mobility:                 oldEpc.Mobility,
				NetworkServices:          oldEpc.NetworkServices,
				SubProfiles:              oldEpc.SubProfiles,
				Tac:                      oldEpc.Tac,
			},
			FegNetworkID: old.FegNetworkID,
			Ran:          old.Ran,
		}
		newBytes, err := json.Marshal(newConf)
		if err != nil {
			return fmt.Errorf("marshal updated lte_network config: %w", err)
		}
		updateConfByNid[nid] = newBytes
	}

	// Update lte_network configs
	for nid, updateConf := range updateConfByNid {
		bu := builder.
			Update(networkConfigTable).
			Set(nwcValCol, updateConf).
			Where(squirrel.Eq{nwcIDCol: nid, nwcTypeCol: cellularNetworkConfigType})
		sqlStr, args, _ := bu.ToSql()
		glog.Infof("[RUN] %s %v", sqlStr, args)
		_, err = bu.RunWith(tx).Exec()
		if err != nil {
			return fmt.Errorf("error updating lte_network config: %w", err)
		}
	}

	return nil
}