Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php declare(strict_types = 1);
- namespace DoctrineMigrations;
- use Doctrine\DBAL\Migrations\AbstractMigration;
- use Doctrine\DBAL\Schema\Schema;
- /**
- * Auto-generated Migration: Please modify to your needs!
- */
- class Version20180409165522 extends AbstractMigration
- {
- public function up(Schema $schema)
- {
- // this up() migration is auto-generated, please modify it to your needs
- $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
- $this->addSql('ALTER TABLE TyreData CHANGE id id INT AUTO_INCREMENT NOT NULL');
- $this->addSql('ALTER TABLE TyreData ADD CONSTRAINT FK_F603601B44F5D008 FOREIGN KEY (brand_id) REFERENCES tyre_mark (id)');
- $this->addSql('ALTER TABLE TyreData ADD CONSTRAINT FK_F603601B498DA827 FOREIGN KEY (size_id) REFERENCES tyre_size (id)');
- $this->addSql('ALTER TABLE TyreData ADD CONSTRAINT FK_F603601B84337261 FOREIGN KEY (index_id) REFERENCES tyre_index (id)');
- $this->addSql('ALTER TABLE TyreData ADD CONSTRAINT FK_F603601B7975B7E7 FOREIGN KEY (model_id) REFERENCES tail_model (id)');
- $this->addSql('ALTER TABLE TyreData ADD CONSTRAINT FK_F603601B44DE2601 FOREIGN KEY (cai_id) REFERENCES tyre_cai (id)');
- $this->addSql('CREATE INDEX IDX_F603601B44F5D008 ON TyreData (brand_id)');
- $this->addSql('CREATE INDEX IDX_F603601B498DA827 ON TyreData (size_id)');
- $this->addSql('CREATE INDEX IDX_F603601B84337261 ON TyreData (index_id)');
- $this->addSql('CREATE INDEX IDX_F603601B7975B7E7 ON TyreData (model_id)');
- $this->addSql('CREATE INDEX IDX_F603601B44DE2601 ON TyreData (cai_id)');
- }
- public function down(Schema $schema)
- {
- // this down() migration is auto-generated, please modify it to your needs
- $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
- $this->addSql('ALTER TABLE TyreData DROP FOREIGN KEY FK_F603601B44F5D008');
- $this->addSql('ALTER TABLE TyreData DROP FOREIGN KEY FK_F603601B498DA827');
- $this->addSql('ALTER TABLE TyreData DROP FOREIGN KEY FK_F603601B84337261');
- $this->addSql('ALTER TABLE TyreData DROP FOREIGN KEY FK_F603601B7975B7E7');
- $this->addSql('ALTER TABLE TyreData DROP FOREIGN KEY FK_F603601B44DE2601');
- $this->addSql('DROP INDEX IDX_F603601B44F5D008 ON TyreData');
- $this->addSql('DROP INDEX IDX_F603601B498DA827 ON TyreData');
- $this->addSql('DROP INDEX IDX_F603601B84337261 ON TyreData');
- $this->addSql('DROP INDEX IDX_F603601B7975B7E7 ON TyreData');
- $this->addSql('DROP INDEX IDX_F603601B44DE2601 ON TyreData');
- $this->addSql('ALTER TABLE TyreData CHANGE id id INT NOT NULL');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement