@takaro/db 0.1.5 → 0.2.1

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.
@@ -0,0 +1,4 @@
1
+ import { Knex } from 'knex';
2
+ export declare function up(knex: Knex): Promise<void>;
3
+ export declare function down(knex: Knex): Promise<void>;
4
+ //# sourceMappingURL=20250703175326-add-ip-to-player-on-gameserver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20250703175326-add-ip-to-player-on-gameserver.d.ts","sourceRoot":"","sources":["../../../src/migrations/sql/20250703175326-add-ip-to-player-on-gameserver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,wBAAsB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlD;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAIpD"}
@@ -0,0 +1,11 @@
1
+ export async function up(knex) {
2
+ await knex.schema.alterTable('playerOnGameServer', (table) => {
3
+ table.string('ip').nullable();
4
+ });
5
+ }
6
+ export async function down(knex) {
7
+ await knex.schema.alterTable('playerOnGameServer', (table) => {
8
+ table.dropColumn('ip');
9
+ });
10
+ }
11
+ //# sourceMappingURL=20250703175326-add-ip-to-player-on-gameserver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20250703175326-add-ip-to-player-on-gameserver.js","sourceRoot":"","sources":["../../../src/migrations/sql/20250703175326-add-ip-to-player-on-gameserver.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC,IAAU;IACjC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;QAC3D,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAU;IACnC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE;QAC3D,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Knex } from 'knex';
2
+ export declare function up(knex: Knex): Promise<void>;
3
+ export declare function down(knex: Knex): Promise<void>;
4
+ //# sourceMappingURL=20250707205720-items-permissions-missing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20250707205720-items-permissions-missing.d.ts","sourceRoot":"","sources":["../../../src/migrations/sql/20250707205720-items-permissions-missing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,wBAAsB,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAalD;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpD"}
@@ -0,0 +1,18 @@
1
+ export async function up(knex) {
2
+ await knex('permission').insert([
3
+ {
4
+ permission: 'READ_ITEMS',
5
+ description: 'Can view item details',
6
+ friendlyName: 'Read Items',
7
+ },
8
+ {
9
+ permission: 'MANAGE_ITEMS',
10
+ description: 'Can create, update, and delete items',
11
+ friendlyName: 'Manage Items',
12
+ },
13
+ ]);
14
+ }
15
+ export async function down(knex) {
16
+ await knex('permission').whereIn('permission', ['READ_ITEMS', 'MANAGE_ITEMS']).del();
17
+ }
18
+ //# sourceMappingURL=20250707205720-items-permissions-missing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"20250707205720-items-permissions-missing.js","sourceRoot":"","sources":["../../../src/migrations/sql/20250707205720-items-permissions-missing.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC,IAAU;IACjC,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC;QAC9B;YACE,UAAU,EAAE,YAAY;YACxB,WAAW,EAAE,uBAAuB;YACpC,YAAY,EAAE,YAAY;SAC3B;QACD;YACE,UAAU,EAAE,cAAc;YAC1B,WAAW,EAAE,sCAAsC;YACnD,YAAY,EAAE,cAAc;SAC7B;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,IAAU;IACnC,MAAM,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;AACvF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takaro/db",
3
- "version": "0.1.5",
3
+ "version": "0.2.1",
4
4
  "description": "An opinionated data layer",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -0,0 +1,13 @@
1
+ import { Knex } from 'knex';
2
+
3
+ export async function up(knex: Knex): Promise<void> {
4
+ await knex.schema.alterTable('playerOnGameServer', (table) => {
5
+ table.string('ip').nullable();
6
+ });
7
+ }
8
+
9
+ export async function down(knex: Knex): Promise<void> {
10
+ await knex.schema.alterTable('playerOnGameServer', (table) => {
11
+ table.dropColumn('ip');
12
+ });
13
+ }
@@ -0,0 +1,20 @@
1
+ import { Knex } from 'knex';
2
+
3
+ export async function up(knex: Knex): Promise<void> {
4
+ await knex('permission').insert([
5
+ {
6
+ permission: 'READ_ITEMS',
7
+ description: 'Can view item details',
8
+ friendlyName: 'Read Items',
9
+ },
10
+ {
11
+ permission: 'MANAGE_ITEMS',
12
+ description: 'Can create, update, and delete items',
13
+ friendlyName: 'Manage Items',
14
+ },
15
+ ]);
16
+ }
17
+
18
+ export async function down(knex: Knex): Promise<void> {
19
+ await knex('permission').whereIn('permission', ['READ_ITEMS', 'MANAGE_ITEMS']).del();
20
+ }