File tree Expand file tree Collapse file tree
userfrosting/models/database Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -132,9 +132,10 @@ public static function getCreatedTables(){
132132 if (!static ::testConnection ())
133133 return [];
134134
135- $ connection = Capsule::connection ();
135+ $ schema = Capsule::schema ();
136+
136137 $ results = [];
137-
138+
138139 $ test_list = [
139140 static ::getSchemaTable ('user ' )->name ,
140141 static ::getSchemaTable ('user_event ' )->name ,
@@ -144,16 +145,13 @@ public static function getCreatedTables(){
144145 static ::getSchemaTable ('authorize_group ' )->name ,
145146 static ::$ app ->remember_me_table ['tableName ' ]
146147 ];
147-
148+
148149 foreach ($ test_list as $ table ){
149- try {
150- $ stmt = $ connection ->select ("SELECT 1 FROM $ table LIMIT 1; " );
151- } catch (\PDOException $ e ){
152- continue ;
150+ if ($ schema ->hasTable ($ table )) {
151+ $ results [] = $ table ;
153152 }
154- $ results [] = $ table ;
155153 }
156-
154+
157155 return $ results ;
158156 }
159157
You can’t perform that action at this time.
0 commit comments