-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c28591
commit bac390b
Showing
29 changed files
with
281 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DoctrineMigrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
final class Version20230217084031 extends AbstractMigration | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return 'Migrating integer ids to UUIDs'; | ||
} | ||
|
||
public function up(Schema $schema): void | ||
{ | ||
// this up() migration is auto-generated, please modify it to your needs | ||
$this->addSql('ALTER TABLE dinosaur DROP FOREIGN KEY FK_DAEDC56EB2A1D860'); | ||
$this->addSql('ALTER TABLE dinosaur CHANGE id id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', CHANGE species_id species_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\''); | ||
$this->addSql('ALTER TABLE species CHANGE id id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\''); | ||
$this->addSql('ALTER TABLE dinosaur ADD CONSTRAINT FK_DAEDC56EB2A1D860 FOREIGN KEY (species_id) REFERENCES species (id)'); | ||
} | ||
|
||
public function down(Schema $schema): void | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->addSql('ALTER TABLE dinosaur DROP FOREIGN KEY FK_DAEDC56EB2A1D860'); | ||
$this->addSql('ALTER TABLE dinosaur CHANGE id id INT AUTO_INCREMENT NOT NULL, CHANGE species_id species_id INT DEFAULT NULL'); | ||
$this->addSql('ALTER TABLE species CHANGE id id INT AUTO_INCREMENT NOT NULL'); | ||
$this->addSql('ALTER TABLE dinosaur ADD CONSTRAINT FK_DAEDC56EB2A1D860 FOREIGN KEY (species_id) REFERENCES species (id)'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.