Skip to content

Commit f9fe50a

Browse files
remove index (#625)
* update index to use md5 * fmt
1 parent adeeb36 commit f9fe50a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type CoingeckoSupportedChainId =
2020
| 42220
2121
| 1088;
2222

23-
const CHAIN_DATA_VERSION = "71";
23+
const CHAIN_DATA_VERSION = "75";
2424

2525
export type Token = {
2626
code: string;

src/database/migrate.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export async function migrate<T>(db: Kysely<T>, schemaName: string) {
3737
.addPrimaryKeyConstraint("projects_pkey", ["id", "chainId"])
3838
.execute();
3939

40-
await schema
41-
.createIndex("idx_projects_metadata_not_null")
40+
await db.schema
41+
.createIndex("idx_projects_metadata_hash")
4242
.on("projects")
43-
.columns(["metadata"])
43+
.expression(sql`md5(metadata::text)`)
4444
.where(sql.ref("metadata"), "is not", null)
4545
.execute();
4646

@@ -153,7 +153,7 @@ export async function migrate<T>(db: Kysely<T>, schemaName: string) {
153153
await schema
154154
.createIndex("idx_rounds_round_metadata_not_null")
155155
.on("rounds")
156-
.columns(["roundMetadata"])
156+
.expression(sql`md5(round_metadata::text)`)
157157
.where(sql.ref("round_metadata"), "is not", null)
158158
.execute();
159159

0 commit comments

Comments
 (0)