@mikro-orm/migrations-mongodb 7.0.0-dev.7 → 7.0.0-dev.71
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/Migrator.d.ts +6 -6
- package/Migrator.js +9 -9
- package/README.md +3 -2
- package/package.json +6 -6
package/Migrator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MigrationParams, type RunnableMigration } from 'umzug';
|
|
2
|
-
import { type Constructor, type IMigrator, type
|
|
2
|
+
import { type Constructor, type IMigrator, type MaybePromise, type MigratorEvent, type MikroORM } from '@mikro-orm/core';
|
|
3
3
|
import type { EntityManager } from '@mikro-orm/mongodb';
|
|
4
4
|
import type { Migration } from './Migration.js';
|
|
5
5
|
import { MigrationStorage } from './MigrationStorage.js';
|
|
@@ -19,15 +19,15 @@ export declare class Migrator implements IMigrator {
|
|
|
19
19
|
/**
|
|
20
20
|
* @inheritDoc
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
create(path?: string, blank?: boolean, initial?: boolean, name?: string): Promise<MigrationResult>;
|
|
23
23
|
/**
|
|
24
24
|
* @inheritDoc
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
checkSchema(): Promise<boolean>;
|
|
27
27
|
/**
|
|
28
28
|
* @inheritDoc
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
createInitial(path?: string): Promise<MigrationResult>;
|
|
31
31
|
/**
|
|
32
32
|
* @inheritDoc
|
|
33
33
|
*/
|
|
@@ -40,11 +40,11 @@ export declare class Migrator implements IMigrator {
|
|
|
40
40
|
/**
|
|
41
41
|
* @inheritDoc
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
getExecuted(): Promise<MigrationRow[]>;
|
|
44
44
|
/**
|
|
45
45
|
* @inheritDoc
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
getPending(): Promise<UmzugMigration[]>;
|
|
48
48
|
/**
|
|
49
49
|
* @inheritDoc
|
|
50
50
|
*/
|
package/Migrator.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Umzug } from 'umzug';
|
|
1
|
+
import { Umzug, } from 'umzug';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { Utils, } from '@mikro-orm/core';
|
|
4
4
|
import { MigrationRunner } from './MigrationRunner.js';
|
|
@@ -31,7 +31,7 @@ export class Migrator {
|
|
|
31
31
|
/**
|
|
32
32
|
* @inheritDoc
|
|
33
33
|
*/
|
|
34
|
-
async
|
|
34
|
+
async create(path, blank = false, initial = false, name) {
|
|
35
35
|
this.ensureMigrationsDirExists();
|
|
36
36
|
const diff = { up: [], down: [] };
|
|
37
37
|
const migration = await this.generator.generate(diff, path, name);
|
|
@@ -45,15 +45,15 @@ export class Migrator {
|
|
|
45
45
|
/**
|
|
46
46
|
* @inheritDoc
|
|
47
47
|
*/
|
|
48
|
-
async
|
|
48
|
+
async checkSchema() {
|
|
49
49
|
return true;
|
|
50
50
|
}
|
|
51
51
|
/* v8 ignore stop */
|
|
52
52
|
/**
|
|
53
53
|
* @inheritDoc
|
|
54
54
|
*/
|
|
55
|
-
async
|
|
56
|
-
return this.
|
|
55
|
+
async createInitial(path) {
|
|
56
|
+
return this.create(path);
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
59
|
* @inheritDoc
|
|
@@ -111,14 +111,14 @@ export class Migrator {
|
|
|
111
111
|
/**
|
|
112
112
|
* @inheritDoc
|
|
113
113
|
*/
|
|
114
|
-
async
|
|
114
|
+
async getExecuted() {
|
|
115
115
|
this.ensureMigrationsDirExists();
|
|
116
116
|
return this.storage.getExecutedMigrations();
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
* @inheritDoc
|
|
120
120
|
*/
|
|
121
|
-
async
|
|
121
|
+
async getPending() {
|
|
122
122
|
this.ensureMigrationsDirExists();
|
|
123
123
|
return this.umzug.pending();
|
|
124
124
|
}
|
|
@@ -140,7 +140,7 @@ export class Migrator {
|
|
|
140
140
|
resolve(params) {
|
|
141
141
|
const createMigrationHandler = async (method) => {
|
|
142
142
|
const migration = await Utils.dynamicImport(params.path);
|
|
143
|
-
const MigrationClass = Object.values(migration)
|
|
143
|
+
const MigrationClass = Object.values(migration).find(cls => typeof cls === 'function' && typeof cls.constructor === 'function');
|
|
144
144
|
const instance = new MigrationClass(this.driver, this.config);
|
|
145
145
|
await this.runner.run(instance, method);
|
|
146
146
|
};
|
|
@@ -164,7 +164,7 @@ export class Migrator {
|
|
|
164
164
|
return name.match(/^\d{14}$/) ? this.options.fileName(name) : name;
|
|
165
165
|
}
|
|
166
166
|
prefix(options) {
|
|
167
|
-
if (
|
|
167
|
+
if (typeof options === 'string' || Array.isArray(options)) {
|
|
168
168
|
return { migrations: Utils.asArray(options).map(name => this.getMigrationFilename(name)) };
|
|
169
169
|
}
|
|
170
170
|
if (!options) {
|
package/README.md
CHANGED
|
@@ -11,7 +11,6 @@ TypeScript ORM for Node.js based on Data Mapper, [Unit of Work](https://mikro-or
|
|
|
11
11
|
[](https://discord.gg/w8bjxFHS7X)
|
|
12
12
|
[](https://www.npmjs.com/package/@mikro-orm/core)
|
|
13
13
|
[](https://coveralls.io/r/mikro-orm/mikro-orm?branch=master)
|
|
14
|
-
[](https://codeclimate.com/github/mikro-orm/mikro-orm/maintainability)
|
|
15
14
|
[](https://github.com/mikro-orm/mikro-orm/actions?workflow=tests)
|
|
16
15
|
|
|
17
16
|
## 🤔 Unit of What?
|
|
@@ -141,7 +140,7 @@ There is also auto-generated [CHANGELOG.md](CHANGELOG.md) file based on commit m
|
|
|
141
140
|
- [Composite and Foreign Keys as Primary Key](https://mikro-orm.io/docs/composite-keys)
|
|
142
141
|
- [Filters](https://mikro-orm.io/docs/filters)
|
|
143
142
|
- [Using `QueryBuilder`](https://mikro-orm.io/docs/query-builder)
|
|
144
|
-
- [
|
|
143
|
+
- [Populating relations](https://mikro-orm.io/docs/populating-relations)
|
|
145
144
|
- [Property Validation](https://mikro-orm.io/docs/property-validation)
|
|
146
145
|
- [Lifecycle Hooks](https://mikro-orm.io/docs/events#hooks)
|
|
147
146
|
- [Vanilla JS Support](https://mikro-orm.io/docs/usage-with-js)
|
|
@@ -382,6 +381,8 @@ See also the list of contributors who [participated](https://github.com/mikro-or
|
|
|
382
381
|
|
|
383
382
|
Please ⭐️ this repository if this project helped you!
|
|
384
383
|
|
|
384
|
+
> If you'd like to support my open-source work, consider sponsoring me directly at [github.com/sponsors/b4nan](https://github.com/sponsors/b4nan).
|
|
385
|
+
|
|
385
386
|
## 📝 License
|
|
386
387
|
|
|
387
388
|
Copyright © 2018 [Martin Adámek](https://github.com/b4nan).
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/migrations-mongodb",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.71",
|
|
5
5
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://mikro-orm.io",
|
|
40
40
|
"engines": {
|
|
41
|
-
"node": ">= 22.
|
|
41
|
+
"node": ">= 22.17.0"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "yarn clean && yarn compile && yarn copy",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@mikro-orm/mongodb": "7.0.0-dev.
|
|
54
|
-
"mongodb": "6.
|
|
53
|
+
"@mikro-orm/mongodb": "7.0.0-dev.71",
|
|
54
|
+
"mongodb": "6.20.0",
|
|
55
55
|
"umzug": "3.8.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@mikro-orm/core": "^6.
|
|
58
|
+
"@mikro-orm/core": "^6.6.1"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
|
61
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
61
|
+
"@mikro-orm/core": "7.0.0-dev.71"
|
|
62
62
|
}
|
|
63
63
|
}
|