@@ -84,6 +84,10 @@ private static function mysqlDump(array $db_config, string $schema_sql_path) : i
84
84
. ' --no-data ' ,
85
85
$ exit_code
86
86
);
87
+ if (0 !== $ exit_code ) {
88
+ return $ exit_code ;
89
+ }
90
+
87
91
$ schema_sql = file_get_contents ($ schema_sql_path );
88
92
if (false === $ schema_sql ) {
89
93
return 1 ;
@@ -94,15 +98,13 @@ private static function mysqlDump(array $db_config, string $schema_sql_path) : i
94
98
}
95
99
96
100
// Include migration rows to avoid unnecessary reruns conflicting.
97
- if (0 === $ exit_code ) {
98
- // CONSIDER: How this could be done as consistent snapshot with
99
- // dump of structure, and avoid duplicate "SET" comments.
100
- passthru (
101
- $ command_prefix . ' migrations --no-create-info --skip-extended-insert >> '
102
- . escapeshellarg ($ schema_sql_path ),
103
- $ exit_code
104
- );
105
- }
101
+ // CONSIDER: How this could be done as consistent snapshot with
102
+ // dump of structure, and avoid duplicate "SET" comments.
103
+ passthru (
104
+ $ command_prefix . ' migrations --no-create-info --skip-extended-insert >> '
105
+ . escapeshellarg ($ schema_sql_path ),
106
+ $ exit_code
107
+ );
106
108
107
109
return $ exit_code ;
108
110
}
@@ -131,17 +133,18 @@ private static function pgsqlDump(array $db_config, string $schema_sql_path) : i
131
133
. ' --schema-only ' ,
132
134
$ exit_code
133
135
);
136
+ if (0 !== $ exit_code ) {
137
+ return $ exit_code ;
138
+ }
134
139
135
140
// Include migration rows to avoid unnecessary reruns conflicting.
136
- if (0 === $ exit_code ) {
137
- // CONSIDER: How this could be done as consistent snapshot with
138
- // dump of structure, and avoid duplicate "SET" comments.
139
- passthru (
140
- $ command_prefix . ' --table=migrations --data-only --inserts >> '
141
- . escapeshellarg ($ schema_sql_path ),
142
- $ exit_code
143
- );
144
- }
141
+ // CONSIDER: How this could be done as consistent snapshot with
142
+ // dump of structure, and avoid duplicate "SET" comments.
143
+ passthru (
144
+ $ command_prefix . ' --table=migrations --data-only --inserts >> '
145
+ . escapeshellarg ($ schema_sql_path ),
146
+ $ exit_code
147
+ );
145
148
146
149
return $ exit_code ;
147
150
}
0 commit comments