Skip to content

Commit

Permalink
Update helper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
funadmin authored Oct 13, 2022
1 parent 1bd3ed7 commit f9cc9b3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -545,16 +545,13 @@ function uninstallsql($name)
if (is_file($sqlFile)) {
$sql = file_get_contents($sqlFile);
$sql = str_replace('__PREFIX__', config('database.connections.mysql.prefix'),$sql);
$sql = explode("\r\n",$sql);
$sql = array_filter(explode("\r\n",$sql));
foreach ($sql as $k=>$v){
if(strpos(strtolower($v),'drop table')!==false){
try {
Db::execute($v);
} catch (\Exception $e) {
throw new Exception($e->getMessage());
}
try {
Db::execute($v);
} catch (\Exception $e) {
throw new Exception($e->getMessage());
}

}
}
return true;
Expand Down

0 comments on commit f9cc9b3

Please sign in to comment.