-
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.
Refactor/cw20 index and relation ( staging ) (#320)
* refactor: cw20 index and add relation * refactor: code
- Loading branch information
1 parent
ed3740d
commit 5fe2bcd
Showing
3 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Knex } from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('cw20_activity', (table) => { | ||
table.index('from'); | ||
table.index('to'); | ||
table.index('action'); | ||
}); | ||
await knex.schema.alterTable('cw721_activity', (table) => { | ||
table.index('from'); | ||
table.index('to'); | ||
table.index('action'); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('cw20_activity', (table) => { | ||
table.dropIndex('from'); | ||
table.dropIndex('to'); | ||
table.dropIndex('action'); | ||
}); | ||
await knex.schema.alterTable('cw721_activity', (table) => { | ||
table.dropIndex('from'); | ||
table.dropIndex('to'); | ||
table.dropIndex('action'); | ||
}); | ||
} |
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