Skip to content

Commit 9d17bc4

Browse files
committed
Merge branch 'release/0.9.18'
2 parents c74c93f + e28a897 commit 9d17bc4

File tree

3 files changed

+30
-7
lines changed

3 files changed

+30
-7
lines changed

.version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"strategy": "semver",
33
"major": 0,
44
"minor": 9,
5-
"patch": 17,
5+
"patch": 18,
66
"build": 0
77
}

src/Mvc/Database/SchemaExporter.php

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff 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
/**

versionlog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.9.18 2025-12-01
2+
13
## 0.9.17 2025-12-01
24
* Adds db:schema:dump command.
35

0 commit comments

Comments
 (0)