Skip to content

Commit

Permalink
fix: remove old sql file
Browse files Browse the repository at this point in the history
  • Loading branch information
fox-john committed Sep 12, 2024
1 parent b3d405d commit 59882db
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 141 deletions.
1 change: 0 additions & 1 deletion ps_eventbus.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Ps_eventbus extends Module
const REQUIRED_TABLES = [
'eventbus_type_sync',
'eventbus_job',
'eventbus_deleted_objects',
'eventbus_incremental_sync',
];

Expand Down
13 changes: 0 additions & 13 deletions sql/migrate.sql

This file was deleted.

1 change: 0 additions & 1 deletion sql/uninstall.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
DROP TABLE IF EXISTS `PREFIX_eventbus_type_sync`;
DROP TABLE IF EXISTS `PREFIX_eventbus_job`;
DROP TABLE IF EXISTS `PREFIX_eventbus_deleted_objects`;
DROP TABLE IF EXISTS `PREFIX_eventbus_incremental_sync`;
DROP TABLE IF EXISTS `PREFIX_eventbus_live_sync`;
32 changes: 0 additions & 32 deletions src/Module/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,38 +70,6 @@ public function installDatabaseTables()
}
}

$this->copyDataFromPsAccounts();

return true;
}

/**
* @return void
*/
private function copyDataFromPsAccounts()
{
$dbInstallFile = "{$this->module->getLocalPath()}/sql/migrate.sql";

if (!file_exists($dbInstallFile)) {
return;
}

$sql = \Tools::file_get_contents($dbInstallFile);

if (empty($sql) || !is_string($sql)) {
return;
}

$sql = str_replace(['PREFIX_', 'ENGINE_TYPE'], [_DB_PREFIX_, _MYSQL_ENGINE_], $sql);
$sql = preg_split("/;\s*[\r\n]+/", trim($sql));

if (!empty($sql)) {
foreach ($sql as $query) {
try {
$this->db->execute($query);
} catch (\Exception $exception) {
}
}
}
}
}
94 changes: 0 additions & 94 deletions src/Repository/DeletedObjectsRepository.php

This file was deleted.

2 changes: 2 additions & 0 deletions src/Repository/ServerInformationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ public function getHealthCheckData($isAuthentifiedCall)
try {
$this->db->executeS($query);
} catch (\PrestaShopDatabaseException $e) {
dump($e);
die;
$allTablesInstalled = false;
break;
}
Expand Down

0 comments on commit 59882db

Please sign in to comment.