File tree Expand file tree Collapse file tree 3 files changed +41
-5
lines changed
tests/Doctrine/Tests/DBAL/Functional/Schema Expand file tree Collapse file tree 3 files changed +41
-5
lines changed Original file line number Diff line number Diff line change @@ -1182,4 +1182,30 @@ public function getBlobTypeDeclarationSQL(array $field)
1182
1182
{
1183
1183
return 'BLOB ' ;
1184
1184
}
1185
+
1186
+ public function getListTableCommentsSQL (string $ table , string $ database = null ) : string
1187
+ {
1188
+ $ table = $ this ->normalizeIdentifier ($ table );
1189
+ $ table = $ this ->quoteStringLiteral ($ table ->getName ());
1190
+
1191
+ $ tableCommentsName = 'user_tab_comments ' ;
1192
+ $ ownerCondition = '' ;
1193
+
1194
+ if ($ database !== null && $ database !== '/ ' ) {
1195
+ $ database = $ this ->normalizeIdentifier ($ database );
1196
+ $ database = $ this ->quoteStringLiteral ($ database ->getName ());
1197
+ $ tableCommentsName = 'all_tab_comments ' ;
1198
+ $ ownerCondition = ' AND owner = ' . $ database ;
1199
+ }
1200
+
1201
+ return sprintf (
1202
+ <<<'SQL'
1203
+ SELECT comments FROM %s WHERE table_name = %s%s
1204
+ SQL
1205
+ ,
1206
+ $ tableCommentsName ,
1207
+ $ table ,
1208
+ $ ownerCondition
1209
+ );
1210
+ }
1185
1211
}
Original file line number Diff line number Diff line change 5
5
use Doctrine \DBAL \DBALException ;
6
6
use Doctrine \DBAL \Driver \DriverException ;
7
7
use Doctrine \DBAL \Platforms \OraclePlatform ;
8
+ use Doctrine \DBAL \Platforms \PostgreSqlPlatform ;
8
9
use Doctrine \DBAL \Types \Type ;
9
10
use Throwable ;
10
11
use const CASE_LOWER ;
@@ -382,4 +383,18 @@ private function killUserSessions($user)
382
383
);
383
384
}
384
385
}
386
+
387
+ public function listTableDetails ($ tableName )
388
+ {
389
+ $ table = parent ::listTableDetails ($ tableName );
390
+
391
+ /** @var OraclePlatform $platform */
392
+ $ platform = $ this ->_platform ;
393
+ $ sql = $ platform ->getListTableCommentsSQL ($ tableName );
394
+
395
+ $ tableOptions = $ this ->_conn ->fetchAssoc ($ sql );
396
+ $ table ->addOption ('comment ' , $ tableOptions ['COMMENTS ' ]);
397
+
398
+ return $ table ;
399
+ }
385
400
}
Original file line number Diff line number Diff line change @@ -285,9 +285,4 @@ public function testCreateAndListSequences() : void
285
285
{
286
286
self ::markTestSkipped ("Skipped for uppercase letters are contained in sequences' names. Fix the schema manager in 3.0. " );
287
287
}
288
-
289
- public function testCommentInTable () : void
290
- {
291
- self ::markTestSkipped ('Table level comments are not supported on Oracle ' );
292
- }
293
288
}
You can’t perform that action at this time.
0 commit comments