migrations/Version20220412060231.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 Version20220412060231 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Add local basket table';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('CREATE TABLE local_basket (id SERIAL NOT NULL, uuid VARCHAR(37) NOT NULL, product_id INT NOT NULL, quantity INT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
  18.         $this->addSql('COMMENT ON COLUMN local_basket.created_at IS \'(DC2Type:datetime_immutable)\'');
  19.         $this->addSql('COMMENT ON COLUMN local_basket.updated_at IS \'(DC2Type:datetime_immutable)\'');
  20.         $this->addSql('COMMENT ON COLUMN local_basket.deleted_at IS \'(DC2Type:datetime_immutable)\'');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         $this->addSql('DROP TABLE local_basket');
  25.     }
  26. }