Contract functions are upgradable, but not states, for example
#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)]
pub struct Contract {
owner_id: AccountId
}
If I want to add another field, say saving_id, it gives error
#[near_bindgen]
#[derive(BorshDeserialize, BorshSerialize, PanicOnDefault)]
pub struct Contract {
owner_id: AccountId,
saving_id: AccountId
}
How can I write upgradable contract?