@takaro/db 0.0.26 → 0.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/migrations/sql/20250519185149-add-item-indexes.d.ts +13 -0
- package/dist/migrations/sql/20250519185149-add-item-indexes.d.ts.map +1 -0
- package/dist/migrations/sql/20250519185149-add-item-indexes.js +40 -0
- package/dist/migrations/sql/20250519185149-add-item-indexes.js.map +1 -0
- package/package.json +1 -1
- package/src/migrations/sql/20250519185149-add-item-indexes.ts +42 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Knex } from 'knex';
|
|
2
|
+
/**
|
|
3
|
+
* These indexes singificantly improve performance of the gameserver delete operation
|
|
4
|
+
* CREATE INDEX idx_itemonshoplisting_itemid ON "itemOnShopListing" ("itemId");
|
|
5
|
+
* CREATE INDEX idx_playerinventory_itemid ON "playerInventory" ("itemId");
|
|
6
|
+
* CREATE INDEX idx_playeriphistory_gameserverid ON "playerIpHistory" ("gameServerId");
|
|
7
|
+
* CREATE INDEX idx_shoplisting_gameserverid ON "shopListing" ("gameServerId");
|
|
8
|
+
*
|
|
9
|
+
* @param knex
|
|
10
|
+
*/
|
|
11
|
+
export declare function up(knex: Knex): Promise<void>;
|
|
12
|
+
export declare function down(knex: Knex): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=20250519185149-add-item-indexes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20250519185149-add-item-indexes.d.ts","sourceRoot":"","sources":["../../../src/migrations/sql/20250519185149-add-item-indexes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;;;;;GAQG;AACH,wBAAsB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAclD;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAcpD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These indexes singificantly improve performance of the gameserver delete operation
|
|
3
|
+
* CREATE INDEX idx_itemonshoplisting_itemid ON "itemOnShopListing" ("itemId");
|
|
4
|
+
* CREATE INDEX idx_playerinventory_itemid ON "playerInventory" ("itemId");
|
|
5
|
+
* CREATE INDEX idx_playeriphistory_gameserverid ON "playerIpHistory" ("gameServerId");
|
|
6
|
+
* CREATE INDEX idx_shoplisting_gameserverid ON "shopListing" ("gameServerId");
|
|
7
|
+
*
|
|
8
|
+
* @param knex
|
|
9
|
+
*/
|
|
10
|
+
export async function up(knex) {
|
|
11
|
+
await knex.schema
|
|
12
|
+
.alterTable('itemOnShopListing', (table) => {
|
|
13
|
+
table.index(['itemId'], 'idx_itemonshoplisting_itemid');
|
|
14
|
+
})
|
|
15
|
+
.alterTable('playerInventory', (table) => {
|
|
16
|
+
table.index(['itemId'], 'idx_playerinventory_itemid');
|
|
17
|
+
})
|
|
18
|
+
.alterTable('playerIpHistory', (table) => {
|
|
19
|
+
table.index(['gameServerId'], 'idx_playeriphistory_gameserverid');
|
|
20
|
+
})
|
|
21
|
+
.alterTable('shopListing', (table) => {
|
|
22
|
+
table.index(['gameServerId'], 'idx_shoplisting_gameserverid');
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export async function down(knex) {
|
|
26
|
+
await knex.schema
|
|
27
|
+
.alterTable('itemOnShopListing', (table) => {
|
|
28
|
+
table.dropIndex([], 'idx_itemonshoplisting_itemid');
|
|
29
|
+
})
|
|
30
|
+
.alterTable('playerInventory', (table) => {
|
|
31
|
+
table.dropIndex([], 'idx_playerinventory_itemid');
|
|
32
|
+
})
|
|
33
|
+
.alterTable('playerIpHistory', (table) => {
|
|
34
|
+
table.dropIndex([], 'idx_playeriphistory_gameserverid');
|
|
35
|
+
})
|
|
36
|
+
.alterTable('shopListing', (table) => {
|
|
37
|
+
table.dropIndex([], 'idx_shoplisting_gameserverid');
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=20250519185149-add-item-indexes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20250519185149-add-item-indexes.js","sourceRoot":"","sources":["../../../src/migrations/sql/20250519185149-add-item-indexes.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC,IAAU;IACjC,MAAM,IAAI,CAAC,MAAM;SACd,UAAU,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;QACzC,KAAK,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,8BAA8B,CAAC,CAAC;IAC1D,CAAC,CAAC;SACD,UAAU,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,4BAA4B,CAAC,CAAC;IACxD,CAAC,CAAC;SACD,UAAU,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,KAAK,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,EAAE,kCAAkC,CAAC,CAAC;IACpE,CAAC,CAAC;SACD,UAAU,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;QACnC,KAAK,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,EAAE,8BAA8B,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAU;IACnC,MAAM,IAAI,CAAC,MAAM;SACd,UAAU,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE;QACzC,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,8BAA8B,CAAC,CAAC;IACtD,CAAC,CAAC;SACD,UAAU,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,4BAA4B,CAAC,CAAC;IACpD,CAAC,CAAC;SACD,UAAU,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE;QACvC,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,kCAAkC,CAAC,CAAC;IAC1D,CAAC,CAAC;SACD,UAAU,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;QACnC,KAAK,CAAC,SAAS,CAAC,EAAE,EAAE,8BAA8B,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Knex } from 'knex';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* These indexes singificantly improve performance of the gameserver delete operation
|
|
5
|
+
* CREATE INDEX idx_itemonshoplisting_itemid ON "itemOnShopListing" ("itemId");
|
|
6
|
+
* CREATE INDEX idx_playerinventory_itemid ON "playerInventory" ("itemId");
|
|
7
|
+
* CREATE INDEX idx_playeriphistory_gameserverid ON "playerIpHistory" ("gameServerId");
|
|
8
|
+
* CREATE INDEX idx_shoplisting_gameserverid ON "shopListing" ("gameServerId");
|
|
9
|
+
*
|
|
10
|
+
* @param knex
|
|
11
|
+
*/
|
|
12
|
+
export async function up(knex: Knex): Promise<void> {
|
|
13
|
+
await knex.schema
|
|
14
|
+
.alterTable('itemOnShopListing', (table) => {
|
|
15
|
+
table.index(['itemId'], 'idx_itemonshoplisting_itemid');
|
|
16
|
+
})
|
|
17
|
+
.alterTable('playerInventory', (table) => {
|
|
18
|
+
table.index(['itemId'], 'idx_playerinventory_itemid');
|
|
19
|
+
})
|
|
20
|
+
.alterTable('playerIpHistory', (table) => {
|
|
21
|
+
table.index(['gameServerId'], 'idx_playeriphistory_gameserverid');
|
|
22
|
+
})
|
|
23
|
+
.alterTable('shopListing', (table) => {
|
|
24
|
+
table.index(['gameServerId'], 'idx_shoplisting_gameserverid');
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function down(knex: Knex): Promise<void> {
|
|
29
|
+
await knex.schema
|
|
30
|
+
.alterTable('itemOnShopListing', (table) => {
|
|
31
|
+
table.dropIndex([], 'idx_itemonshoplisting_itemid');
|
|
32
|
+
})
|
|
33
|
+
.alterTable('playerInventory', (table) => {
|
|
34
|
+
table.dropIndex([], 'idx_playerinventory_itemid');
|
|
35
|
+
})
|
|
36
|
+
.alterTable('playerIpHistory', (table) => {
|
|
37
|
+
table.dropIndex([], 'idx_playeriphistory_gameserverid');
|
|
38
|
+
})
|
|
39
|
+
.alterTable('shopListing', (table) => {
|
|
40
|
+
table.dropIndex([], 'idx_shoplisting_gameserverid');
|
|
41
|
+
});
|
|
42
|
+
}
|