addSql('CREATE TABLE stock (id INT AUTO_INCREMENT NOT NULL, warehouse_id_id INT DEFAULT NULL, product_id VARCHAR(255) NOT NULL, stock INT NOT NULL, update_time DATETIME DEFAULT NULL, INDEX IDX_4B365660FE25E29A (warehouse_id_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('CREATE TABLE warehouse (id INT AUTO_INCREMENT NOT NULL, priority INT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('ALTER TABLE stock ADD CONSTRAINT FK_4B365660FE25E29A FOREIGN KEY (warehouse_id_id) REFERENCES warehouse (id)'); $this->addSql('ALTER TABLE orders CHANGE status status INT NOT NULL'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660FE25E29A'); $this->addSql('DROP TABLE stock'); $this->addSql('DROP TABLE warehouse'); $this->addSql('ALTER TABLE orders CHANGE status status INT DEFAULT NULL'); } }