Skip to content

Commit

Permalink
t1
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc committed Sep 24, 2024
1 parent 4bcf80a commit 2b3d445
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
16 changes: 8 additions & 8 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ const CHAINS: Chain[] = [
// Gitcoin Attestation Network
{
contractName: "GitcoinAttestationNetwork/GitcoinGrantsResolver",
address: "0x0",
fromBlock: 0,
address: "0xBAa70bbAB3C4a7265f879bb3658336DE893b8582",
fromBlock: 6746370,
},
],
},
Expand Down Expand Up @@ -717,6 +717,12 @@ const CHAINS: Chain[] = [
address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
fromBlock: 146498081,
},
// Gitcoin Attestation Network
// {
// contractName: "GitcoinAttestationNetwork/GitcoinGrantsResolver",
// address: "0x0",
// fromBlock: 0,
// },
],
},
{
Expand Down Expand Up @@ -797,12 +803,6 @@ const CHAINS: Chain[] = [
address: "0x1133eA7Af70876e64665ecD07C0A0476d09465a1",
fromBlock: 41940805,
},
// Gitcoin Attestation Network
{
contractName: "GitcoinAttestationNetwork/GitcoinGrantsResolver",
address: "0x0",
fromBlock: 0,
},
],
},
{
Expand Down
17 changes: 13 additions & 4 deletions src/database/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,17 @@ export async function migrate<T>(db: Kysely<T>, schemaName: string) {
.addColumn("amountInUSD", "real")
.addColumn("amountInRoundMatchToken", BIGINT_TYPE)

.addColumn("attestationTxnId", "integer")

.addPrimaryKeyConstraint("donations_pkey", ["id"])

.addForeignKeyConstraint(
"donations_attestation_txns_fkey",
["attestationTxnId"],
"attestation_txns",
["id"],
(cb) => cb.onDelete("set null")
)
.execute();

await schema
Expand All @@ -299,6 +308,7 @@ export async function migrate<T>(db: Kysely<T>, schemaName: string) {

await schema
.createTable("attestations")
.addColumn("id", "serial", (col) => col.primaryKey())
.addColumn("uid", "text")
.addColumn("chainId", CHAIN_ID_TYPE)
.addColumn("fee", BIGINT_TYPE)
Expand All @@ -310,20 +320,19 @@ export async function migrate<T>(db: Kysely<T>, schemaName: string) {
.addColumn("timestamp", "timestamptz")
.addColumn("metadataCid", "text")
.addColumn("metadata", "jsonb")
.addPrimaryKeyConstraint("gitcoin_attestations_pkey", ["uid", "chainId"])
.addUniqueConstraint("gitcoin_attestations_pkey", ["uid", "chainId"])
.execute();

// Should we link donation to attesation tx?

await schema
.createTable("attestation_txns")
.addColumn("id", "serial", (col) => col.primaryKey())
.addColumn("txnHash", "text")
.addColumn("chainId", CHAIN_ID_TYPE)

.addColumn("attestationUid", "text")
.addColumn("attestationChainId", CHAIN_ID_TYPE)

.addPrimaryKeyConstraint("attestation_txns_pkey", ["txnHash", "chainId"])
.addUniqueConstraint("attestation_txns_pkey", ["txnHash", "chainId"])

.addForeignKeyConstraint(
"attestation_txns_attestations_fkey",
Expand Down

0 comments on commit 2b3d445

Please sign in to comment.