Skip to content

Commit 96e5c5e

Browse files
committed
add-fixtures -- add migration for changed field
1 parent 2e28312 commit 96e5c5e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
/**
11+
* Auto-generated Migration: Please modify to your needs!
12+
*/
13+
final class Version20221101135657 extends AbstractMigration
14+
{
15+
public function getDescription() : string
16+
{
17+
return '';
18+
}
19+
20+
public function up(Schema $schema) : void
21+
{
22+
// this up() migration is auto-generated, please modify it to your needs
23+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
24+
25+
$this->addSql('DROP INDEX UNIQ_957A6479D0494586 ON fos_user');
26+
$this->addSql('ALTER TABLE fos_user CHANGE user_identifier unique_identifier VARCHAR(255) NOT NULL');
27+
$this->addSql('CREATE UNIQUE INDEX UNIQ_957A64796BD2BEA0 ON fos_user (unique_identifier)');
28+
}
29+
30+
public function down(Schema $schema) : void
31+
{
32+
// this down() migration is auto-generated, please modify it to your needs
33+
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
34+
35+
$this->addSql('DROP INDEX UNIQ_957A64796BD2BEA0 ON fos_user');
36+
$this->addSql('ALTER TABLE fos_user CHANGE unique_identifier user_identifier VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
37+
$this->addSql('CREATE UNIQUE INDEX UNIQ_957A6479D0494586 ON fos_user (user_identifier)');
38+
}
39+
}

0 commit comments

Comments
 (0)