1+ <?php
2+ /**
3+ * Copyright © Magefan (support@magefan.com). All rights reserved.
4+ * Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
5+ */
6+
7+ declare (strict_types=1 );
8+
9+ namespace Magefan \GeoIp \Setup \Patch \Data ;
10+
11+ use Magento \Framework \Setup \ModuleDataSetupInterface ;
12+ use Magento \Framework \Setup \Patch \DataPatchInterface ;
13+ use Magento \Framework \Setup \Patch \PatchVersionInterface ;
14+
15+ class DropTable implements DataPatchInterface, PatchVersionInterface
16+ {
17+ /**
18+ * @var ModuleDataSetupInterface
19+ */
20+ private $ moduleDataSetup ;
21+
22+ /**
23+ * @param ModuleDataSetupInterface $moduleDataSetup
24+
25+ */
26+ public function __construct (
27+ ModuleDataSetupInterface $ moduleDataSetup
28+ )
29+ {
30+ $ this ->moduleDataSetup = $ moduleDataSetup ;
31+ }
32+
33+ public static function getDependencies ()
34+ {
35+ return [];
36+ }
37+
38+ public function getAliases ()
39+ {
40+ return [];
41+ }
42+
43+ public function apply ()
44+ {
45+ $ this ->moduleDataSetup ->startSetup ();
46+ $ setup = $ this ->moduleDataSetup ;
47+ $ connection = $ setup ->getConnection ();
48+
49+ $ table = $ connection ->getTableName ( 'magefan_geoip_country ' );
50+ if ($ connection ->isTableExists ($ table )) {
51+ $ connection ->dropTable ($ table );
52+ }
53+
54+ $ this ->moduleDataSetup ->endSetup ();
55+ }
56+
57+ public static function getVersion ()
58+ {
59+ return '2.2.0 ' ;
60+ }
61+ }
0 commit comments