@mikro-orm/migrations
Advanced tools
+7
-6
@@ -100,9 +100,10 @@ import { t, Type, UnknownType, } from '@mikro-orm/core'; | ||
| const result = await super.runMigrations(method, options); | ||
| // Only update the snapshot after `down` — after reverting, the DB state | ||
| // diverges from what was stored during `create`, so we need to refresh it. | ||
| // For `up`, the snapshot is already up to date (written during `create`), | ||
| // and writing it would break read-only production environments (GH #7232). | ||
| if (method === 'down' && result.length > 0 && this.options.snapshot) { | ||
| if (result.length > 0 && this.options.snapshot) { | ||
| const schema = await DatabaseSchema.create(this.em.getConnection(), this.em.getPlatform(), this.config); | ||
| await this.storeCurrentSchema(schema); | ||
| try { | ||
| await this.storeCurrentSchema(schema); | ||
| } | ||
| catch { | ||
| // Silently ignore for read-only filesystems (production). | ||
| } | ||
| } | ||
@@ -109,0 +110,0 @@ return result; |
+3
-3
| { | ||
| "name": "@mikro-orm/migrations", | ||
| "type": "module", | ||
| "version": "7.0.0-dev.296", | ||
| "version": "7.0.0-dev.298", | ||
| "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.", | ||
@@ -53,3 +53,3 @@ "exports": { | ||
| "dependencies": { | ||
| "@mikro-orm/sql": "7.0.0-dev.296" | ||
| "@mikro-orm/sql": "7.0.0-dev.298" | ||
| }, | ||
@@ -60,4 +60,4 @@ "devDependencies": { | ||
| "peerDependencies": { | ||
| "@mikro-orm/core": "7.0.0-dev.296" | ||
| "@mikro-orm/core": "7.0.0-dev.298" | ||
| } | ||
| } |
Sorry, the diff of this file is not supported yet
722
0.14%182397
-0.12%+ Added
+ Added
- Removed
- Removed
Updated