@sqb/migrator 4.19.6 → 4.20.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.
|
@@ -10,19 +10,16 @@ const migration_package_js_1 = require("../migration-package.js");
|
|
|
10
10
|
const types_js_1 = require("../types.js");
|
|
11
11
|
const pgAdapter = new postgres_1.PgAdapter();
|
|
12
12
|
class PgMigrationAdapter extends migration_adapter_js_1.MigrationAdapter {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.summaryTable = 'migration_summary';
|
|
24
|
-
this.eventTable = 'migration_events';
|
|
25
|
-
}
|
|
13
|
+
_infoSchema = 'public';
|
|
14
|
+
_version = 0;
|
|
15
|
+
_status = types_js_1.MigrationStatus.idle;
|
|
16
|
+
defaultVariables = {
|
|
17
|
+
tablespace: 'pg_default',
|
|
18
|
+
schema: 'public',
|
|
19
|
+
owner: 'postgres',
|
|
20
|
+
};
|
|
21
|
+
summaryTable = 'migration_summary';
|
|
22
|
+
eventTable = 'migration_events';
|
|
26
23
|
get packageName() {
|
|
27
24
|
return this._migrationPackage.name;
|
|
28
25
|
}
|
package/cjs/migration-package.js
CHANGED
|
@@ -133,9 +133,9 @@ async function loadMigrations(baseDir, pattern) {
|
|
|
133
133
|
if (path_1.default.basename(filename, ext) !== 'migration')
|
|
134
134
|
continue;
|
|
135
135
|
let json;
|
|
136
|
-
if (['.js', '.ts', '.cjs', '.mjs'].includes(ext)) {
|
|
136
|
+
if (['.js', '.ts', '.cjs', '.mjs', 'mts', 'cts'].includes(ext)) {
|
|
137
137
|
json = await Promise.resolve(`${filename}`).then(s => tslib_1.__importStar(require(s)));
|
|
138
|
-
if (json.
|
|
138
|
+
if (json.default?.version)
|
|
139
139
|
json = json.default;
|
|
140
140
|
}
|
|
141
141
|
else if (ext === '.json') {
|
|
@@ -6,19 +6,16 @@ import { isCustomMigrationTask, isInsertDataMigrationTask, isSqlScriptMigrationT
|
|
|
6
6
|
import { MigrationStatus } from '../types.js';
|
|
7
7
|
const pgAdapter = new PgAdapter();
|
|
8
8
|
export class PgMigrationAdapter extends MigrationAdapter {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.summaryTable = 'migration_summary';
|
|
20
|
-
this.eventTable = 'migration_events';
|
|
21
|
-
}
|
|
9
|
+
_infoSchema = 'public';
|
|
10
|
+
_version = 0;
|
|
11
|
+
_status = MigrationStatus.idle;
|
|
12
|
+
defaultVariables = {
|
|
13
|
+
tablespace: 'pg_default',
|
|
14
|
+
schema: 'public',
|
|
15
|
+
owner: 'postgres',
|
|
16
|
+
};
|
|
17
|
+
summaryTable = 'migration_summary';
|
|
18
|
+
eventTable = 'migration_events';
|
|
22
19
|
get packageName() {
|
|
23
20
|
return this._migrationPackage.name;
|
|
24
21
|
}
|
package/esm/migration-package.js
CHANGED
|
@@ -126,9 +126,9 @@ async function loadMigrations(baseDir, pattern) {
|
|
|
126
126
|
if (path.basename(filename, ext) !== 'migration')
|
|
127
127
|
continue;
|
|
128
128
|
let json;
|
|
129
|
-
if (['.js', '.ts', '.cjs', '.mjs'].includes(ext)) {
|
|
129
|
+
if (['.js', '.ts', '.cjs', '.mjs', 'mts', 'cts'].includes(ext)) {
|
|
130
130
|
json = await import(filename);
|
|
131
|
-
if (json.
|
|
131
|
+
if (json.default?.version)
|
|
132
132
|
json = json.default;
|
|
133
133
|
}
|
|
134
134
|
else if (ext === '.json') {
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqb/migrator",
|
|
3
3
|
"description": "Database migrator for SQB",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.20.1",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"
|
|
8
|
+
"cross-dirname": "^0.1.0",
|
|
9
|
+
"fast-glob": "^3.3.3",
|
|
9
10
|
"strict-typed-events": "^2.8.0",
|
|
10
|
-
"ts-gems": "^3.
|
|
11
|
+
"ts-gems": "^3.11.3",
|
|
11
12
|
"tslib": "^2.8.1"
|
|
12
13
|
},
|
|
13
14
|
"peerDependencies": {
|
|
14
|
-
"@sqb/builder": "^4.
|
|
15
|
-
"@sqb/connect": "^4.
|
|
16
|
-
"@sqb/postgres": "^4.
|
|
15
|
+
"@sqb/builder": "^4.20.1",
|
|
16
|
+
"@sqb/connect": "^4.20.1",
|
|
17
|
+
"@sqb/postgres": "^4.20.1"
|
|
17
18
|
},
|
|
18
19
|
"type": "module",
|
|
19
20
|
"exports": {
|
|
@@ -39,12 +40,11 @@
|
|
|
39
40
|
],
|
|
40
41
|
"repository": {
|
|
41
42
|
"type": "git",
|
|
42
|
-
"url": "https://github.com/
|
|
43
|
+
"url": "https://github.com/panates/sqb.git",
|
|
43
44
|
"directory": "packages/migrator"
|
|
44
45
|
},
|
|
45
46
|
"engines": {
|
|
46
|
-
"node": ">=
|
|
47
|
-
"npm": ">=7.0.0"
|
|
47
|
+
"node": ">=18.0"
|
|
48
48
|
},
|
|
49
49
|
"files": [
|
|
50
50
|
"bin/",
|