Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12220-Declarative-Schema-for-all-extensions #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions Setup/Patch/Data/DropTable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Copyright © Magefan ([email protected]). All rights reserved.
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
*/

declare(strict_types=1);

namespace Magefan\GeoIp\Setup\Patch\Data;

use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;
use Magento\Framework\Setup\Patch\PatchVersionInterface;

class DropTable implements DataPatchInterface, PatchVersionInterface
{
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;

/**
* @param ModuleDataSetupInterface $moduleDataSetup

*/
public function __construct(
ModuleDataSetupInterface $moduleDataSetup
)
{
$this->moduleDataSetup = $moduleDataSetup;
}

public static function getDependencies()
{
return [];
}

public function getAliases()
{
return [];
}

public function apply()
{
$this->moduleDataSetup->startSetup();
$setup = $this->moduleDataSetup;
$connection = $setup->getConnection();

$table = $connection->getTableName( 'magefan_geoip_country' );
if ($connection->isTableExists($table)) {
$connection->dropTable($table);
}

$this->moduleDataSetup->endSetup();
}

public static function getVersion()
{
return '2.2.0';
}
}
39 changes: 0 additions & 39 deletions Setup/UpgradeData.php

This file was deleted.