File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
packages/database/src/Manager Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,10 @@ public function update(Schema|callable $schema): static
9090 $ this ->dropIndex ($ index ->indexName );
9191 }
9292
93+ if ($ this ->hasConstraint ($ index ->indexName )) {
94+ $ this ->dropConstraint ($ index ->indexName );
95+ }
96+
9397 $ this ->addIndex ($ index );
9498 }
9599
@@ -98,6 +102,10 @@ public function update(Schema|callable $schema): static
98102 $ this ->dropConstraint ($ constraint ->constraintName );
99103 }
100104
105+ if ($ this ->hasIndex ($ constraint ->constraintName )) {
106+ $ this ->dropIndex ($ constraint ->constraintName );
107+ }
108+
101109 $ this ->addConstraint ($ constraint );
102110 }
103111
@@ -428,7 +436,7 @@ public function dropIndex(array|string $names): static
428436 $ platform = $ this ->getPlatform ();
429437
430438 foreach ((array ) $ names as $ name ) {
431- if (! $ this ->hasIndex ($ name )) {
439+ if ($ this ->hasIndex ($ name )) {
432440 $ platform ->dropIndex ($ this ->getName (), $ name , $ this ->schemaName );
433441 }
434442 }
You can’t perform that action at this time.
0 commit comments