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: cas_migration.rs
    path of file: ./repos/krill/src/upgrades/pre_0_10_0
    
    the code of the file until where you have to start completion: use std::convert::TryInto;

use rpki::ca::idexchange::MyHandle;
use rpki::{ca::idexchange::CaHandle, repository::x509::Time};

use crate::commons::api::ProviderAsn;
use crate::commons::eventsourcing::StoredCommandBuilder;
use crate::daemon::ca::CaObjects;
use crate::upgrades::{AspaMigrationConfigUpdates, AspaMigrationConfigs, CommandMigrationEffect, UnconvertedEffect};
use crate::{
    commons::{
        api::CertAuthStorableCommand,
        eventsourcing
    
    pub fn upgrade(mode: UpgradeMode, config: &Config) -> UpgradeResult<AspaMigrationConfigs> {
        let current_kv_store = KeyValueStore::create(&config.storage_uri, CASERVER_NS)?;
        let new_kv_store = KeyValueStore::create_upgrade_store(&config.storage_uri, CASERVER_NS)?;

        let new_agg_store = AggregateStore::<CertAuth>::create_upgrade_store(
            &config.storage_uri,
            CASERVER_NS,
            config.use_history_cache,
        )?;
        let ca_objects_migration = CaObjectsMigration::create(config)?;

        CasMigration {
            current_kv_store,
            new_kv_store,
            new_agg_store,
            ca_objects_migration,
        }
        .upgrade(mode)
    }