@mikro-orm/migrations 7.0.0-dev.68 → 7.0.0-dev.69
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 +5 -5
- package/Migrator.js +8 -8
- package/package.json +3 -3
package/Migrator.d.ts
CHANGED
|
@@ -21,12 +21,12 @@ export declare class Migrator implements IMigrator {
|
|
|
21
21
|
/**
|
|
22
22
|
* @inheritDoc
|
|
23
23
|
*/
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
create(path?: string, blank?: boolean, initial?: boolean, name?: string): Promise<MigrationResult>;
|
|
25
|
+
checkSchema(): Promise<boolean>;
|
|
26
26
|
/**
|
|
27
27
|
* @inheritDoc
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
createInitial(path?: string, name?: string, blank?: boolean): Promise<MigrationResult>;
|
|
30
30
|
/**
|
|
31
31
|
* @inheritDoc
|
|
32
32
|
*/
|
|
@@ -48,12 +48,12 @@ export declare class Migrator implements IMigrator {
|
|
|
48
48
|
/**
|
|
49
49
|
* @inheritDoc
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
getExecuted(): Promise<MigrationRow[]>;
|
|
52
52
|
private ensureDatabase;
|
|
53
53
|
/**
|
|
54
54
|
* @inheritDoc
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
getPending(): Promise<UmzugMigration[]>;
|
|
57
57
|
/**
|
|
58
58
|
* @inheritDoc
|
|
59
59
|
*/
|
package/Migrator.js
CHANGED
|
@@ -43,9 +43,9 @@ export class Migrator {
|
|
|
43
43
|
/**
|
|
44
44
|
* @inheritDoc
|
|
45
45
|
*/
|
|
46
|
-
async
|
|
46
|
+
async create(path, blank = false, initial = false, name) {
|
|
47
47
|
if (initial) {
|
|
48
|
-
return this.
|
|
48
|
+
return this.createInitial(path, name, blank);
|
|
49
49
|
}
|
|
50
50
|
this.ensureMigrationsDirExists();
|
|
51
51
|
const diff = await this.getSchemaDiff(blank, initial);
|
|
@@ -60,7 +60,7 @@ export class Migrator {
|
|
|
60
60
|
diff,
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
async
|
|
63
|
+
async checkSchema() {
|
|
64
64
|
this.ensureMigrationsDirExists();
|
|
65
65
|
const diff = await this.getSchemaDiff(false, false);
|
|
66
66
|
return diff.up.length > 0;
|
|
@@ -68,7 +68,7 @@ export class Migrator {
|
|
|
68
68
|
/**
|
|
69
69
|
* @inheritDoc
|
|
70
70
|
*/
|
|
71
|
-
async
|
|
71
|
+
async createInitial(path, name, blank = false) {
|
|
72
72
|
this.ensureMigrationsDirExists();
|
|
73
73
|
const schemaExists = await this.validateInitialMigration(blank);
|
|
74
74
|
const diff = await this.getSchemaDiff(blank, true);
|
|
@@ -143,8 +143,8 @@ export class Migrator {
|
|
|
143
143
|
* If only some of the tables are present, exception is thrown.
|
|
144
144
|
*/
|
|
145
145
|
async validateInitialMigration(blank) {
|
|
146
|
-
const executed = await this.
|
|
147
|
-
const pending = await this.
|
|
146
|
+
const executed = await this.getExecuted();
|
|
147
|
+
const pending = await this.getPending();
|
|
148
148
|
if (executed.length > 0 || pending.length > 0) {
|
|
149
149
|
throw new Error('Initial migration cannot be created, as some migrations already exist');
|
|
150
150
|
}
|
|
@@ -175,7 +175,7 @@ export class Migrator {
|
|
|
175
175
|
/**
|
|
176
176
|
* @inheritDoc
|
|
177
177
|
*/
|
|
178
|
-
async
|
|
178
|
+
async getExecuted() {
|
|
179
179
|
await this.ensureDatabase();
|
|
180
180
|
return this.storage.getExecutedMigrations();
|
|
181
181
|
}
|
|
@@ -191,7 +191,7 @@ export class Migrator {
|
|
|
191
191
|
/**
|
|
192
192
|
* @inheritDoc
|
|
193
193
|
*/
|
|
194
|
-
async
|
|
194
|
+
async getPending() {
|
|
195
195
|
await this.ensureDatabase();
|
|
196
196
|
return this.umzug.pending();
|
|
197
197
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/migrations",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.69",
|
|
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",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@mikro-orm/knex": "7.0.0-dev.
|
|
53
|
+
"@mikro-orm/knex": "7.0.0-dev.69",
|
|
54
54
|
"umzug": "3.8.2"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@mikro-orm/core": "^6.6.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
60
|
+
"@mikro-orm/core": "7.0.0-dev.69"
|
|
61
61
|
}
|
|
62
62
|
}
|