From e087e767a33505a0ce0b47c6697a9575327edd36 Mon Sep 17 00:00:00 2001 From: Dmytro Tolok Date: Wed, 20 Sep 2023 11:46:27 +0200 Subject: [PATCH] feat(proposal): add ability to update proposals (#669) * feat(proposal): add ability to update proposals * feat(graphql): update schema * feat(sql): add index to updated field of proposals table --- src/graphql/operations/proposals.ts | 1 + src/graphql/schema.gql | 7 +++++++ src/helpers/schema.sql | 2 ++ 3 files changed, 10 insertions(+) diff --git a/src/graphql/operations/proposals.ts b/src/graphql/operations/proposals.ts index 57a022d2..35376409 100644 --- a/src/graphql/operations/proposals.ts +++ b/src/graphql/operations/proposals.ts @@ -16,6 +16,7 @@ export default async function (parent, args) { author: 'string', network: 'string', created: 'number', + updated: 'number', app: 'string', start: 'number', end: 'number', diff --git a/src/graphql/schema.gql b/src/graphql/schema.gql index e2d954f9..f6a4736f 100644 --- a/src/graphql/schema.gql +++ b/src/graphql/schema.gql @@ -184,6 +184,12 @@ input ProposalWhere { created_gte: Int created_lt: Int created_lte: Int + updated: Int + updated_in: [Int] + updated_gt: Int + updated_gte: Int + updated_lt: Int + updated_lte: Int start: Int start_in: [Int] start_gt: Int @@ -402,6 +408,7 @@ type Proposal { ipfs: String author: String! created: Int! + updated: Int space: Space network: String! symbol: String! diff --git a/src/helpers/schema.sql b/src/helpers/schema.sql index eea3849a..aeccead2 100644 --- a/src/helpers/schema.sql +++ b/src/helpers/schema.sql @@ -19,6 +19,7 @@ CREATE TABLE proposals ( ipfs VARCHAR(64) NOT NULL, author VARCHAR(64) NOT NULL, created INT(11) NOT NULL, + updated INT(11) DEFAULT NULL, space VARCHAR(64) NOT NULL, network VARCHAR(12) NOT NULL, symbol VARCHAR(16) NOT NULL, @@ -47,6 +48,7 @@ CREATE TABLE proposals ( INDEX ipfs (ipfs), INDEX author (author), INDEX created (created), + INDEX updated (updated), INDEX network (network), INDEX space (space), INDEX start (start),