File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -87,18 +87,29 @@ private static function dropTables(EntityManagerInterface $entityManager): void
8787 {
8888 $ connection = $ entityManager ->getConnection ();
8989
90- $ statement = $ connection ->prepare ('SHOW TABLES ' );
90+ $ statement = $ connection ->prepare ('SHOW FULL TABLES WHERE Table_type = "BASE TABLE" ' );
9191 $ statement ->execute ();
9292 $ tables = $ statement ->fetchAll ();
9393
9494 $ connection ->exec ('SET foreign_key_checks = 0 ' );
95- echo "Dropping database \n" ;
95+ echo "Dropping tables \n" ;
9696 foreach ($ tables as $ table )
9797 {
9898 $ tableName = current ($ table );
9999 $ connection ->exec ('DROP TABLE ` ' . $ tableName . '` ' );
100100 }
101101
102+ $ statement = $ connection ->prepare ('SHOW FULL TABLES WHERE Table_type = "VIEW" ' );
103+ $ statement ->execute ();
104+ $ views = $ statement ->fetchAll ();
105+
106+ echo "Dropping views \n" ;
107+ foreach ($ views as $ view )
108+ {
109+ $ viewName = current ($ view );
110+ $ connection ->exec ('DROP VIEW ` ' . $ viewName . '` ' );
111+ }
112+
102113 $ connection ->exec ('SET foreign_key_checks = 1 ' );
103114 }
104115
You can’t perform that action at this time.
0 commit comments