File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,6 +83,20 @@ public function addUniqueConstraint(
8383 return $ this ;
8484 }
8585
86+ #[\Override]
87+ public function hasUniqueConstraint (string $ name ): bool {
88+ return $ this ->table ->hasUniqueConstraint ($ name );
89+ }
90+
91+ #[\Override]
92+ public function removeUniqueConstraint (string $ name ): void {
93+ try {
94+ $ this ->table ->removeUniqueConstraint ($ name );
95+ } catch (DBALSchemaException $ e ) {
96+ throw new SchemaException ($ e ->getMessage (), $ e ->getCode (), $ e );
97+ }
98+ }
99+
86100 #[\Override]
87101 public function dropPrimaryKey (): self {
88102 try {
@@ -101,6 +115,11 @@ public function getPrimaryKey(): ?IIndex {
101115 return $ primaryKey !== null ? new Index ($ primaryKey ) : null ;
102116 }
103117
118+ #[\Override]
119+ public function hasPrimaryKey (): bool {
120+ return $ this ->table ->hasPrimaryKey ();
121+ }
122+
104123 #[\Override]
105124 public function dropIndex (string $ name ): self {
106125 try {
Original file line number Diff line number Diff line change @@ -62,6 +62,24 @@ public function addUniqueConstraint(
6262 array $ options = [],
6363 ): self ;
6464
65+ /**
66+ * Returns whether this table has a unique constraint with the given name.
67+ *
68+ * @param non-empty-string $name The unique constraint name.
69+ * @since 35.0.0
70+ */
71+ public function hasUniqueConstraint (string $ name ): bool ;
72+
73+ /**
74+ * Removes the unique constraint with the given name.
75+ *
76+ * @param non-empty-string $name The unique constraint name.
77+ *
78+ * @throws SchemaException If the unique constraint does not exist.
79+ * @since 35.0.0
80+ */
81+ public function removeUniqueConstraint (string $ name ): void ;
82+
6583 /**
6684 * Drops the primary key from this table.
6785 *
@@ -77,6 +95,13 @@ public function dropPrimaryKey(): self;
7795 */
7896 public function getPrimaryKey (): ?IIndex ;
7997
98+ /**
99+ * Returns whether this table has a primary key.
100+ *
101+ * @since 35.0.0
102+ */
103+ public function hasPrimaryKey (): bool ;
104+
80105 /**
81106 * Drops an index from this table.
82107 *
You can’t perform that action at this time.
0 commit comments