You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be always correct to migrate from 1.0 to 1.2 version of the contract by applying migrations one by one: 1.0 -> 1.1 -> 1.2.
However it may be a case, where it is strongly inefficient and we want to support a migration from 1.1, but have a completely separate implementation of migration from 1.0. Example like this:
structContract{/* ... */}#[contract]implContract{#[msg(migrate, from = 1.0, to = 1.2)]fnmigrate1_0(&self,ctx:MigrationCtx,/* ... */) -> Result<Respons,ContractError>{/* ... */}#[msg(migrate, from = 1.1, to = 1.2)]fnmigrate1_1(&self,ctx:MigrationCtx,/* ... */) -> Result<Respons,ContractError>{/* ... */}}
There are two migrations to the same version but from different ones. Sylvia should be able to figure that out and still generate all the migrations for all versions. There always should be only one path to migrate from a specific version, as in this case migration from 1.0 to 1.1 is not needed anymore for our contract. Having obsolete migrations should report a warning as they would never be used.
The text was updated successfully, but these errors were encountered:
Improvement of #25
It should be always correct to migrate from 1.0 to 1.2 version of the contract by applying migrations one by one: 1.0 -> 1.1 -> 1.2.
However it may be a case, where it is strongly inefficient and we want to support a migration from 1.1, but have a completely separate implementation of migration from 1.0. Example like this:
There are two migrations to the same version but from different ones. Sylvia should be able to figure that out and still generate all the migrations for all versions. There always should be only one path to migrate from a specific version, as in this case migration from 1.0 to 1.1 is not needed anymore for our contract. Having obsolete migrations should report a warning as they would never be used.
The text was updated successfully, but these errors were encountered: