Skip to content

Commit

Permalink
Fix table not being created
Browse files Browse the repository at this point in the history
  • Loading branch information
PadowYT2 committed Jul 13, 2022
1 parent 2fc6a69 commit 610e900
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions custom/templates/Nexus/template_settings/classes/NexusUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,22 @@ public static function updateOrCreateParam($key, $value)
public static function initialise()
{

$found = false;

foreach (DB::getInstance()->query('SELECT name FROM nl2_nexus_settings')->results() as $row) {
if ($row->name === 'template_about') {
$found = true;
break;
if (DB::getInstance()->showTables('nexus_settings')) {
$found = false;

foreach (DB::getInstance()->query('SELECT name FROM nl2_nexus_settings')->results() as $row) {
if ($row->name === 'template_about') {
$found = true;
break;
}
}
}

if ($found) {
DB::getInstance()->query('DROP TABLE nl2_nexus_settings');
} else {
if (DB::getInstance()->showTables('nexus_settings')) {
return;
if ($found) {
DB::getInstance()->query('DROP TABLE nl2_nexus_settings');
} else {
if (DB::getInstance()->showTables('nexus_settings')) {
return;
}
}
}

Expand Down

0 comments on commit 610e900

Please sign in to comment.