joist-migration-utils 2.4.0-next.4 → 2.4.0-next.41
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/build/index.d.cts +2 -2
- package/build/index.d.cts.map +1 -1
- package/build/index.d.mts +2 -2
- package/build/index.d.mts.map +1 -1
- package/build/migrate.d.cts +1 -2
- package/build/migrate.d.cts.map +1 -1
- package/build/migrate.d.mts +1 -2
- package/build/migrate.d.mts.map +1 -1
- package/build/utils.d.cts +23 -23
- package/build/utils.d.cts.map +1 -1
- package/build/utils.d.mts +23 -23
- package/build/utils.d.mts.map +1 -1
- package/package.json +5 -5
package/build/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { runMigrationsIfNeeded } from "./migrate.cjs";
|
|
2
2
|
import { FieldNameOverrides, RenameRelationOpts, addColumns, addEnumValue, commentData, createCreatedAtFunction, createEntityTable, createEnumTable, createManyToManyTable, createSubTable, createTriggers, createUnnestArraysFunction, createUpdatedAtFunction, enumArrayColumn, fail, foreignKey, renameRelation, unnest_arrays, updateEnumValue } from "./utils.cjs";
|
|
3
3
|
//#region src/index.d.ts
|
|
4
|
-
declare function joistMigrate(): Promise<void>;
|
|
4
|
+
export declare function joistMigrate(): Promise<void>;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { FieldNameOverrides, RenameRelationOpts, addColumns, addEnumValue, commentData, createCreatedAtFunction, createEntityTable, createEnumTable, createManyToManyTable, createSubTable, createTriggers, createUnnestArraysFunction, createUpdatedAtFunction, enumArrayColumn, fail, foreignKey,
|
|
6
|
+
export { FieldNameOverrides, RenameRelationOpts, addColumns, addEnumValue, commentData, createCreatedAtFunction, createEntityTable, createEnumTable, createManyToManyTable, createSubTable, createTriggers, createUnnestArraysFunction, createUpdatedAtFunction, enumArrayColumn, fail, foreignKey, renameRelation, runMigrationsIfNeeded, unnest_arrays, updateEnumValue };
|
|
7
7
|
//# sourceMappingURL=index.d.cts.map
|
package/build/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;wBAQsB,gBAAgB"}
|
package/build/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { runMigrationsIfNeeded } from "./migrate.mjs";
|
|
2
2
|
import { FieldNameOverrides, RenameRelationOpts, addColumns, addEnumValue, commentData, createCreatedAtFunction, createEntityTable, createEnumTable, createManyToManyTable, createSubTable, createTriggers, createUnnestArraysFunction, createUpdatedAtFunction, enumArrayColumn, fail, foreignKey, renameRelation, unnest_arrays, updateEnumValue } from "./utils.mjs";
|
|
3
3
|
//#region src/index.d.ts
|
|
4
|
-
declare function joistMigrate(): Promise<void>;
|
|
4
|
+
export declare function joistMigrate(): Promise<void>;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { FieldNameOverrides, RenameRelationOpts, addColumns, addEnumValue, commentData, createCreatedAtFunction, createEntityTable, createEnumTable, createManyToManyTable, createSubTable, createTriggers, createUnnestArraysFunction, createUpdatedAtFunction, enumArrayColumn, fail, foreignKey,
|
|
6
|
+
export { FieldNameOverrides, RenameRelationOpts, addColumns, addEnumValue, commentData, createCreatedAtFunction, createEntityTable, createEnumTable, createManyToManyTable, createSubTable, createTriggers, createUnnestArraysFunction, createUpdatedAtFunction, enumArrayColumn, fail, foreignKey, renameRelation, runMigrationsIfNeeded, unnest_arrays, updateEnumValue };
|
|
7
7
|
//# sourceMappingURL=index.d.mts.map
|
package/build/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;wBAQsB,gBAAgB"}
|
package/build/migrate.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Client } from "pg";
|
|
2
2
|
//#region src/migrate.d.ts
|
|
3
|
-
declare function runMigrationsIfNeeded(client: Client, dir?: string): Promise<void>;
|
|
3
|
+
export declare function runMigrationsIfNeeded(client: Client, dir?: string): Promise<void>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { runMigrationsIfNeeded };
|
|
6
5
|
//# sourceMappingURL=migrate.d.cts.map
|
package/build/migrate.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.cts","names":[],"sources":["../src/migrate.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"migrate.d.cts","names":[],"sources":["../src/migrate.ts"],"mappings":";;wBAKsB,sBAAsB,QAAQ,QAAQ,eAAoC"}
|
package/build/migrate.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Client } from "pg";
|
|
2
2
|
//#region src/migrate.d.ts
|
|
3
|
-
declare function runMigrationsIfNeeded(client: Client, dir?: string): Promise<void>;
|
|
3
|
+
export declare function runMigrationsIfNeeded(client: Client, dir?: string): Promise<void>;
|
|
4
4
|
//#endregion
|
|
5
|
-
export { runMigrationsIfNeeded };
|
|
6
5
|
//# sourceMappingURL=migrate.d.mts.map
|
package/build/migrate.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.mts","names":[],"sources":["../src/migrate.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"migrate.d.mts","names":[],"sources":["../src/migrate.ts"],"mappings":";;wBAKsB,sBAAsB,QAAQ,QAAQ,eAAoC"}
|
package/build/utils.d.cts
CHANGED
|
@@ -6,20 +6,20 @@ import { ColumnDefinition, ColumnDefinitions, DropOptions, MigrationBuilder, Tab
|
|
|
6
6
|
* Specifically an `id` auto-increment column (via a sequence) and `created_at` and `updated_at`
|
|
7
7
|
* columns.
|
|
8
8
|
*/
|
|
9
|
-
declare function createEntityTable(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
9
|
+
export declare function createEntityTable(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
10
10
|
/**
|
|
11
11
|
* Creates a subtype table using class-per-table inheritance.
|
|
12
12
|
*
|
|
13
13
|
* The subtable will use the base table's id as its identity, and when loading rows of the base
|
|
14
14
|
* type, Joist will automatically stitch together rows across each table into a single instance.
|
|
15
15
|
*/
|
|
16
|
-
declare function createSubTable(b: MigrationBuilder, baseTableName: string, subTableName: string, columns: ColumnDefinitions): void;
|
|
17
|
-
declare function createEnumTable(b: MigrationBuilder, tableName: string, values: Array<[string, string]>): void;
|
|
18
|
-
declare function addEnumValue(b: MigrationBuilder, tableName: string, value: [string, string]): void;
|
|
19
|
-
declare function updateEnumValue(b: MigrationBuilder, tableName: string, previousCode: string, value: [string, string]): void;
|
|
16
|
+
export declare function createSubTable(b: MigrationBuilder, baseTableName: string, subTableName: string, columns: ColumnDefinitions): void;
|
|
17
|
+
export declare function createEnumTable(b: MigrationBuilder, tableName: string, values: Array<[string, string]>): void;
|
|
18
|
+
export declare function addEnumValue(b: MigrationBuilder, tableName: string, value: [string, string]): void;
|
|
19
|
+
export declare function updateEnumValue(b: MigrationBuilder, tableName: string, previousCode: string, value: [string, string]): void;
|
|
20
20
|
/** Makes a trigger to update the `updated_at` column. */
|
|
21
|
-
declare function createTriggers(b: MigrationBuilder, tableName: string): void;
|
|
22
|
-
declare function createUpdatedAtFunction(b: MigrationBuilder): void;
|
|
21
|
+
export declare function createTriggers(b: MigrationBuilder, tableName: string): void;
|
|
22
|
+
export declare function createUpdatedAtFunction(b: MigrationBuilder): void;
|
|
23
23
|
/**
|
|
24
24
|
* Unnests a 2d array like `[[a, b], [c, d]]` into two rows of `[a, b]` and `[c, d]`.
|
|
25
25
|
*
|
|
@@ -47,19 +47,19 @@ declare function createUpdatedAtFunction(b: MigrationBuilder): void;
|
|
|
47
47
|
* array column is null or not, and then conditionally enabling this with the `nullable=true`
|
|
48
48
|
* param to `unnest_arrays`.
|
|
49
49
|
*/
|
|
50
|
-
declare const unnest_arrays = "\nCREATE OR REPLACE FUNCTION unnest_arrays(arr ANYARRAY, nullable BOOLEAN = false, OUT a ANYARRAY)\n RETURNS SETOF ANYARRAY\n LANGUAGE plpgsql IMMUTABLE STRICT AS\n$func$\nBEGIN\n FOREACH a SLICE 1 IN ARRAY arr LOOP\n IF nullable THEN\n IF a[1] IS NULL THEN a := NULL;\n ELSE a := a[2:array_length(a, 1)];\n END IF;\n END IF;\n a := array_remove(a, NULL);\n RETURN NEXT;\n END LOOP;\nEND\n$func$;\n";
|
|
51
|
-
declare function createUnnestArraysFunction(b: MigrationBuilder): void;
|
|
52
|
-
declare function createCreatedAtFunction(b: MigrationBuilder): void;
|
|
53
|
-
type FieldNameOverrides = {
|
|
50
|
+
export declare const unnest_arrays = "\nCREATE OR REPLACE FUNCTION unnest_arrays(arr ANYARRAY, nullable BOOLEAN = false, OUT a ANYARRAY)\n RETURNS SETOF ANYARRAY\n LANGUAGE plpgsql IMMUTABLE STRICT AS\n$func$\nBEGIN\n FOREACH a SLICE 1 IN ARRAY arr LOOP\n IF nullable THEN\n IF a[1] IS NULL THEN a := NULL;\n ELSE a := a[2:array_length(a, 1)];\n END IF;\n END IF;\n a := array_remove(a, NULL);\n RETURN NEXT;\n END LOOP;\nEND\n$func$;\n";
|
|
51
|
+
export declare function createUnnestArraysFunction(b: MigrationBuilder): void;
|
|
52
|
+
export declare function createCreatedAtFunction(b: MigrationBuilder): void;
|
|
53
|
+
export type FieldNameOverrides = {
|
|
54
54
|
fieldName?: string;
|
|
55
55
|
otherFieldName?: string;
|
|
56
56
|
};
|
|
57
57
|
type ForeignKeyOpts = Partial<ColumnDefinition> & Required<Pick<ColumnDefinition, "notNull">> & FieldNameOverrides;
|
|
58
|
-
declare function foreignKey(otherTable: string, opts: ForeignKeyOpts): ColumnDefinition;
|
|
59
|
-
type RenameRelationOpts = FieldNameOverrides & Pick<ColumnDefinition, "comment">;
|
|
60
|
-
declare function renameRelation(b: MigrationBuilder, tableName: string, columnName: string, opts: RenameRelationOpts): void;
|
|
61
|
-
declare function commentData(data: any, comment?: string | null): string;
|
|
62
|
-
declare function enumArrayColumn(enumTable: string, opts?: Pick<ColumnDefinition, "notNull">): ColumnDefinition;
|
|
58
|
+
export declare function foreignKey(otherTable: string, opts: ForeignKeyOpts): ColumnDefinition;
|
|
59
|
+
export type RenameRelationOpts = FieldNameOverrides & Pick<ColumnDefinition, "comment">;
|
|
60
|
+
export declare function renameRelation(b: MigrationBuilder, tableName: string, columnName: string, opts: RenameRelationOpts): void;
|
|
61
|
+
export declare function commentData(data: any, comment?: string | null): string;
|
|
62
|
+
export declare function enumArrayColumn(enumTable: string, opts?: Pick<ColumnDefinition, "notNull">): ColumnDefinition;
|
|
63
63
|
type ManyToManyColumn = {
|
|
64
64
|
/** The target table for this m2m table, i.e. for a `books_to_tags`, this might be `books`. */
|
|
65
65
|
table: string;
|
|
@@ -85,13 +85,13 @@ type ManyToManyColumn = {
|
|
|
85
85
|
collectionName?: string;
|
|
86
86
|
};
|
|
87
87
|
/** Creates a many-to-many table between `table1` and `table2` with our conventions. */
|
|
88
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, table2: string, options?: TableOptions & DropOptions): void;
|
|
89
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
90
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
91
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, table2: string, options?: TableOptions & DropOptions): void;
|
|
88
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, table2: string, options?: TableOptions & DropOptions): void;
|
|
89
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
90
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
91
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, table2: string, options?: TableOptions & DropOptions): void;
|
|
92
92
|
/** Adds columns + auto-indexes any foreign keys. */
|
|
93
|
-
declare function addColumns(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
94
|
-
declare function fail(message?: string): never;
|
|
93
|
+
export declare function addColumns(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
94
|
+
export declare function fail(message?: string): never;
|
|
95
95
|
//#endregion
|
|
96
|
-
export {
|
|
96
|
+
export {};
|
|
97
97
|
//# sourceMappingURL=utils.d.cts.map
|
package/build/utils.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.cts","names":[],"sources":["../src/utils.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"utils.d.cts","names":[],"sources":["../src/utils.ts"],"mappings":";;;;;;;;wBAkBgB,kBAAkB,GAAG,kBAAkB,mBAAmB,SAAS;;;;;;;wBAyBnE,eACd,GAAG,kBACH,uBACA,sBACA,SAAS;wBAsBK,gBAAgB,GAAG,kBAAkB,mBAAmB,QAAQ;wBAShE,aAAa,GAAG,kBAAkB,mBAAmB;wBAMrD,gBACd,GAAG,kBACH,mBACA,sBACA;;wBAcc,eAAe,GAAG,kBAAkB;wBAepC,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoC9B;wBAmBG,2BAA2B,GAAG;wBAI9B,wBAAwB,GAAG;YAS/B;EACV;EACA;;KAEG,iBAAiB,QAAQ,oBAAoB,SAAS,KAAK,gCAAgC;wBAChF,WAAW,oBAAoB,MAAM,iBAAiB;YAU1D,qBAAqB,qBAAqB,KAAK;wBAC3C,eAAe,GAAG,kBAAkB,mBAAmB,oBAAoB,MAAM;wBAIjF,YAAY,WAAW;wBAkBvB,gBAAgB,mBAAmB,OAAO,KAAK,+BAA+B;KAazF;;EAEH;;EAEA;;;;;;;;;;;;;;;;;;EAkBA;;;wBAac,sBACd,GAAG,kBACH,mBACA,gBACA,gBACA,UAAU,eAAe;wBAEX,sBACd,GAAG,kBACH,mBACA,SAAS,kBACT,SAAS,kBACT,UAAU,eAAe;wBAEX,sBACd,GAAG,kBACH,mBACA,gBACA,SAAS,kBACT,UAAU,eAAe;wBAEX,sBACd,GAAG,kBACH,mBACA,SAAS,kBACT,gBACA,UAAU,eAAe;;wBA0BX,WAAW,GAAG,kBAAkB,mBAAmB,SAAS;wBAS5D,KAAK"}
|
package/build/utils.d.mts
CHANGED
|
@@ -6,20 +6,20 @@ import { ColumnDefinition, ColumnDefinitions, DropOptions, MigrationBuilder, Tab
|
|
|
6
6
|
* Specifically an `id` auto-increment column (via a sequence) and `created_at` and `updated_at`
|
|
7
7
|
* columns.
|
|
8
8
|
*/
|
|
9
|
-
declare function createEntityTable(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
9
|
+
export declare function createEntityTable(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
10
10
|
/**
|
|
11
11
|
* Creates a subtype table using class-per-table inheritance.
|
|
12
12
|
*
|
|
13
13
|
* The subtable will use the base table's id as its identity, and when loading rows of the base
|
|
14
14
|
* type, Joist will automatically stitch together rows across each table into a single instance.
|
|
15
15
|
*/
|
|
16
|
-
declare function createSubTable(b: MigrationBuilder, baseTableName: string, subTableName: string, columns: ColumnDefinitions): void;
|
|
17
|
-
declare function createEnumTable(b: MigrationBuilder, tableName: string, values: Array<[string, string]>): void;
|
|
18
|
-
declare function addEnumValue(b: MigrationBuilder, tableName: string, value: [string, string]): void;
|
|
19
|
-
declare function updateEnumValue(b: MigrationBuilder, tableName: string, previousCode: string, value: [string, string]): void;
|
|
16
|
+
export declare function createSubTable(b: MigrationBuilder, baseTableName: string, subTableName: string, columns: ColumnDefinitions): void;
|
|
17
|
+
export declare function createEnumTable(b: MigrationBuilder, tableName: string, values: Array<[string, string]>): void;
|
|
18
|
+
export declare function addEnumValue(b: MigrationBuilder, tableName: string, value: [string, string]): void;
|
|
19
|
+
export declare function updateEnumValue(b: MigrationBuilder, tableName: string, previousCode: string, value: [string, string]): void;
|
|
20
20
|
/** Makes a trigger to update the `updated_at` column. */
|
|
21
|
-
declare function createTriggers(b: MigrationBuilder, tableName: string): void;
|
|
22
|
-
declare function createUpdatedAtFunction(b: MigrationBuilder): void;
|
|
21
|
+
export declare function createTriggers(b: MigrationBuilder, tableName: string): void;
|
|
22
|
+
export declare function createUpdatedAtFunction(b: MigrationBuilder): void;
|
|
23
23
|
/**
|
|
24
24
|
* Unnests a 2d array like `[[a, b], [c, d]]` into two rows of `[a, b]` and `[c, d]`.
|
|
25
25
|
*
|
|
@@ -47,19 +47,19 @@ declare function createUpdatedAtFunction(b: MigrationBuilder): void;
|
|
|
47
47
|
* array column is null or not, and then conditionally enabling this with the `nullable=true`
|
|
48
48
|
* param to `unnest_arrays`.
|
|
49
49
|
*/
|
|
50
|
-
declare const unnest_arrays = "\nCREATE OR REPLACE FUNCTION unnest_arrays(arr ANYARRAY, nullable BOOLEAN = false, OUT a ANYARRAY)\n RETURNS SETOF ANYARRAY\n LANGUAGE plpgsql IMMUTABLE STRICT AS\n$func$\nBEGIN\n FOREACH a SLICE 1 IN ARRAY arr LOOP\n IF nullable THEN\n IF a[1] IS NULL THEN a := NULL;\n ELSE a := a[2:array_length(a, 1)];\n END IF;\n END IF;\n a := array_remove(a, NULL);\n RETURN NEXT;\n END LOOP;\nEND\n$func$;\n";
|
|
51
|
-
declare function createUnnestArraysFunction(b: MigrationBuilder): void;
|
|
52
|
-
declare function createCreatedAtFunction(b: MigrationBuilder): void;
|
|
53
|
-
type FieldNameOverrides = {
|
|
50
|
+
export declare const unnest_arrays = "\nCREATE OR REPLACE FUNCTION unnest_arrays(arr ANYARRAY, nullable BOOLEAN = false, OUT a ANYARRAY)\n RETURNS SETOF ANYARRAY\n LANGUAGE plpgsql IMMUTABLE STRICT AS\n$func$\nBEGIN\n FOREACH a SLICE 1 IN ARRAY arr LOOP\n IF nullable THEN\n IF a[1] IS NULL THEN a := NULL;\n ELSE a := a[2:array_length(a, 1)];\n END IF;\n END IF;\n a := array_remove(a, NULL);\n RETURN NEXT;\n END LOOP;\nEND\n$func$;\n";
|
|
51
|
+
export declare function createUnnestArraysFunction(b: MigrationBuilder): void;
|
|
52
|
+
export declare function createCreatedAtFunction(b: MigrationBuilder): void;
|
|
53
|
+
export type FieldNameOverrides = {
|
|
54
54
|
fieldName?: string;
|
|
55
55
|
otherFieldName?: string;
|
|
56
56
|
};
|
|
57
57
|
type ForeignKeyOpts = Partial<ColumnDefinition> & Required<Pick<ColumnDefinition, "notNull">> & FieldNameOverrides;
|
|
58
|
-
declare function foreignKey(otherTable: string, opts: ForeignKeyOpts): ColumnDefinition;
|
|
59
|
-
type RenameRelationOpts = FieldNameOverrides & Pick<ColumnDefinition, "comment">;
|
|
60
|
-
declare function renameRelation(b: MigrationBuilder, tableName: string, columnName: string, opts: RenameRelationOpts): void;
|
|
61
|
-
declare function commentData(data: any, comment?: string | null): string;
|
|
62
|
-
declare function enumArrayColumn(enumTable: string, opts?: Pick<ColumnDefinition, "notNull">): ColumnDefinition;
|
|
58
|
+
export declare function foreignKey(otherTable: string, opts: ForeignKeyOpts): ColumnDefinition;
|
|
59
|
+
export type RenameRelationOpts = FieldNameOverrides & Pick<ColumnDefinition, "comment">;
|
|
60
|
+
export declare function renameRelation(b: MigrationBuilder, tableName: string, columnName: string, opts: RenameRelationOpts): void;
|
|
61
|
+
export declare function commentData(data: any, comment?: string | null): string;
|
|
62
|
+
export declare function enumArrayColumn(enumTable: string, opts?: Pick<ColumnDefinition, "notNull">): ColumnDefinition;
|
|
63
63
|
type ManyToManyColumn = {
|
|
64
64
|
/** The target table for this m2m table, i.e. for a `books_to_tags`, this might be `books`. */
|
|
65
65
|
table: string;
|
|
@@ -85,13 +85,13 @@ type ManyToManyColumn = {
|
|
|
85
85
|
collectionName?: string;
|
|
86
86
|
};
|
|
87
87
|
/** Creates a many-to-many table between `table1` and `table2` with our conventions. */
|
|
88
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, table2: string, options?: TableOptions & DropOptions): void;
|
|
89
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
90
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
91
|
-
declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, table2: string, options?: TableOptions & DropOptions): void;
|
|
88
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, table2: string, options?: TableOptions & DropOptions): void;
|
|
89
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
90
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, table1: string, column2: ManyToManyColumn, options?: TableOptions & DropOptions): void;
|
|
91
|
+
export declare function createManyToManyTable(b: MigrationBuilder, tableName: string, column1: ManyToManyColumn, table2: string, options?: TableOptions & DropOptions): void;
|
|
92
92
|
/** Adds columns + auto-indexes any foreign keys. */
|
|
93
|
-
declare function addColumns(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
94
|
-
declare function fail(message?: string): never;
|
|
93
|
+
export declare function addColumns(b: MigrationBuilder, tableName: string, columns: ColumnDefinitions): void;
|
|
94
|
+
export declare function fail(message?: string): never;
|
|
95
95
|
//#endregion
|
|
96
|
-
export {
|
|
96
|
+
export {};
|
|
97
97
|
//# sourceMappingURL=utils.d.mts.map
|
package/build/utils.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"utils.d.mts","names":[],"sources":["../src/utils.ts"],"mappings":";;;;;;;;wBAkBgB,kBAAkB,GAAG,kBAAkB,mBAAmB,SAAS;;;;;;;wBAyBnE,eACd,GAAG,kBACH,uBACA,sBACA,SAAS;wBAsBK,gBAAgB,GAAG,kBAAkB,mBAAmB,QAAQ;wBAShE,aAAa,GAAG,kBAAkB,mBAAmB;wBAMrD,gBACd,GAAG,kBACH,mBACA,sBACA;;wBAcc,eAAe,GAAG,kBAAkB;wBAepC,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoC9B;wBAmBG,2BAA2B,GAAG;wBAI9B,wBAAwB,GAAG;YAS/B;EACV;EACA;;KAEG,iBAAiB,QAAQ,oBAAoB,SAAS,KAAK,gCAAgC;wBAChF,WAAW,oBAAoB,MAAM,iBAAiB;YAU1D,qBAAqB,qBAAqB,KAAK;wBAC3C,eAAe,GAAG,kBAAkB,mBAAmB,oBAAoB,MAAM;wBAIjF,YAAY,WAAW;wBAkBvB,gBAAgB,mBAAmB,OAAO,KAAK,+BAA+B;KAazF;;EAEH;;EAEA;;;;;;;;;;;;;;;;;;EAkBA;;;wBAac,sBACd,GAAG,kBACH,mBACA,gBACA,gBACA,UAAU,eAAe;wBAEX,sBACd,GAAG,kBACH,mBACA,SAAS,kBACT,SAAS,kBACT,UAAU,eAAe;wBAEX,sBACd,GAAG,kBACH,mBACA,gBACA,SAAS,kBACT,UAAU,eAAe;wBAEX,sBACd,GAAG,kBACH,mBACA,SAAS,kBACT,gBACA,UAAU,eAAe;;wBA0BX,WAAW,GAAG,kBAAkB,mBAAmB,SAAS;wBAS5D,KAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "joist-migration-utils",
|
|
3
|
-
"version": "2.4.0-next.
|
|
3
|
+
"version": "2.4.0-next.41",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"build"
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"joist-utils": "2.4.0-next.
|
|
39
|
+
"joist-utils": "2.4.0-next.41",
|
|
40
40
|
"pg": "^8.23.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@types/pluralize": "^0.0.33",
|
|
44
|
-
"node-pg-migrate": "^
|
|
44
|
+
"node-pg-migrate": "^9.0.0",
|
|
45
45
|
"pluralize": "^8.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@swc/core": "
|
|
48
|
+
"@swc/core": "1.16.18",
|
|
49
49
|
"@swc/jest": "^0.2.39",
|
|
50
50
|
"@types/jest": "^30.0.0",
|
|
51
|
-
"@types/node": "^26.
|
|
51
|
+
"@types/node": "^26.6.5",
|
|
52
52
|
"jest": "30.4.2",
|
|
53
53
|
"tsconfig-paths": "^4.2.0",
|
|
54
54
|
"typescript": "7.0.2"
|