migrations/Version20231108111849.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;/*** Auto-generated Migration: Please modify to your needs!*/final class Version20231108111849 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('CREATE TABLE residence_immeuble (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(100) NOT NULL, libelle VARCHAR(50) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE residence ADD immeuble_id INT DEFAULT NULL');$this->addSql('ALTER TABLE residence ADD CONSTRAINT FK_327582363768E3F FOREIGN KEY (immeuble_id) REFERENCES residence_immeuble (id)');$this->addSql('CREATE INDEX IDX_327582363768E3F ON residence (immeuble_id)');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE residence DROP FOREIGN KEY FK_327582363768E3F');$this->addSql('DROP TABLE residence_immeuble');$this->addSql('DROP INDEX IDX_327582363768E3F ON residence');$this->addSql('ALTER TABLE residence DROP immeuble_id');}}