Skip to content

Commit

Permalink
OXDEV-7614 Removed migration trigger on module activation
Browse files Browse the repository at this point in the history
  • Loading branch information
RahatHameed committed Apr 26, 2024
1 parent c7be1ee commit 63e7085
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG-v7.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update module dependency warning in documentation
- Updated the phpstan in development dependencies and fixed several related coding style issues

### Removed
- Migration trigger on module activation

## [7.0.2] - 2022-08-10

### Fixed
Expand Down
19 changes: 0 additions & 19 deletions src/Infrastructure/ModuleSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ public static function onActivate(): void
/** @var ModuleSetup $moduleSetup */
$moduleSetup = $container->get(self::class);
$moduleSetup->runSetup();

// execute module migrations
self::executeModuleMigrations();
}

/**
Expand All @@ -51,20 +48,4 @@ public static function onActivate(): void
public static function onDeactivate(): void
{
}

/**
* Execute necessary module migrations on activate event
*/
private static function executeModuleMigrations(): void
{
$migrations = (new MigrationsBuilder())->build();

$output = new BufferedOutput();
$migrations->setOutput($output);
$needsUpdate = $migrations->execute('migrations:up-to-date', 'oe_graphql_base');

if ($needsUpdate) {
$migrations->execute('migrations:migrate', 'oe_graphql_base');
}
}
}

0 comments on commit 63e7085

Please sign in to comment.