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){
535535 * @return boolean
536536 */
537537if (!function_exists ('uninstallsql ' )) {
538- function uninstallsql ($ name )
538+ function uninstallsql ($ name )
539539 {
540540 $ service = new Service (App::instance ()); // 获取service 服务
541541 $ addons_path = $ service ->getAddonsPath (); // 插件列表
@@ -545,11 +545,14 @@ function uninstallsql($name)
545545 $ sql = str_replace ('__PREFIX__ ' , config ('database.connections.mysql.prefix ' ),$ sql );
546546 $ sql = explode ("\r\n" ,$ sql );
547547 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+ }
552554 }
555+
553556 }
554557 }
555558 return true ;
You can’t perform that action at this time.
0 commit comments