migrations/Version20221129101632.php line 1

Open in your IDE?
  1. <?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 Version20221129101632 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 order_supplier_detail (id INT AUTO_INCREMENT NOT NULL, order_supplier_id INT NOT NULL, frame_id INT NOT NULL, quantity INT NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_3E6D6E1B316F120A (order_supplier_id), INDEX IDX_3E6D6E1B3FA3C347 (frame_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
            $this->addSql('ALTER TABLE order_supplier_detail ADD CONSTRAINT FK_3E6D6E1B316F120A FOREIGN KEY (order_supplier_id) REFERENCES order_supplier (id)');
            $this->addSql('ALTER TABLE order_supplier_detail ADD CONSTRAINT FK_3E6D6E1B3FA3C347 FOREIGN KEY (frame_id) REFERENCES frame (id)');
            $this->addSql('ALTER TABLE cart_detail ADD created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('DROP TABLE order_supplier_detail');
            $this->addSql('ALTER TABLE cart_detail DROP created_at, DROP updated_at, DROP deleted_at');
        }
    }