<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220425053157 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E038248176');
$this->addSql('ALTER TABLE investment_future_comms DROP FOREIGN KEY FK_D71F15306E1B4FD5');
$this->addSql('ALTER TABLE investment_future_comms DROP FOREIGN KEY FK_D71F15303E6349BC');
$this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E08EE31447');
$this->addSql('ALTER TABLE photos DROP FOREIGN KEY FK_876E0D964D218E');
$this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E0827FAFD8');
$this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E090CA0036');
$this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E0E3C9CD8D');
$this->addSql('ALTER TABLE investments DROP FOREIGN KEY FK_74FD72E0F17C6263');
$this->addSql('ALTER TABLE tax_supporting_docs DROP FOREIGN KEY FK_37201FCD1895EAD');
$this->addSql('DROP TABLE fx_rates');
$this->addSql('DROP TABLE investment_future_comms');
$this->addSql('DROP TABLE investments');
$this->addSql('DROP TABLE jpm_ic_history');
$this->addSql('DROP TABLE market_data');
$this->addSql('DROP TABLE photo_locations');
$this->addSql('DROP TABLE photos');
$this->addSql('DROP TABLE tax_documents');
$this->addSql('DROP TABLE tax_supporting_docs');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$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 = \'\' ');
$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 = \'\' ');
$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 = \'\' ');
$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 = \'\' ');
$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 = \'\' ');
$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 = \'\' ');
$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 = \'\' ');
$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 = \'\' ');
$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 = \'\' ');
$this->addSql('ALTER TABLE investment_future_comms ADD CONSTRAINT FK_D71F15303E6349BC FOREIGN KEY (market_data_id) REFERENCES market_data (id)');
$this->addSql('ALTER TABLE investment_future_comms ADD CONSTRAINT FK_D71F15306E1B4FD5 FOREIGN KEY (investment_id) REFERENCES investments (id)');
$this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E038248176 FOREIGN KEY (currency_id) REFERENCES fx_rates (id)');
$this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E0827FAFD8 FOREIGN KEY (eissale_year1_id) REFERENCES tax_documents (id)');
$this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E08EE31447 FOREIGN KEY (investment_company_id) REFERENCES market_data (id)');
$this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E090CA0036 FOREIGN KEY (eissale_year2_id) REFERENCES tax_documents (id)');
$this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E0E3C9CD8D FOREIGN KEY (eispurchase_year1_id) REFERENCES tax_documents (id)');
$this->addSql('ALTER TABLE investments ADD CONSTRAINT FK_74FD72E0F17C6263 FOREIGN KEY (eispurchase_year2_id) REFERENCES tax_documents (id)');
$this->addSql('ALTER TABLE photos ADD CONSTRAINT FK_876E0D964D218E FOREIGN KEY (location_id) REFERENCES photo_locations (id)');
$this->addSql('ALTER TABLE tax_supporting_docs ADD CONSTRAINT FK_37201FCD1895EAD FOREIGN KEY (tax_year_id) REFERENCES tax_documents (id)');
}
}