From 9a31d53f0444856e20be72766e374da4d37aaae2 Mon Sep 17 00:00:00 2001 From: Mitch Oz Date: Fri, 14 Jun 2024 12:27:32 -0600 Subject: [PATCH 1/4] add gitcoin passport holders --- README.md | 9 +++++---- ...er.js => 1728389519384-AddGitcoin Passport Holder.js} | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) rename db/migrations/{1728040623823-AddGitcoin Passport Holder.js => 1728389519384-AddGitcoin Passport Holder.js} (85%) diff --git a/README.md b/README.md index 8cde7ce..5f0f10a 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,6 @@ Devouch is a decentralized application that allows users to attest to projects credibility by their vouches or flags. The backend is built on Subsquid and uses a Postgres database. -# Getting Started - - ## Add new organisation ```bash @@ -17,4 +14,8 @@ cp org-config.template.jsonc org-config.jsonc # 2. Run the script to add your organisation data to migrations npm run add-organization ``` -Then create a PR to the main branch to be reviewed and merged. \ No newline at end of file +Then create a PR to the main branch to be reviewed and merged. + +## Further Documentation + +More information can be found on the [Giveth docs website](https://docs.giveth.io/devouch). \ No newline at end of file diff --git a/db/migrations/1728040623823-AddGitcoin Passport Holder.js b/db/migrations/1728389519384-AddGitcoin Passport Holder.js similarity index 85% rename from db/migrations/1728040623823-AddGitcoin Passport Holder.js rename to db/migrations/1728389519384-AddGitcoin Passport Holder.js index af4474b..54d4cd9 100644 --- a/db/migrations/1728040623823-AddGitcoin Passport Holder.js +++ b/db/migrations/1728389519384-AddGitcoin Passport Holder.js @@ -1,17 +1,18 @@ -module.exports = class AddGitcoinPassportHolder1728040623823 { - name = "AddGitcoinPassportHolder1728040623823"; +module.exports = class AddGitcoinPassportHolder1728389519384 { + name = "AddGitcoinPassportHolder1728389519384"; async up(db) { const SQUID_NETWORK = process.env.SQUID_NETWORK || "eth-sepolia"; if (SQUID_NETWORK !== "optimism-mainnet") return; // add organisation with name "Gitcoin Passport Holder" and schema id "0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89" await db.query( - `INSERT INTO "organisation" ("id", "name", "issuer", "color") + `INSERT INTO "organisation" ("id", "name", "issuer", "color", "start_block") VALUES ( '0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89', 'Gitcoin Passport Holder', '0x843829986e895facd330486a61ebee9e1f1adb1a', - '#00433b' + '#00433b', + 108517456 )` ); } From 24a86beca02b9719da8b4ee2ef1571d395a320a3 Mon Sep 17 00:00:00 2001 From: Amin Latifi Date: Sun, 16 Jun 2024 08:35:32 +0000 Subject: [PATCH 2/4] Update README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5f0f10a..0a47151 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Introduction -Devouch is a decentralized application that allows users to attest to projects credibility by their vouches or flags. The backend is built on Subsquid and uses a Postgres database. +Devouch is a decentralized application that allows users to attest to project's credibility by their vouches or flags. The backend is built on Subsquid and uses a Postgres database. ## Add new organisation From 71be6d69a35367b2c92b3c82f4014ff825b33e8f Mon Sep 17 00:00:00 2001 From: Amin Latifi Date: Sun, 16 Jun 2024 12:22:46 +0330 Subject: [PATCH 3/4] removed duplicate AddGitcoin Passport Holder migration --- ...728389519384-AddGitcoin Passport Holder.js | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 db/migrations/1728389519384-AddGitcoin Passport Holder.js diff --git a/db/migrations/1728389519384-AddGitcoin Passport Holder.js b/db/migrations/1728389519384-AddGitcoin Passport Holder.js deleted file mode 100644 index 54d4cd9..0000000 --- a/db/migrations/1728389519384-AddGitcoin Passport Holder.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = class AddGitcoinPassportHolder1728389519384 { - name = "AddGitcoinPassportHolder1728389519384"; - - async up(db) { - const SQUID_NETWORK = process.env.SQUID_NETWORK || "eth-sepolia"; - if (SQUID_NETWORK !== "optimism-mainnet") return; - // add organisation with name "Gitcoin Passport Holder" and schema id "0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89" - await db.query( - `INSERT INTO "organisation" ("id", "name", "issuer", "color", "start_block") - VALUES ( - '0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89', - 'Gitcoin Passport Holder', - '0x843829986e895facd330486a61ebee9e1f1adb1a', - '#00433b', - 108517456 - )` - ); - } - - async down(db) { - const SQUID_NETWORK = process.env.SQUID_NETWORK || "eth-sepolia"; - if (SQUID_NETWORK !== "optimism-mainnet") return; - // remove organisation with name "Gitcoin Passport Holder" and schema id "0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89" - await db.query( - `DELETE FROM "organisation" WHERE "id" = '0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89'` - ); - } -}; - \ No newline at end of file From 1688d62546496b44d503813b99889ac17f596384 Mon Sep 17 00:00:00 2001 From: Amin Latifi Date: Sun, 16 Jun 2024 12:24:03 +0330 Subject: [PATCH 4/4] Revert "removed duplicate AddGitcoin Passport Holder migration" This reverts commit 71be6d69a35367b2c92b3c82f4014ff825b33e8f. --- ...728389519384-AddGitcoin Passport Holder.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 db/migrations/1728389519384-AddGitcoin Passport Holder.js diff --git a/db/migrations/1728389519384-AddGitcoin Passport Holder.js b/db/migrations/1728389519384-AddGitcoin Passport Holder.js new file mode 100644 index 0000000..54d4cd9 --- /dev/null +++ b/db/migrations/1728389519384-AddGitcoin Passport Holder.js @@ -0,0 +1,29 @@ +module.exports = class AddGitcoinPassportHolder1728389519384 { + name = "AddGitcoinPassportHolder1728389519384"; + + async up(db) { + const SQUID_NETWORK = process.env.SQUID_NETWORK || "eth-sepolia"; + if (SQUID_NETWORK !== "optimism-mainnet") return; + // add organisation with name "Gitcoin Passport Holder" and schema id "0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89" + await db.query( + `INSERT INTO "organisation" ("id", "name", "issuer", "color", "start_block") + VALUES ( + '0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89', + 'Gitcoin Passport Holder', + '0x843829986e895facd330486a61ebee9e1f1adb1a', + '#00433b', + 108517456 + )` + ); + } + + async down(db) { + const SQUID_NETWORK = process.env.SQUID_NETWORK || "eth-sepolia"; + if (SQUID_NETWORK !== "optimism-mainnet") return; + // remove organisation with name "Gitcoin Passport Holder" and schema id "0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89" + await db.query( + `DELETE FROM "organisation" WHERE "id" = '0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89'` + ); + } +}; + \ No newline at end of file