File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ awareness about deprecated code.
88
99# Upgrade to 4.4
1010
11+ ## Deprecated ` Schema::createNamespace() ` and the ` $namespaces ` constructor parameter
12+
13+ The ` Schema::createNamespace() ` method and the ` $namespaces ` constructor parameter have been deprecated. The schema
14+ automatically derives namespace names from the names of its tables and sequences. Creating empty namespaces is
15+ deprecated.
16+
1117## Deprecated ` TableDiff::getDroppedForeignKeys() `
1218
1319The ` TableDiff::getDroppedForeignKeys() ` method has been deprecated. Use
Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ public function __construct(
8989 ?SchemaConfig $ schemaConfig = null ,
9090 array $ namespaces = [],
9191 ) {
92+ if (count ($ namespaces ) > 0 ) {
93+ Deprecation::triggerIfCalledFromOutside (
94+ 'doctrine/dbal ' ,
95+ 'https://github.com/doctrine/dbal/pull/7186 ' ,
96+ 'Passing the $namespaces argument to the Schema constructor is deprecated. ' ,
97+ );
98+ }
99+
92100 $ schemaConfig ??= new SchemaConfig ();
93101
94102 $ this ->_schemaConfig = $ schemaConfig ;
@@ -352,10 +360,21 @@ public function getSequences(): array
352360 /**
353361 * Creates a new namespace.
354362 *
363+ * @deprecated The schema automatically derives namespaces from the names of its tables and sequences.
364+ * Creating empty namespaces is deprecated.
365+ *
355366 * @return $this
356367 */
357368 public function createNamespace (string $ name ): self
358369 {
370+ Deprecation::triggerIfCalledFromOutside (
371+ 'doctrine/dbal ' ,
372+ 'https://github.com/doctrine/dbal/pull/7186 ' ,
373+ '%s is deprecated. The schema automatically derives namespaces from the names of its tables and '
374+ . ' sequences. Creating empty namespaces is deprecated. ' ,
375+ __METHOD__ ,
376+ );
377+
359378 $ unquotedName = strtolower ($ this ->getUnquotedAssetName ($ name ));
360379
361380 if (isset ($ this ->namespaces [$ unquotedName ])) {
You can’t perform that action at this time.
0 commit comments