File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 Version20260713143513 extends AbstractMigration
11+ {
12+ public function getDescription (): string
13+ {
14+ return 'Convert the vcs package fetch strategy to source to preserve behavior of existing packages ' ;
15+ }
16+
17+ public function up (Schema $ schema ): void
18+ {
19+ // Previously the vcs fetch strategy used the default Composer drivers (using APIs where
20+ // possible), which is now the behavior of the source fetch strategy. The vcs fetch
21+ // strategy now always clones repositories instead.
22+ $ this ->addSql (<<<'SQL'
23+ UPDATE package SET fetch_strategy = 'source' WHERE fetch_strategy = 'vcs'
24+ SQL);
25+ // Packages without a fetch strategy or mirror registry fell back to the vcs fetch strategy.
26+ $ this ->addSql (<<<'SQL'
27+ UPDATE package SET fetch_strategy = 'source' WHERE fetch_strategy IS NULL AND mirror_registry_id IS NULL
28+ SQL);
29+ }
30+
31+ public function down (Schema $ schema ): void
32+ {
33+ $ this ->addSql (<<<'SQL'
34+ UPDATE package SET fetch_strategy = 'vcs' WHERE fetch_strategy = 'source'
35+ SQL);
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments