startSetup(); $this->uninstallTables($setup) ->uninstallConfigData($setup) ->uninstallFlagData($setup) ->removeEmailTemplates($setup); $setup->endSetup(); } private function uninstallTables(SchemaSetupInterface $setup): self { $tablesToDrop = [ LoginAttempt::TABLE_NAME, VisitHistoryDetail::TABLE_NAME, VisitHistoryEntry::TABLE_NAME, ActiveSession::TABLE_NAME, LogDetail::TABLE_NAME, LogEntry::TABLE_NAME ]; foreach ($tablesToDrop as $table) { $setup->getConnection()->dropTable( $setup->getTable($table) ); } return $this; } private function uninstallConfigData(SchemaSetupInterface $setup): self { $setup->getConnection()->delete( $setup->getTable('core_config_data'), "`path` LIKE 'amaudit%'" ); return $this; } private function uninstallFlagData(SchemaSetupInterface $setup): self { $setup->getConnection()->delete( $setup->getTable('flag'), '`flag_code` LIKE \'amasty_audit_%\'' ); return $this; } private function removeEmailTemplates(SchemaSetupInterface $setup): self { $setup->getConnection()->delete( $setup->getTable('email_template'), '`orig_template_code` LIKE \'amaudit_%\'' ); return $this; } }