migrations/Version20220425053157.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 Version20220425053157 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->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E038248176');
  19.         $this->addSql('ALTER TABLE investment_future_comms DROP FOREIGN KEY FK_D71F15306E1B4FD5');
  20.         $this->addSql('ALTER TABLE investment_future_comms DROP FOREIGN KEY FK_D71F15303E6349BC');
  21.         $this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E08EE31447');
  22.         $this->addSql('ALTER TABLE photos DROP FOREIGN KEY FK_876E0D964D218E');
  23.         $this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E0827FAFD8');
  24.         $this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E090CA0036');
  25.         $this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E0E3C9CD8D');
  26.         $this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E0F17C6263');
  27.         $this->addSql('ALTER TABLE tax_supporting_docs DROP FOREIGN KEY FK_37201FCD1895EAD');
  28.         $this->addSql('DROP TABLE fx_rates');
  29.         $this->addSql('DROP TABLE investment_future_comms');
  30.         $this->addSql('DROP TABLE investments');
  31.         $this->addSql('DROP TABLE jpm_ic_history');
  32.         $this->addSql('DROP TABLE market_data');
  33.         $this->addSql('DROP TABLE photo_locations');
  34.         $this->addSql('DROP TABLE photos');
  35.         $this->addSql('DROP TABLE tax_documents');
  36.         $this->addSql('DROP TABLE tax_supporting_docs');
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.         $this->addSql('CREATE TABLE fx_rates (id INT AUTO_INCREMENT NOT NULL, fx VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, current_fx_rate DOUBLE PRECISION DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  42.         $this->addSql('CREATE TABLE investment_future_comms (id INT AUTO_INCREMENT NOT NULL, investment_id INT DEFAULT NULL, market_data_id INT NOT NULL, date DATE DEFAULT NULL, comment VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, attachment JSON DEFAULT NULL, INDEX IDX_D71F15303E6349BC (market_data_id), INDEX IDX_D71F15306E1B4FD5 (investment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  43.         $this->addSql('CREATE TABLE investments (id INT AUTO_INCREMENT NOT NULL, eispurchase_year1_id INT DEFAULT NULL, eispurchase_year2_id INT DEFAULT NULL, eissale_year1_id INT DEFAULT NULL, eissale_year2_id INT DEFAULT NULL, currency_id INT DEFAULT NULL, investment_company_id INT DEFAULT NULL, investment_date DATE DEFAULT NULL, investment_amount DOUBLE PRECISION DEFAULT NULL, investment_eis TINYINT(1) DEFAULT NULL, investment_sold_price DOUBLE PRECISION DEFAULT NULL, investment_sale_date DATE DEFAULT NULL, share_cert VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, eis_cert VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, other_docs VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, eispurchase_year1_percentage DOUBLE PRECISION DEFAULT NULL, eispurchase_year2_percentage DOUBLE PRECISION DEFAULT NULL, eissale_year1_percentage DOUBLE PRECISION DEFAULT NULL, eissale_year2_percentage DOUBLE PRECISION DEFAULT NULL, number_of_shares DOUBLE PRECISION DEFAULT NULL, purchase_share_price DOUBLE PRECISION DEFAULT NULL, initial_investment_amount_gbp DOUBLE PRECISION DEFAULT NULL, INDEX IDX_74FD72E0F17C6263 (eispurchase_year2_id), INDEX IDX_74FD72E090CA0036 (eissale_year2_id), INDEX IDX_74FD72E08EE31447 (investment_company_id), INDEX IDX_74FD72E0827FAFD8 (eissale_year1_id), INDEX IDX_74FD72E038248176 (currency_id), INDEX IDX_74FD72E0E3C9CD8D (eispurchase_year1_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  44.         $this->addSql('CREATE TABLE jpm_ic_history (id INT AUTO_INCREMENT NOT NULL, year DOUBLE PRECISION DEFAULT NULL, base_salary_gbp DOUBLE PRECISION DEFAULT NULL, total_comp_usd DOUBLE PRECISION DEFAULT NULL, ic_total DOUBLE PRECISION DEFAULT NULL, ic_cash DOUBLE PRECISION DEFAULT NULL, ic_shares DOUBLE PRECISION DEFAULT NULL, ic_share_price DOUBLE PRECISION DEFAULT NULL, ic_shares1 DOUBLE PRECISION DEFAULT NULL, ic_shares2 DOUBLE PRECISION DEFAULT NULL, attachment_icfile VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, vesting_date1 DATE DEFAULT NULL, vesting_date2 DATE DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  45.         $this->addSql('CREATE TABLE market_data (id INT AUTO_INCREMENT NOT NULL, share_price DOUBLE PRECISION DEFAULT NULL, share_company VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, companies_house VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, weblink VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, asset_class VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  46.         $this->addSql('CREATE TABLE photo_locations (id INT AUTO_INCREMENT NOT NULL, location 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 = \'\' ');
  47.         $this->addSql('CREATE TABLE photos (id INT AUTO_INCREMENT NOT NULL, location_id INT DEFAULT NULL, date DATE DEFAULT NULL, photo_file VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_876E0D964D218E (location_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  48.         $this->addSql('CREATE TABLE tax_documents (id INT AUTO_INCREMENT NOT NULL, year VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, p11_d VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, p60 VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, self_assessment VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, comments LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  49.         $this->addSql('CREATE TABLE tax_supporting_docs (id INT AUTO_INCREMENT NOT NULL, tax_year_id INT NOT NULL, date DATE DEFAULT NULL, comments VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, attachment VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, detailed_comments LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_37201FCD1895EAD (tax_year_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  50.         $this->addSql('ALTER TABLE investment_future_comms ADD CONSTRAINT FK_D71F15303E6349BC FOREIGN KEY (market_data_id) REFERENCES market_data (id)');
  51.         $this->addSql('ALTER TABLE investment_future_comms ADD CONSTRAINT FK_D71F15306E1B4FD5 FOREIGN KEY (investment_id) REFERENCES investments (id)');
  52.         $this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E038248176 FOREIGN KEY (currency_id) REFERENCES fx_rates (id)');
  53.         $this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E0827FAFD8 FOREIGN KEY (eissale_year1_id) REFERENCES tax_documents (id)');
  54.         $this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E08EE31447 FOREIGN KEY (investment_company_id) REFERENCES market_data (id)');
  55.         $this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E090CA0036 FOREIGN KEY (eissale_year2_id) REFERENCES tax_documents (id)');
  56.         $this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E0E3C9CD8D FOREIGN KEY (eispurchase_year1_id) REFERENCES tax_documents (id)');
  57.         $this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E0F17C6263 FOREIGN KEY (eispurchase_year2_id) REFERENCES tax_documents (id)');
  58.         $this->addSql('ALTER TABLE photos ADD CONSTRAINT FK_876E0D964D218E FOREIGN KEY (location_id) REFERENCES photo_locations (id)');
  59.         $this->addSql('ALTER TABLE tax_supporting_docs ADD CONSTRAINT FK_37201FCD1895EAD FOREIGN KEY (tax_year_id) REFERENCES tax_documents (id)');
  60.     }
  61. }