Trait near_contract_tools::migrate::MigrateHook
source · pub trait MigrateHook: MigrateController {
fn on_migrate(
old_schema: <Self as MigrateController>::OldSchema
) -> <Self as MigrateController>::NewSchema;
}
Expand description
Called on migration. Must be implemented by the user. (The derive macro does not implement this for you.)
Required Methods§
sourcefn on_migrate(
old_schema: <Self as MigrateController>::OldSchema
) -> <Self as MigrateController>::NewSchema
fn on_migrate(
old_schema: <Self as MigrateController>::OldSchema
) -> <Self as MigrateController>::NewSchema
Receives the old schema deserialized from storage as well as optional arguments from caller, and replaces it with the new schema.