migrations/Version20251031143000.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 Version20251031143000 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Create app_discount table';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('CREATE TABLE app_discount (
  18.             id INT AUTO_INCREMENT NOT NULL,
  19.             title VARCHAR(255) NOT NULL,
  20.             description LONGTEXT DEFAULT NULL,
  21.             start_date DATETIME NOT NULL,
  22.             end_date DATETIME NOT NULL,
  23.             lien VARCHAR(255) DEFAULT NULL,
  24.             is_enabled TINYINT(1) NOT NULL,
  25.             image LONGTEXT DEFAULT NULL,
  26.             PRIMARY KEY(id)
  27.         ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         $this->addSql('DROP TABLE app_discount');
  32.     }
  33. }