migrations/Version20220226151216.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 Version20220226151216 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $this->addSql('CREATE TABLE logged_time (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, project_id INT NOT NULL, description LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, work_time DOUBLE PRECISION NOT NULL, toggl_id LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, INDEX IDX_4DF19E6CA76ED395 (user_id), INDEX IDX_4DF19E6C166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  20.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  21.         $this->addSql('CREATE TABLE max_time_project (id INT AUTO_INCREMENT NOT NULL, project_id INT NOT NULL, hour_limit DOUBLE PRECISION NOT NULL, month_of_limit DATE NOT NULL, INDEX IDX_D058E250166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  22.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  23.         $this->addSql('CREATE TABLE project (id INT AUTO_INCREMENT NOT NULL, leader_id INT DEFAULT NULL, client_id INT DEFAULT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, description LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, price DOUBLE PRECISION NOT NULL, description_for_user LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, slack_channel_id VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_2FB3D0EE73154ED4 (leader_id), INDEX IDX_2FB3D0EE19EB6921 (client_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  24.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  25.         $this->addSql('CREATE TABLE project_user (project_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_B4021E51166D1F9C (project_id), INDEX IDX_B4021E51A76ED395 (user_id), PRIMARY KEY(project_id, user_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  26.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  27.         $this->addSql('CREATE TABLE task (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, project_id INT NOT NULL, name LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, content LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', planned_on_day DATETIME NOT NULL, INDEX IDX_527EDB25A76ED395 (user_id), INDEX IDX_527EDB25166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  28.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  29.         $this->addSql('CREATE TABLE time_description (id INT AUTO_INCREMENT NOT NULL, category_id INT DEFAULT NULL, content LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_B3D744CF12469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  30.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  31.         $this->addSql('CREATE TABLE time_description_category (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  32.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  33.         $this->addSql('CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, roles LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci` COMMENT \'(DC2Type:json)\', password VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, toggl_token LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, color VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  34.     }
  35.     public function down(Schema $schema): void
  36.     {
  37.         // this down() migration is auto-generated, please modify it to your needs
  38.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  39.         $this->addSql('DROP TABLE logged_time');
  40.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  41.         $this->addSql('DROP TABLE max_time_project');
  42.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  43.         $this->addSql('DROP TABLE project');
  44.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  45.         $this->addSql('DROP TABLE project_user');
  46.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  47.         $this->addSql('DROP TABLE task');
  48.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  49.         $this->addSql('DROP TABLE time_description');
  50.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  51.         $this->addSql('DROP TABLE time_description_category');
  52.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  53.         $this->addSql('DROP TABLE user');
  54.     }
  55. }