29 lines
		
	
	
		
			842 B
		
	
	
	
		
			PHP
		
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			842 B
		
	
	
	
		
			PHP
		
	
	
	
<?php
 | 
						|
 | 
						|
declare(strict_types=1);
 | 
						|
 | 
						|
namespace DoctrineMigrations;
 | 
						|
 | 
						|
use Doctrine\DBAL\Schema\Schema;
 | 
						|
use Doctrine\Migrations\AbstractMigration;
 | 
						|
 | 
						|
final class Version20251028070614 extends AbstractMigration
 | 
						|
{
 | 
						|
    public function getDescription(): string
 | 
						|
    {
 | 
						|
        return 'Add RegistationToken entity';
 | 
						|
    }
 | 
						|
 | 
						|
    public function up(Schema $schema): void
 | 
						|
    {
 | 
						|
        $this->addSql('CREATE TABLE registration_token (id BLOB NOT NULL --(DC2Type:uuid)
 | 
						|
        , user_id INTEGER DEFAULT NULL, PRIMARY KEY(id), CONSTRAINT FK_D09D01D3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) NOT DEFERRABLE INITIALLY IMMEDIATE)');
 | 
						|
        $this->addSql('CREATE UNIQUE INDEX UNIQ_D09D01D3A76ED395 ON registration_token (user_id)');
 | 
						|
    }
 | 
						|
 | 
						|
    public function down(Schema $schema): void
 | 
						|
    {
 | 
						|
        $this->addSql('DROP TABLE registration_token');
 | 
						|
    }
 | 
						|
}
 |