diff --git a/flusher/flusher/db.py b/flusher/flusher/db.py index c90463ecd..909bb3247 100644 --- a/flusher/flusher/db.py +++ b/flusher/flusher/db.py @@ -497,7 +497,7 @@ def Column(*args, **kwargs): Column("version", sa.Integer, index=True), Column("admin", sa.String, sa.ForeignKey("accounts.address")), Column("metadata", sa.String), - Column("total_weight", sa.String), + Column("total_weight", sa.BigInteger), Column("created_at", CustomDateTime), ) @@ -506,7 +506,7 @@ def Column(*args, **kwargs): metadata, Column("group_id", sa.Integer, sa.ForeignKey("groups.id"), primary_key=True), Column("account_id", sa.Integer, sa.ForeignKey("accounts.id"), primary_key=True), - Column("weight", sa.String), + Column("weight", sa.BigInteger), Column("metadata", sa.String), Column("added_at", CustomDateTime), ) @@ -550,7 +550,7 @@ def Column(*args, **kwargs): "group_votes", metadata, Column("group_proposal_id", sa.Integer, sa.ForeignKey("group_proposals.id"), primary_key=True), - Column("voter_id", sa.Integer, sa.ForeignKey("accounts.id")), + Column("voter_id", sa.Integer, sa.ForeignKey("accounts.id"), primary_key=True), Column("option", sa.String), Column("metadata", sa.String), Column("submit_time", CustomDateTime), diff --git a/hasura/hasura-metadata/tables.yaml b/hasura/hasura-metadata/tables.yaml index e451385f1..08409aa76 100644 --- a/hasura/hasura-metadata/tables.yaml +++ b/hasura/hasura-metadata/tables.yaml @@ -353,6 +353,14 @@ table: name: group_votes schema: public + array_relationships: + - name: group_votes + using: + foreign_key_constraint_on: + column: group_proposal_id + table: + name: group_votes + schema: public - table: name: group_votes schema: public