@mikro-orm/migrations 7.2.0-dev.0 → 7.2.0-dev.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.
- package/Migrator.js +5 -1
- package/package.json +4 -4
package/Migrator.js
CHANGED
|
@@ -30,6 +30,9 @@ export class Migrator extends AbstractMigrator {
|
|
|
30
30
|
}
|
|
31
31
|
async getSnapshotPath() {
|
|
32
32
|
if (!this.#snapshotPath) {
|
|
33
|
+
// the snapshot is probed before `init()`, so the source folder auto-detection has to run first,
|
|
34
|
+
// otherwise the path stays unresolved and the snapshot is looked up in `baseDir`
|
|
35
|
+
await this.resolvePaths();
|
|
33
36
|
const { fs } = await import('@mikro-orm/core/fs-utils');
|
|
34
37
|
// for snapshots, we always want to use the path based on `emit` option, regardless of whether we run in TS context
|
|
35
38
|
/* v8 ignore next */
|
|
@@ -148,7 +151,8 @@ export class Migrator extends AbstractMigrator {
|
|
|
148
151
|
const result = await super.runMigrations(method, options);
|
|
149
152
|
if (result.length > 0 && this.options.snapshot) {
|
|
150
153
|
const ctx = Utils.isObject(options) ? options.transaction : undefined;
|
|
151
|
-
const
|
|
154
|
+
const { skipTables, skipViews } = this.config.get('schemaGenerator');
|
|
155
|
+
const schema = await DatabaseSchema.create(this.em.getConnection(), this.em.getPlatform(), this.config, undefined, undefined, undefined, skipTables, skipViews, ctx);
|
|
152
156
|
// keep the snapshot authored by `migration:create` when the migrated DB still matches it
|
|
153
157
|
// semantically — rewriting it from introspection only churns cosmetic serialization noise
|
|
154
158
|
// (expression casing/reformatting, native-enum mapped type, index method, ...) into the diff
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/migrations",
|
|
3
|
-
"version": "7.2.0-dev.
|
|
3
|
+
"version": "7.2.0-dev.1",
|
|
4
4
|
"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.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"copy": "node ../../scripts/copy.mjs"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@mikro-orm/sql": "7.2.0-dev.
|
|
50
|
+
"@mikro-orm/sql": "7.2.0-dev.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@mikro-orm/core": "^7.1.
|
|
53
|
+
"@mikro-orm/core": "^7.1.7"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@mikro-orm/core": "7.2.0-dev.
|
|
56
|
+
"@mikro-orm/core": "7.2.0-dev.1"
|
|
57
57
|
},
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">= 22.17.0"
|