You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							45 lines
						
					
					
						
							2.9 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							45 lines
						
					
					
						
							2.9 KiB
						
					
					
				| <?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 Version20210326143537 extends AbstractMigration | |
| { | |
|     public function getDescription() : string | |
|     { | |
|         return ''; | |
|     } | |
| 
 | |
|     public function up(Schema $schema) : void | |
|     { | |
|         // this up() migration is auto-generated, please modify it to your needs | |
|         $this->addSql('ALTER TABLE pokemon DROP FOREIGN KEY FK_62DC90F3553A6EC4'); | |
|         $this->addSql('ALTER TABLE pokemon DROP FOREIGN KEY FK_62DC90F3AD1A0C0F'); | |
|         $this->addSql('ALTER TABLE pokemon DROP FOREIGN KEY FK_62DC90F3BFAFA3E1'); | |
|         $this->addSql('CREATE TABLE generation_poke (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | |
|         $this->addSql('CREATE TABLE type_poke (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); | |
|         $this->addSql('DROP TABLE generation'); | |
|         $this->addSql('DROP TABLE pokemon'); | |
|         $this->addSql('DROP TABLE type'); | |
|     } | |
| 
 | |
|     public function down(Schema $schema) : void | |
|     { | |
|         // this down() migration is auto-generated, please modify it to your needs | |
|         $this->addSql('CREATE TABLE generation (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); | |
|         $this->addSql('CREATE TABLE pokemon (id INT AUTO_INCREMENT NOT NULL, type1_id INT NOT NULL, type2_id INT DEFAULT NULL, generation_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, vie INT NOT NULL, attaque INT NOT NULL, defense INT NOT NULL, legendaire TINYINT(1) NOT NULL, INDEX IDX_62DC90F3553A6EC4 (generation_id), INDEX IDX_62DC90F3BFAFA3E1 (type1_id), INDEX IDX_62DC90F3AD1A0C0F (type2_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); | |
|         $this->addSql('CREATE TABLE type (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' '); | |
|         $this->addSql('ALTER TABLE pokemon ADD CONSTRAINT FK_62DC90F3553A6EC4 FOREIGN KEY (generation_id) REFERENCES generation (id)'); | |
|         $this->addSql('ALTER TABLE pokemon ADD CONSTRAINT FK_62DC90F3AD1A0C0F FOREIGN KEY (type2_id) REFERENCES type (id)'); | |
|         $this->addSql('ALTER TABLE pokemon ADD CONSTRAINT FK_62DC90F3BFAFA3E1 FOREIGN KEY (type1_id) REFERENCES type (id)'); | |
|         $this->addSql('DROP TABLE generation_poke'); | |
|         $this->addSql('DROP TABLE type_poke'); | |
|     } | |
| }
 | |
| 
 |