migrations/Version20200904204817.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 Version20200904204817 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('ALTER TABLE checking_account_movement DROP FOREIGN KEY FK_E22B6B12F0B3EF62');
  20.         $this->addSql('DROP TABLE checking_account');
  21.         $this->addSql('DROP TABLE checking_account_movement');
  22.     }
  23.     public function down(Schema $schema) : void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  27.         $this->addSql('CREATE TABLE checking_account (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, isEnable TINYINT(1) NOT NULL, total NUMERIC(10, 2) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, idClient INT DEFAULT NULL, balance NUMERIC(10, 2) NOT NULL, INDEX IDX_23EB7C35B03A8386 (created_by_id), INDEX IDX_23EB7C35896DBBDE (updated_by_id), INDEX IDX_23EB7C35A455ACCF (idClient), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  28.         $this->addSql('CREATE TABLE checking_account_movement (id INT AUTO_INCREMENT NOT NULL, checking_account_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, updated_by_id INT DEFAULT NULL, movement_type VARCHAR(20) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, amount NUMERIC(10, 2) NOT NULL, notes TEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, balance NUMERIC(10, 2) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_C5DB54A0B03A8386 (created_by_id), INDEX IDX_C5DB54A0896DBBDE (updated_by_id), INDEX IDX_C5DB54A0F0B3EF62 (checking_account_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  29.         $this->addSql('ALTER TABLE checking_account ADD CONSTRAINT FK_23EB7C35896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
  30.         $this->addSql('ALTER TABLE checking_account ADD CONSTRAINT FK_23EB7C35A455ACCF FOREIGN KEY (idClient) REFERENCES customer (id)');
  31.         $this->addSql('ALTER TABLE checking_account ADD CONSTRAINT FK_23EB7C35B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
  32.         $this->addSql('ALTER TABLE checking_account_movement ADD CONSTRAINT FK_E22B6B12896DBBDE FOREIGN KEY (updated_by_id) REFERENCES users (id)');
  33.         $this->addSql('ALTER TABLE checking_account_movement ADD CONSTRAINT FK_E22B6B12B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)');
  34.         $this->addSql('ALTER TABLE checking_account_movement ADD CONSTRAINT FK_E22B6B12F0B3EF62 FOREIGN KEY (checking_account_id) REFERENCES checking_account (id)');
  35.     }
  36. }