From 07e93fbcc72f0c203f57d25fbee59983a3e1e843 Mon Sep 17 00:00:00 2001
From: guillermo <guillermo@verdnatura.es>
Date: Thu, 20 Feb 2025 13:05:44 +0100
Subject: [PATCH] fix: refs #7759 Change order of myt-run execution

---
 myt-run.js   | 22 +++++++++++-----------
 package.json |  2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/myt-run.js b/myt-run.js
index bc16697..b8969d6 100755
--- a/myt-run.js
+++ b/myt-run.js
@@ -149,6 +149,17 @@ class Run extends Command {
             await server.wait();
             const conn = await myt.createConnection();
 
+            // Apply changes
+
+            const hasTriggers = await fs.exists(`${dumpDataDir}/triggers.sql`);
+
+            Object.assign(opts, {
+                triggers: !hasTriggers,
+                commit: true,
+                dbConfig
+            });
+            await myt.run(Push, opts);
+
             // Mock date functions
 
             this.emit('mockingDate');
@@ -163,17 +174,6 @@ class Run extends Command {
                 await connExt.multiQuery(conn, sql);
             }
 
-            // Apply changes
-
-            const hasTriggers = await fs.exists(`${dumpDataDir}/triggers.sql`);
-
-            Object.assign(opts, {
-                triggers: !hasTriggers,
-                commit: true,
-                dbConfig
-            });
-            await myt.run(Push, opts);
-
             // Apply fixtures
 
             this.emit('applyingFixtures');
diff --git a/package.json b/package.json
index 9704126..ed54327 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@verdnatura/myt",
-  "version": "1.6.12",
+  "version": "1.6.13",
   "author": "Verdnatura Levante SL",
   "description": "MySQL version control",
   "license": "GPL-3.0",
-- 
2.40.1