From bf0e8430e5d16edb79e4f81e659596dde1e98147 Mon Sep 17 00:00:00 2001 From: Wan Qi Chen <495709+wa0x6e@users.noreply.github.com> Date: Thu, 22 Aug 2024 23:06:05 +0900 Subject: [PATCH] feat: add support for new source column in statements table --- src/graphql/operations/statements.ts | 1 + src/graphql/schema.gql | 3 +++ src/helpers/schema.sql | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/graphql/operations/statements.ts b/src/graphql/operations/statements.ts index f9f85bd2..72d2bfd9 100644 --- a/src/graphql/operations/statements.ts +++ b/src/graphql/operations/statements.ts @@ -13,6 +13,7 @@ export default async function (parent, args) { ipfs: 'string', space: 'string', network: 'string', + source: 'string', created: 'number', delegate: ['evmAddress', 'starknetAddress'] }; diff --git a/src/graphql/schema.gql b/src/graphql/schema.gql index 06aa277e..89e06750 100644 --- a/src/graphql/schema.gql +++ b/src/graphql/schema.gql @@ -343,6 +343,8 @@ input StatementsWhere { created_gte: Int created_lt: Int created_lte: Int + source: String + source_in: [String] } input LeaderboardsWhere { @@ -580,6 +582,7 @@ type Statement { statement: String discourse: String status: String + source: String created: Int! updated: Int! } diff --git a/src/helpers/schema.sql b/src/helpers/schema.sql index 700c7286..f62fed59 100644 --- a/src/helpers/schema.sql +++ b/src/helpers/schema.sql @@ -148,13 +148,14 @@ CREATE TABLE users ( CREATE TABLE statements ( id VARCHAR(66) NOT NULL, - ipfs VARCHAR(64) NOT NULL, + ipfs VARCHAR(64) DEFAULT NULL, delegate VARCHAR(100) NOT NULL, space VARCHAR(100) NOT NULL, about TEXT, statement TEXT, network VARCHAR(24) NOT NULL DEFAULT 's', discourse VARCHAR(64), + source VARCHAR(100) DEFAULT NULL, status VARCHAR(24) NOT NULL DEFAULT 'INACTIVE', created INT(11) NOT NULL, updated INT(11) NOT NULL, @@ -164,6 +165,7 @@ CREATE TABLE statements ( INDEX network (network), INDEX created (created), INDEX updated (updated), + INDEX source (source), INDEX status (status) );