Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/hub/src/graphql/operations/proposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default async function (parent, { id }) {
FROM proposals p
INNER JOIN spaces ON spaces.id = p.space
LEFT JOIN skins ON spaces.id = skins.id
WHERE p.id = ? AND spaces.settings IS NOT NULL
WHERE p.id = ?
LIMIT 1
`;
try {
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/graphql/operations/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default async function (parent, args) {
FROM subscriptions s
INNER JOIN spaces ON spaces.id = s.space
LEFT JOIN skins ON spaces.id = skins.id
WHERE spaces.settings IS NOT NULL ${queryStr}
WHERE 1=1 ${queryStr}
ORDER BY ${orderBy} ${orderDirection} LIMIT ?, ?
`;
params.push(skip, first);
Expand Down
4 changes: 2 additions & 2 deletions apps/hub/src/graphql/operations/votes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function query(parent, args, context?, info?) {
.filter((v, i, a) => a.indexOf(v) === i);
const query = `
SELECT * FROM spaces
WHERE id IN (?) AND settings IS NOT NULL AND deleted = 0
WHERE id IN (?) AND deleted = 0
`;
try {
let spaces = await db.queryAsync(query, [spaceIds]);
Expand Down Expand Up @@ -106,7 +106,7 @@ async function query(parent, args, context?, info?) {
FROM proposals p
INNER JOIN spaces ON spaces.id = p.space
LEFT JOIN skins ON spaces.id = skins.id
WHERE spaces.settings IS NOT NULL AND p.id IN (?)
WHERE p.id IN (?)
`;
try {
let proposals = await db.queryAsync(query, [proposalIds]);
Expand Down
2 changes: 1 addition & 1 deletion apps/hub/src/helpers/schema.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE spaces (
id VARCHAR(64) NOT NULL,
name VARCHAR(64) NOT NULL,
settings JSON,
settings JSON NOT NULL,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is same on prod DB? 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this will need a schema update on the prod database

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy request: https://app.planetscale.com/snapshot/snapshot-hub/deploy-requests/22

@bonustrack confirm, then we can merge

Already changed on testnet

verified INT NOT NULL DEFAULT '0',
deleted INT NOT NULL DEFAULT '0',
flagged INT NOT NULL DEFAULT '0',
Expand Down
2 changes: 1 addition & 1 deletion apps/sequencer/test/schema.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE TABLE spaces (
id VARCHAR(64) NOT NULL,
name VARCHAR(64) NOT NULL,
settings JSON,
settings JSON NOT NULL,
verified INT NOT NULL DEFAULT '0',
deleted INT NOT NULL DEFAULT '0',
flagged INT NOT NULL DEFAULT '0',
Expand Down
Loading