Skip to content

Commit

Permalink
Added compatibility for PostgreSQL and resolved "Incorrect syntax nea…
Browse files Browse the repository at this point in the history
…r 'ENGINE'. database error on setup"

Added compatibility for PostgreSQL and resolved "Incorrect syntax near 'ENGINE'. database error on setup"
  • Loading branch information
vidushigupta0607 committed Aug 25, 2023
1 parent 3158eb9 commit d475953
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ public function up()
'mo_config',
'mo_admin'
];
foreach ($tables as $table) {
DB::statement('ALTER TABLE ' . $table . ' ENGINE = InnoDB');
}
$sp_base_url = str_replace("/create_tables", "", (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
$sp_entity_id = $sp_base_url . '/miniorange_laravel_saml_connector';
$acs_url = $sp_base_url . '/sso.php';
Expand Down
4 changes: 2 additions & 2 deletions src/helper/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static function get_option($key)
try {
$result = LaraDB::select('select * from mo_config where id = ?', [1])[0];
} catch (\PDOException $e) {
if ($e->getCode() == '42S02') {
if ($e->getCode() == '42S02'|| $e->getCode() == '42P01') {
header('Location: create_tables');
exit;
}
Expand Down Expand Up @@ -90,7 +90,7 @@ public static function get_registered_user()
try {
$result = LaraDB::select('select * from mo_admin')[0];
} catch (\PDOException $e) {
if ($e->getCode() == '42S02') {
if ($e->getCode() == '42S02' || $e->getCode() == '42P01' ) {
header('Location: create_tables');
exit;
}
Expand Down

0 comments on commit d475953

Please sign in to comment.