-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'evm' of github.com:aura-nw/horoscope-v2 into feat/mater…
…ial-view-erc721-holder-statistic
- Loading branch information
Showing
27 changed files
with
396 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('validator', (table) => { | ||
table.index('tokens'); | ||
table.index('status'); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('validator', (table) => { | ||
table.dropIndex('tokens'); | ||
table.dropIndex('status'); | ||
}); | ||
} |
2 changes: 1 addition & 1 deletion
2
...0240327075001_evm_internal_transaction.ts → ...0240327075001_evm_internal_transaction.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.raw('SET statement_timeout TO 0'); | ||
await knex.schema.alterTable('evm_transaction', (table) => { | ||
table.dropIndex('tx_id'); | ||
table.dropIndex('tx_msg_id'); | ||
table.dropIndex('from'); | ||
table.dropIndex('to'); | ||
table.dropIndex('hash'); | ||
table.dropIndex('status'); | ||
table.dropIndex('contract_address'); | ||
}); | ||
await knex.raw(` | ||
alter table evm_transaction | ||
alter column "from" set data type bytea USING decode(substring("from",3), 'hex'), | ||
alter column "to" set data type bytea USING decode(substring("to",3), 'hex'), | ||
alter column "data" set data type bytea USING decode("data", 'hex'), | ||
alter column "hash" set data type bytea USING decode(substring("hash",3), 'hex'), | ||
alter column "contract_address" set data type bytea USING decode(substring("contract_address",3), 'hex')`); | ||
await knex.schema.alterTable('evm_transaction', (table) => { | ||
table.index('from', 'evm_transaction_from_index', 'hash'); | ||
table.index('to', 'evm_transaction_to_index', 'hash'); | ||
table.index( | ||
'contract_address', | ||
'evm_transaction_contract_address_index', | ||
'hash' | ||
); | ||
table.index('hash', 'evm_transaction_hash_index', 'hash'); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.raw('SET statement_timeout TO 0'); | ||
await knex.schema.alterTable('evm_transaction', (table) => { | ||
table.dropIndex('from'); | ||
table.dropIndex('to'); | ||
table.dropIndex('hash'); | ||
table.dropIndex('contract_address'); | ||
}); | ||
await knex.raw(` | ||
alter table evm_transaction | ||
alter column "from" set data type character varying(255), | ||
alter column "to" set data type character varying(255), | ||
alter column "hash" set data type character varying(255), | ||
alter column "data" set data type text, | ||
alter column "contract_address" set data type character varying(255)`); | ||
await knex.schema.alterTable('evm_transaction', (table) => { | ||
table.index('tx_id', 'evm_transaction_tx_id_index', 'btree'); | ||
table.index('tx_msg_id', 'evm_transaction_tx_msg_id_index', 'btree'); | ||
table.index('status', 'evm_transaction_status_index', 'btree'); | ||
table.index('from', 'evm_transaction_from_index', 'btree'); | ||
table.index('to', 'evm_transaction_to_index', 'btree'); | ||
table.index( | ||
'contract_address', | ||
'evm_transaction_contract_address_index', | ||
'btree' | ||
); | ||
table.index('hash', 'evm_transaction_hash_index', 'btree'); | ||
}); | ||
} |
13 changes: 13 additions & 0 deletions
13
migrations/evm/20240909092542_create_index_miner_in_evm_block.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('evm_block', (table) => { | ||
table.index('miner'); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('evm_block', (table) => { | ||
table.dropIndex('miner'); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.