Skip to main content

Questions tagged [persistence]

Filter by
Sorted by
Tagged with
3 votes
3 answers
1k views

How to store contract state as singleton?

What is the best way to store fields specific for contract, for example if contract has 3 fields (2 strings, 1 uint64_t) and they can be changed? Should I create new table for this, it would always be ...
Bida's user avatar
  • 281
1 vote
0 answers
333 views

How do I add second and third indices to the multi_index object?

I have thoroughly read the documentation and isolated my problem down to a small set of sample code. I'm not sure where my problem is. I am trying to add multiple indices to a multi_index object so ...
Max's user avatar
  • 411
8 votes
2 answers
493 views

Best practice to handle table migrations?

What is the best practice for migrating table when a member of a struct is added? For some structs, I have had no problems adding members, but for others I have. I get this error message: $cleos get ...
Max's user avatar
  • 411
2 votes
1 answer
667 views

How to allow duplicates in an eosio::multi_index object?

How do I create a struct and multi_index table that allow for duplicate records? For example, I have the below struct and multi_index table that is populated via an emplace call that selects a ...
Max's user avatar
  • 411