migrations/Version20220829150551.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 Version20220829150551 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` (id INT AUTO_INCREMENT NOT NULL, datetime DATETIME NOT NULL, tot_ht DOUBLE PRECISION DEFAULT NULL, tot_tva DOUBLE PRECISION DEFAULT NULL, tot_ttc DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
            $this->addSql('CREATE TABLE order_details (id INT AUTO_INCREMENT NOT NULL, order_origin_id INT DEFAULT NULL, product_type VARCHAR(255) NOT NULL, product_id INT DEFAULT NULL, product_name VARCHAR(255) DEFAULT NULL, price_ht DOUBLE PRECISION DEFAULT NULL, tx_tva DOUBLE PRECISION DEFAULT NULL, INDEX IDX_845CA2C1EA250834 (order_origin_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
            $this->addSql('ALTER TABLE order_details ADD CONSTRAINT FK_845CA2C1EA250834 FOREIGN KEY (order_origin_id) REFERENCES `order` (id)');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('ALTER TABLE order_details DROP FOREIGN KEY FK_845CA2C1EA250834');
            $this->addSql('DROP TABLE `order`');
            $this->addSql('DROP TABLE order_details');
        }
    }