File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
class DbSchemaReader implements DbSchemaReaderInterface
19
19
{
20
+ /**
21
+ * Table type in information_schema.TABLES which allows to identify only tables and ignore views
22
+ */
23
+ const MYSQL_TABLE_TYPE = 'BASE TABLE ' ;
24
+
20
25
/**
21
26
* @var ResourceConnection
22
27
*/
@@ -209,8 +214,15 @@ public function readConstraints($tableName, $resource)
209
214
*/
210
215
public function readTables ($ resource )
211
216
{
212
- return $ this ->resourceConnection
213
- ->getConnection ($ resource )
214
- ->getTables ();
217
+ $ adapter = $ this ->resourceConnection ->getConnection ($ resource );
218
+ $ dbName = $ this ->resourceConnection ->getSchemaName ($ resource );
219
+ $ stmt = $ adapter ->select ()
220
+ ->from (
221
+ ['information_schema.TABLES ' ],
222
+ ['TABLE_NAME ' ]
223
+ )
224
+ ->where ('TABLE_SCHEMA = ? ' , $ dbName )
225
+ ->where ('TABLE_TYPE = ? ' , self ::MYSQL_TABLE_TYPE );
226
+ return $ adapter ->fetchCol ($ stmt );
215
227
}
216
228
}
You can’t perform that action at this time.
0 commit comments