Skip to content

Commit 5e024e7

Browse files
committed
Merge branch '3.5.x' into 4.0.x
2 parents 69d83bb + 1ebda1c commit 5e024e7

File tree

3 files changed

+61
-11
lines changed

3 files changed

+61
-11
lines changed

UPGRADE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,25 @@ The following methods have been removed.
778778

779779
# Upgrade to 3.5
780780

781+
## Deprecated `SchemaException` error codes.
782+
783+
Relying on the error code of `SchemaException` is deprecated. In order to handle a specific type of exception,
784+
catch the corresponding exception class instead.
785+
786+
| Error Code | Class |
787+
|-----------------------------|--------------------------------|
788+
| `TABLE_DOESNT_EXIST` | `TableDoesNotExist` |
789+
| `TABLE_ALREADY_EXISTS` | `TableAlreadyExists` |
790+
| `COLUMN_DOESNT_EXIST` | `ColumnDoesNotExist` |
791+
| `COLUMN_ALREADY_EXISTS` | `ColumnAlreadyExists` |
792+
| `INDEX_DOESNT_EXIST` | `IndexDoesNotExist` |
793+
| `INDEX_ALREADY_EXISTS` | `IndexAlreadyExists` |
794+
| `SEQUENCE_DOENST_EXIST` | `SequenceDoesNotExist` |
795+
| `SEQUENCE_ALREADY_EXISTS` | `SequenceAlreadyExists` |
796+
| `FOREIGNKEY_DOESNT_EXIST` | `ForeignKeyDoesNotExist` |
797+
| `CONSTRAINT_DOESNT_EXIST` | `UniqueConstraintDoesNotExist` |
798+
| `NAMESPACE_ALREADY_EXISTS` | `NamespaceAlreadyExists` |
799+
781800
## Deprecated fallback connection used to determine the database platform.
782801

783802
Relying on a fallback connection used to determine the database platform while connecting to a non-existing database

psalm.xml.dist

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232
<file name="src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php"/>
3333
</errorLevel>
3434
</ConflictingReferenceConstraint>
35+
<DeprecatedConstant>
36+
<errorLevel type="suppress">
37+
<!--
38+
TODO: remove in 4.0.0
39+
-->
40+
<directory name="src/Schema/Exception"/>
41+
</errorLevel>
42+
</DeprecatedConstant>
3543
<DeprecatedMethod>
3644
<errorLevel type="suppress">
3745
<!--

src/Schema/SchemaException.php

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,39 @@
99
/** @psalm-immutable */
1010
class SchemaException extends \Exception implements Exception
1111
{
12-
public const TABLE_DOESNT_EXIST = 10;
13-
public const TABLE_ALREADY_EXISTS = 20;
14-
public const COLUMN_DOESNT_EXIST = 30;
15-
public const COLUMN_ALREADY_EXISTS = 40;
16-
public const INDEX_DOESNT_EXIST = 50;
17-
public const INDEX_ALREADY_EXISTS = 60;
18-
public const SEQUENCE_DOENST_EXIST = 70;
19-
public const SEQUENCE_ALREADY_EXISTS = 80;
20-
public const INDEX_INVALID_NAME = 90;
21-
public const FOREIGNKEY_DOESNT_EXIST = 100;
22-
public const CONSTRAINT_DOESNT_EXIST = 110;
12+
/** @deprecated Use {@see TableDoesNotExist} instead. */
13+
public const TABLE_DOESNT_EXIST = 10;
14+
15+
/** @deprecated Use {@see TableAlreadyExists} instead. */
16+
public const TABLE_ALREADY_EXISTS = 20;
17+
18+
/** @deprecated Use {@see ColumnDoesNotExist} instead. */
19+
public const COLUMN_DOESNT_EXIST = 30;
20+
21+
/** @deprecated Use {@see ColumnAlreadyExists} instead. */
22+
public const COLUMN_ALREADY_EXISTS = 40;
23+
24+
/** @deprecated Use {@see IndexDoesNotExist} instead. */
25+
public const INDEX_DOESNT_EXIST = 50;
26+
27+
/** @deprecated Use {@see IndexAlreadyExists} instead. */
28+
public const INDEX_ALREADY_EXISTS = 60;
29+
30+
/** @deprecated Use {@see SequenceDoesNotExist} instead. */
31+
public const SEQUENCE_DOENST_EXIST = 70;
32+
33+
/** @deprecated Use {@see SequenceAlreadyExists} instead. */
34+
public const SEQUENCE_ALREADY_EXISTS = 80;
35+
36+
/** @deprecated Use {@see IndexNameInvalid} instead. */
37+
public const INDEX_INVALID_NAME = 90;
38+
39+
/** @deprecated Use {@see ForeignKeyDoesNotExist} instead. */
40+
public const FOREIGNKEY_DOESNT_EXIST = 100;
41+
42+
/** @deprecated Use {@see UniqueConstraintDoesNotExist} instead. */
43+
public const CONSTRAINT_DOESNT_EXIST = 110;
44+
45+
/** @deprecated Use {@see NamespaceAlreadyExists} instead. */
2346
public const NAMESPACE_ALREADY_EXISTS = 120;
2447
}

0 commit comments

Comments
 (0)