8000 feat(migration): add user migration · sjunior-dev/symfony-api-test@ec2a9b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec2a9b5

Browse files
committed
feat(migration): add user migration
1 parent ccedd03 commit ec2a9b5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

migrations/Version20240531181347.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 Version20240531181347 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->addSql('CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, reference BINARY(16) NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, removed_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL (email), UNIQUE INDEX UNIQ_IDENTIFIER_REFERENCE (reference), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4');
24+
}
25+
26+
public function down(Schema $schema): void
27+
{
28+
// this down() migration is auto-generated, please modify it to your needs
29+
$this->addSql('DROP TABLE users');
30+
}
31+
}

0 commit comments

Comments
 (0)
0