File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -535,7 +535,7 @@ function importsql($name){
535
535
* @return boolean
536
536
*/
537
537
if (!function_exists ('uninstallsql ' )) {
538
- function uninstallsql ($ name )
538
+ function uninstallsql ($ name )
539
539
{
540
540
$ service = new Service (App::instance ()); // 获取service 服务
541
541
$ addons_path = $ service ->getAddonsPath (); // 插件列表
@@ -545,11 +545,14 @@ function uninstallsql($name)
545
545
$ sql = str_replace ('__PREFIX__ ' , config ('database.connections.mysql.prefix ' ),$ sql );
546
546
$ sql = explode ("\r\n" ,$ sql );
547
547
foreach ($ sql as $ k =>$ v ){
548
- try {
549
- Db::execute ($ v );
550
- } catch (\PDOException $ e ) {
551
- throw new PDOException ($ e ->getMessage ());
548
+ if (strpos (strtolower ($ v ),'drop table ' )!==false ){
549
+ try {
550
+ Db::execute ($ v );
551
+ } catch (\Exception $ e ) {
552
+ throw new Exception ($ e ->getMessage ());
553
+ }
552
554
}
555
+
553
556
}
554
557
}
555
558
return true ;
You can’t perform that action at this time.
0 commit comments