Skip to content

Commit 2a51dd7

Browse files
committed
Skip migration if first execution
Signed-off-by: Riddhesh Sanghvi <[email protected]>
1 parent 69b29e9 commit 2a51dd7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

migrations/db/20240502102550_easyengine_check_and_update_docker_one.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,26 @@
88

99
class CheckAndUpdateDockerOne extends Base {
1010

11+
public function __construct() {
12+
13+
if ( $this->is_first_execution ) {
14+
$this->skip_this_migration = true;
15+
}
16+
}
17+
1118
/**
1219
* Execute create table query for site and sitemeta table.
1320
*
1421
* @throws EE\ExitException
1522
*/
1623
public function up() {
1724

25+
if ( $this->skip_this_migration ) {
26+
EE::debug( 'Skipping migration as it is not needed.' );
27+
28+
return;
29+
}
30+
1831
EE::log( 'Checking Docker version.' );
1932
$docker_version = trim( EE::launch( 'docker version --format "{{.Server.Version}}"' )->stdout );
2033

0 commit comments

Comments
 (0)