By adding group_id to the proposals table, we gain the ability to quickly look up the historical (pruned) proposals for a particular group.
We will add an database index to the column.
This will be required in the context of the historical proposals in the groups-ui:
https://github.com/regen-network/groups-ui/pull/106
Prior to inserting a proposal record in the indexer, we can perform a lookup of the group id.
Given a proposal object which is already fetched in the current index_proposals, you can use the group_policy_address to look up the group id.
By adding
group_id
to the proposals table, we gain the ability to quickly look up the historical (pruned) proposals for a particular group. We will add an database index to the column. This will be required in the context of the historical proposals in the groups-ui: https://github.com/regen-network/groups-ui/pull/106Prior to inserting a proposal record in the indexer, we can perform a lookup of the group id. Given a proposal object which is already fetched in the current index_proposals, you can use the group_policy_address to look up the group id.
Sample proposal and group_policy_address:
Given the
group_policy_address
above, look up thegroup_id
: