shyim / shopware-migration
Provides easy to use plugin migrations
Installs: 6 623
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 0
Open Issues: 0
This package is auto-updated.
Last update: 2022-11-07 02:17:56 UTC
README
How to use this?
- Require migration package in our plugin folder
composer require shyim/shopware-migration
- Include autoload.php on top our Plugin Bootstrap
require __DIR__ . '/vendor/autoload.php'; use ShyimMigration\AbstractMigration; use ShyimMigration\MigrationManager;
- Create a new migration folder in Pluginname/Resources/migrations
- Call migrations in our install, update, uninstall method
public function install(InstallContext $context) { MigrationManager::doMigrations($this, $this->container, AbstractMigration::MODUS_INSTALL); } public function update(Plugin\Context\UpdateContext $context) { MigrationManager::doMigrations($this, $this->container, AbstractMigration::MODUS_UPDATE); } public function uninstall(UninstallContext $context) { if (!$context->keepUserData()) { MigrationManager::doMigrations($this, $this->container, AbstractMigration::MODUS_UNINSTALL); } }