migrations/Version20230720153118.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 Version20230720153118 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 accessory (id INT AUTO_INCREMENT NOT NULL, product_category_id INT NOT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_A1B1251CBE6903FD (product_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE product_trade_in_accessory (product_trade_in_id INT NOT NULL, accessory_id INT NOT NULL, INDEX IDX_26946F8D96DB30CF (product_trade_in_id), INDEX IDX_26946F8D27E8CC78 (accessory_id), PRIMARY KEY(product_trade_in_id, accessory_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE accessory ADD CONSTRAINT FK_A1B1251CBE6903FD FOREIGN KEY (product_category_id) REFERENCES product_categorie (id)');$this->addSql('ALTER TABLE product_trade_in_accessory ADD CONSTRAINT FK_26946F8D96DB30CF FOREIGN KEY (product_trade_in_id) REFERENCES product_trade_in (id) ON DELETE CASCADE');$this->addSql('ALTER TABLE product_trade_in_accessory ADD CONSTRAINT FK_26946F8D27E8CC78 FOREIGN KEY (accessory_id) REFERENCES accessory (id) ON DELETE CASCADE');$this->addSql('ALTER TABLE product_trade_in ADD more_accessory LONGTEXT DEFAULT NULL, ADD serial_number VARCHAR(30) DEFAULT NULL, ADD warranty_duration INT DEFAULT NULL, ADD ps_selling_id INT DEFAULT NULL, ADD selled TINYINT(1) DEFAULT 0, ADD selled_price DOUBLE PRECISION DEFAULT NULL');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE accessory DROP FOREIGN KEY FK_A1B1251CBE6903FD');$this->addSql('ALTER TABLE product_trade_in_accessory DROP FOREIGN KEY FK_26946F8D96DB30CF');$this->addSql('ALTER TABLE product_trade_in_accessory DROP FOREIGN KEY FK_26946F8D27E8CC78');$this->addSql('DROP TABLE accessory');$this->addSql('DROP TABLE product_trade_in_accessory');$this->addSql('ALTER TABLE product_trade_in DROP more_accessory, DROP serial_number, DROP warranty_duration, DROP ps_selling_id, DROP selled, DROP selled_price');}}