diff --git a/indexer/packages/postgres/src/db/migrations/migration_files/20240926133526_create_oracle_prices_market_id_effective_at_height_index.ts b/indexer/packages/postgres/src/db/migrations/migration_files/20240926133526_create_oracle_prices_market_id_effective_at_height_index.ts new file mode 100644 index 0000000000..8f80339ebf --- /dev/null +++ b/indexer/packages/postgres/src/db/migrations/migration_files/20240926133526_create_oracle_prices_market_id_effective_at_height_index.ts @@ -0,0 +1,17 @@ +import * as Knex from 'knex'; + +export async function up(knex: Knex): Promise { + await knex.raw(` + CREATE INDEX CONCURRENTLY IF NOT EXISTS "oracle_prices_marketid_effectiveatheight_index" ON "oracle_prices" ("marketId", "effectiveAtHeight"); + `); +} + +export async function down(knex: Knex): Promise { + await knex.raw(` + DROP INDEX CONCURRENTLY IF EXISTS "oracle_prices_marketid_effectiveatheight_index"; + `); +} + +export const config = { + transaction: false, +};