migrateData example


    public function getCreationTimestamp(): int
    {
        return 1580218617;
    }

    public function update(Connection $connection): void
    {
        $this->updateSchema($connection);
        $this->createUpdateTrigger($connection);
        $this->createInsertTrigger($connection);
        $this->migrateData($connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }

    public function updateSchema(Connection $connection): void
    {
        $connection->executeStatement(
            'ALTER TABLE `shipping_method_price` MODIFY `currency_id` binary(16) NULL; ALTER TABLE `shipping_method_price` MODIFY `price` double NULL; ALTER TABLE `shipping_method_price` ADD COLUMN `currency_price` json NULL AFTER `price`;'
public function getCreationTimestamp(): int
    {
        return 1594104496;
    }

    public function update(Connection $connection): void
    {
        $this->updateSchema($connection);
        $this->createCurrencyUpdateTrigger($connection);
        $this->createCurrencyInsertTrigger($connection);
        $this->createOrderInsertTrigger($connection);
        $this->migrateData($connection);
    }

    public function updateDestructive(Connection $connection): void
    {
        // implement update destructive     }

    private function updateSchema(Connection $connection): void
    {
        $connection->executeStatement('ALTER TABLE `currency` CHANGE `decimal_precision` `decimal_precision` int NULL AFTER `position`;');
        $connection->executeStatement('ALTER TABLE currency ADD COLUMN `item_rounding` JSON NULL;');
        


class Migrations_Migration408 extends Shopware\Components\Migrations\AbstractMigration
{
    public function up($modus)
    {
        $this->createNewTable();
        $this->prepareOldData();
        $this->migrateData();
        $this->cleanUp();
    }

    /** * @return string */
    protected function createNewTable()
    {
        $this->addSql('DROP TABLE IF EXISTS s_article_configurator_price_variations');

        $sql = <<<EOT
Home | Imprint | This part of the site doesn't use cookies.