Skip to content

Commit

Permalink
Merge pull request #1751 from gettakaro/more-perf-indexes
Browse files Browse the repository at this point in the history
More performance increases
  • Loading branch information
niekcandaele authored Nov 1, 2024
2 parents db44f30 + 81c5fcf commit 62cc357
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Knex } from 'knex';

export async function up(knex: Knex): Promise<void> {
await knex.schema.alterTable('permissionOnRole', (table) => {
table.index(['roleId']);
});

await knex.schema.alterTable('playerOnGameServer', (table) => {
table.index(['domain', 'playerId']);
});

await knex.schema.alterTable('playerInventory', (table) => {
table.dropIndex(['playerId', 'domain']);
table.index(['playerId', 'domain', 'itemId']);
});
}

export async function down(knex: Knex): Promise<void> {
await knex.schema.alterTable('permissionOnRole', (table) => {
table.dropIndex(['roleId']);
});

await knex.schema.alterTable('playerOnGameServer', (table) => {
table.dropIndex(['domain', 'playerId']);
});

await knex.schema.alterTable('playerInventory', (table) => {
table.dropIndex(['playerId', 'domain', 'itemId']);
table.index(['playerId', 'domain']);
});
}

0 comments on commit 62cc357

Please sign in to comment.