|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace DoctrineMigrations; |
| 6 | + |
| 7 | +use Doctrine\DBAL\Schema\Schema; |
| 8 | +use Doctrine\Migrations\AbstractMigration; |
| 9 | + |
| 10 | +/** |
| 11 | + * Auto-generated Migration: Please modify to your needs! |
| 12 | + */ |
| 13 | +final class Version20241030160055 extends AbstractMigration |
| 14 | +{ |
| 15 | + public function getDescription(): string |
| 16 | + { |
| 17 | + return ''; |
| 18 | + } |
| 19 | + |
| 20 | + public function up(Schema $schema): void |
| 21 | + { |
| 22 | + // this up() migration is auto-generated, please modify it to your needs |
| 23 | + $this->addSql('DROP SEQUENCE user_id_seq CASCADE'); |
| 24 | + $this->addSql('CREATE SEQUENCE users_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
| 25 | + $this->addSql('CREATE TABLE users (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, email VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); |
| 26 | + $this->addSql('COMMENT ON COLUMN users.birth_date IS \'(DC2Type:datetime_immutable)\''); |
| 27 | + $this->addSql('DROP TABLE "user"'); |
| 28 | + } |
| 29 | + |
| 30 | + public function down(Schema $schema): void |
| 31 | + { |
| 32 | + // this down() migration is auto-generated, please modify it to your needs |
| 33 | + $this->addSql('CREATE SCHEMA public'); |
| 34 | + $this->addSql('DROP SEQUENCE users_id_seq CASCADE'); |
| 35 | + $this->addSql('CREATE SEQUENCE user_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); |
| 36 | + $this->addSql('CREATE TABLE "user" (id INT NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, birth_date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, email VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))'); |
| 37 | + $this->addSql('COMMENT ON COLUMN "user".birth_date IS \'(DC2Type:datetime_immutable)\''); |
| 38 | + $this->addSql('DROP TABLE users'); |
| 39 | + } |
| 40 | +} |
0 commit comments