File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace DoctrineMigrations ;
6+
7+ use Doctrine \DBAL \Schema \Schema ;
8+ use Doctrine \Migrations \AbstractMigration ;
9+
10+ final class Version20241219124023 extends AbstractMigration
11+ {
12+ public function getDescription (): string
13+ {
14+ return 'Add unique package name constraint ' ;
15+ }
16+
17+ public function up (Schema $ schema ): void
18+ {
19+ $ this ->addSql ('SELECT 1 ' );
20+ }
21+
22+ public function down (Schema $ schema ): void
23+ {
24+ $ this ->addSql ('DROP INDEX package_name_idx ' );
25+ }
26+ }
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public function getDescription(): string
1717 public function up (Schema $ schema ): void
1818 {
1919 $ this ->addSql ('CREATE UNIQUE INDEX package_name_idx ON package (name) ' );
20+ $ this ->addSql ('SELECT 1 ' );
2021 }
2122
2223 public function down (Schema $ schema ): void
You can’t perform that action at this time.
0 commit comments