migrations/Version20210930134418.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20210930134418 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE alert (id INT AUTO_INCREMENT NOT NULL, alert_level INT NOT NULL, message VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, color VARCHAR(255) NOT NULL, icon_link VARCHAR(255) DEFAULT NULL, notification_freq INT NOT NULL, notification_type VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE alert_product (id INT AUTO_INCREMENT NOT NULL, alert_level INT NOT NULL, sku VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE competitor_product (id INT AUTO_INCREMENT NOT NULL, sku VARCHAR(255) NOT NULL, competitor_id INT NOT NULL, product_url VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('CREATE TABLE general_configuration (id INT AUTO_INCREMENT NOT NULL, website_id INT NOT NULL, sync_freq_m2 INT NOT NULL, api_m2_connection VARCHAR(255) DEFAULT NULL, sync_freq_aclass INT NOT NULL, sync_freq_bclass INT NOT NULL, sync_freq_cclass INT NOT NULL, sync_freq_default INT NOT NULL, custom_attribute1 VARCHAR(255) DEFAULT NULL, custom_attribute2 VARCHAR(255) DEFAULT NULL, custom_attribute3 VARCHAR(255) DEFAULT NULL, custom_attribute4 VARCHAR(255) DEFAULT NULL, categories JSON DEFAULT NULL, cat_attribute VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  22.         $this->addSql('CREATE TABLE product (id INT AUTO_INCREMENT NOT NULL, sku VARCHAR(255) NOT NULL, website_id INT NOT NULL, name VARCHAR(255) NOT NULL, url VARCHAR(255) NOT NULL, img_product VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, product_type VARCHAR(255) DEFAULT NULL, price_type VARCHAR(255) NOT NULL, stock INT NOT NULL, stock_status VARCHAR(255) NOT NULL, normal_price NUMERIC(10, 2) NOT NULL, price_excl_tax NUMERIC(10, 2) NOT NULL, special_price NUMERIC(10, 2) NOT NULL, special_price_start_date DATETIME DEFAULT NULL, special_price_end_date DATETIME DEFAULT NULL, public_price_msrp NUMERIC(10, 2) NOT NULL, purchasing_price NUMERIC(10, 2) NOT NULL, unit_cost NUMERIC(10, 2) DEFAULT NULL, tva_class NUMERIC(10, 2) NOT NULL, abc_class VARCHAR(255) NOT NULL, custom_attribute1 VARCHAR(255) DEFAULT NULL, custom_attribute2 VARCHAR(255) DEFAULT NULL, custom_attribute3 VARCHAR(255) DEFAULT NULL, custom_attribute4 VARCHAR(255) DEFAULT NULL, cat_product_name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('DROP TABLE alert');
  28.         $this->addSql('DROP TABLE alert_product');
  29.         $this->addSql('DROP TABLE competitor_product');
  30.         $this->addSql('DROP TABLE general_configuration');
  31.         $this->addSql('DROP TABLE product');
  32.     }
  33. }