Skip to content

Commit

Permalink
feat(proposal): add ability to update proposals (#669)
Browse files Browse the repository at this point in the history
* feat(proposal): add ability to update proposals

* feat(graphql): update schema

* feat(sql): add index to updated field of proposals table
  • Loading branch information
Todmy authored Sep 20, 2023
1 parent ed1fdc0 commit e087e76
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/graphql/operations/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default async function (parent, args) {
author: 'string',
network: 'string',
created: 'number',
updated: 'number',
app: 'string',
start: 'number',
end: 'number',
Expand Down
7 changes: 7 additions & 0 deletions src/graphql/schema.gql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -402,6 +408,7 @@ type Proposal {
ipfs: String
author: String!
created: Int!
updated: Int
space: Space
network: String!
symbol: String!
Expand Down
2 changes: 2 additions & 0 deletions src/helpers/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit e087e76

Please sign in to comment.