File tree Expand file tree Collapse file tree 3 files changed +30
-7
lines changed Expand file tree Collapse file tree 3 files changed +30
-7
lines changed Original file line number Diff line number Diff line change 22 "strategy" : " semver" ,
33 "major" : 0 ,
44 "minor" : 9 ,
5- "patch" : 17 ,
5+ "patch" : 18 ,
66 "build" : 0
77}
Original file line number Diff line number Diff line change @@ -121,13 +121,34 @@ private function getLatestMigrationVersion(): ?string
121121 */
122122 private function getTables (): array
123123 {
124- // Get all tables using adapter's native method
125- $ tables = $ this ->_Adapter ->getTables ();
124+ $ adapterType = $ this ->_Adapter ->getAdapterType ();
126125
127- // Return array of table names
128- return array_map ( function ( $ table ) {
129- return $ table ->getName ();
130- }, $ tables );
126+ switch ( $ adapterType )
127+ {
128+ case 'mysql ' :
129+ $ sql = "SELECT TABLE_NAME FROM information_schema.TABLES
130+ WHERE TABLE_SCHEMA = ? AND TABLE_TYPE = 'BASE TABLE'
131+ ORDER BY TABLE_NAME " ;
132+ $ rows = $ this ->_Adapter ->fetchAll ( $ sql , [$ this ->_Adapter ->getOption ( 'name ' )] );
133+ return array_column ( $ rows , 'TABLE_NAME ' );
134+
135+ case 'pgsql ' :
136+ $ sql = "SELECT tablename FROM pg_catalog.pg_tables
137+ WHERE schemaname = 'public'
138+ ORDER BY tablename " ;
139+ $ rows = $ this ->_Adapter ->fetchAll ( $ sql );
140+ return array_column ( $ rows , 'tablename ' );
141+
142+ case 'sqlite ' :
143+ $ sql = "SELECT name FROM sqlite_master
144+ WHERE type = 'table' AND name NOT LIKE 'sqlite_%'
145+ ORDER BY name " ;
146+ $ rows = $ this ->_Adapter ->fetchAll ( $ sql );
147+ return array_column ( $ rows , 'name ' );
148+
149+ default :
150+ throw new \RuntimeException ( "Unsupported adapter type: {$ adapterType }" );
151+ }
131152 }
132153
133154 /**
Original file line number Diff line number Diff line change 1+ ## 0.9.18 2025-12-01
2+
13## 0.9.17 2025-12-01
24* Adds db:schema: dump command.
35
You can’t perform that action at this time.
0 commit comments