Convert existing schema to a first migration

This commit is contained in:
Timothy Warren 2022-11-03 10:44:30 -04:00
parent 28f184dd68
commit 520654587c
12 changed files with 139 additions and 465 deletions

139
src/Migrations/Version0.php Normal file
View File

@ -0,0 +1,139 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version0 extends AbstractMigration {
public function getDescription(): string
{
return 'Initial Database Setup';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf(
! $this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQLPlatform'."
);
$this->addSql('CREATE TABLE collection.brand_category (category_name VARCHAR(255) NOT NULL, PRIMARY KEY(category_name))');
$this->addSql('CREATE TABLE collection.brand (id SERIAL NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX brand_unq ON collection.brand (name)');
$this->addSql('CREATE TABLE collection.cpu_socket_link (cpu_id INT NOT NULL, socket_id INT NOT NULL, PRIMARY KEY(cpu_id, socket_id))');
$this->addSql('CREATE INDEX idx_b1adf47dd20e239c ON collection.cpu_socket_link (socket_id)');
$this->addSql('CREATE INDEX idx_b1adf47d3917014 ON collection.cpu_socket_link (cpu_id)');
$this->addSql('CREATE TABLE collection.battery_type (id SERIAL NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE collection.film_format (id INT NOT NULL, number_id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE collection.flash (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, is_auto_flash BOOLEAN NOT NULL, is_ttl BOOLEAN NOT NULL, ttl_type VARCHAR(255) NOT NULL, is_p_ttl BOOLEAN NOT NULL, p_ttl_type VARCHAR(255) NOT NULL, guide_number VARCHAR(255) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, batteries VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(255) DEFAULT NULL, formerly_owned BOOLEAN DEFAULT false NOT NULL, received BOOLEAN DEFAULT false NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN collection.flash.purchase_price IS \'(DC2Type:money)\'');
$this->addSql('CREATE TABLE collection.brand_category_link (brand_category VARCHAR(255) NOT NULL, brand_id INT NOT NULL, PRIMARY KEY(brand_id, brand_category))');
$this->addSql('CREATE INDEX IDX_5EBFB63CC17C8AD0 ON collection.brand_category_link (brand_category)');
$this->addSql('CREATE INDEX IDX_5EBFB63C44F5D008 ON collection.brand_category_link (brand_id)');
$this->addSql('CREATE TABLE collection.previously_owned_flash (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, is_auto_flash BOOLEAN NOT NULL, is_ttl BOOLEAN NOT NULL, ttl_type VARCHAR(255) NOT NULL, is_p_ttl BOOLEAN NOT NULL, p_ttl_type VARCHAR(255) NOT NULL, guide_number VARCHAR(255) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, batteries VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(255) DEFAULT NULL, formerly_owned BOOLEAN DEFAULT true NOT NULL, received BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN collection.previously_owned_flash.purchase_price IS \'(DC2Type:money)\'');
$this->addSql('CREATE TABLE collection.previously_owned_lenses (id SERIAL NOT NULL, brand VARCHAR(64) DEFAULT NULL, coatings VARCHAR(64) DEFAULT NULL, product_line VARCHAR(64) DEFAULT NULL, model VARCHAR(64) DEFAULT NULL, min_f_stop VARCHAR(10) DEFAULT NULL, max_f_stop DOUBLE PRECISION DEFAULT NULL, min_focal_length INT DEFAULT NULL, max_focal_length INT DEFAULT NULL, serial VARCHAR(10) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, notes TEXT DEFAULT NULL, mount VARCHAR(40) DEFAULT NULL, received BOOLEAN NOT NULL, formerly_owned BOOLEAN NOT NULL, front_filter_size NUMERIC(10, 0) DEFAULT NULL, rear_filter_size NUMERIC(10, 0) DEFAULT NULL, is_teleconverter BOOLEAN NOT NULL, design_elements SMALLINT DEFAULT NULL, design_groups SMALLINT DEFAULT NULL, aperture_blades SMALLINT DEFAULT NULL, image_size VARCHAR(255) DEFAULT \'35mm\' NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN collection.previously_owned_lenses.purchase_price IS \'(DC2Type:money)\'');
$this->addSql('CREATE TABLE collection.lenses (id SERIAL NOT NULL, brand VARCHAR(64) DEFAULT NULL, coatings VARCHAR(64) DEFAULT NULL, product_line VARCHAR(64) DEFAULT NULL, model VARCHAR(64) DEFAULT NULL, min_f_stop VARCHAR(10) DEFAULT NULL, max_f_stop DOUBLE PRECISION DEFAULT NULL, min_focal_length INT DEFAULT NULL, max_focal_length INT DEFAULT NULL, serial VARCHAR(10) DEFAULT NULL, purchase_price MONEY DEFAULT NULL, notes TEXT DEFAULT NULL, mount VARCHAR(40) DEFAULT NULL, received BOOLEAN NOT NULL, formerly_owned BOOLEAN NOT NULL, front_filter_size NUMERIC(10, 0) DEFAULT NULL, rear_filter_size NUMERIC(10, 0) DEFAULT NULL, is_teleconverter BOOLEAN NOT NULL, design_elements SMALLINT DEFAULT NULL, design_groups SMALLINT DEFAULT NULL, aperture_blades SMALLINT DEFAULT NULL, image_size VARCHAR(255) DEFAULT \'35mm\' NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN collection.lenses.purchase_price IS \'(DC2Type:money)\'');
$this->addSql('CREATE TABLE collection.film (id SERIAL NOT NULL, brand VARCHAR(255) NOT NULL, product_line VARCHAR(255) DEFAULT NULL, film_name VARCHAR(255) NOT NULL, film_speed_asa INT NOT NULL, film_speed_din INT NOT NULL, film_format VARCHAR(255) NOT NULL, film_base VARCHAR(255) DEFAULT \'Cellulose Triacetate\' NOT NULL, unused_rolls INT DEFAULT 0 NOT NULL, developed_rolls INT DEFAULT 0 NOT NULL, chemistry VARCHAR(255) DEFAULT \'C-41\' NOT NULL, notes TEXT DEFAULT NULL, film_alias VARCHAR(255) DEFAULT NULL, rolls_in_camera INT DEFAULT 0 NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE collection.fpu (id SERIAL NOT NULL, brand_id INT NOT NULL, socket_id INT NOT NULL, model VARCHAR(255) NOT NULL, clock_speed INT NOT NULL, count INT DEFAULT 1 NOT NULL, notes TEXT DEFAULT NULL, series VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX idx_c741fa58d20e239c ON collection.fpu (socket_id)');
$this->addSql('CREATE INDEX idx_c741fa5844f5d008 ON collection.fpu (brand_id)');
$this->addSql('CREATE TABLE collection.socket (id SERIAL NOT NULL, name VARCHAR(255) NOT NULL, other_name VARCHAR(255) DEFAULT NULL, pin_count INT NOT NULL, socket_type VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE collection.camera_type (id SERIAL NOT NULL, type VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE collection.cpu (id SERIAL NOT NULL, brand_id INT NOT NULL, architecture VARCHAR(255) NOT NULL, product_line VARCHAR(255) NOT NULL, model VARCHAR(255) NOT NULL, part_number VARCHAR(255) NOT NULL, lot_number VARCHAR(255) DEFAULT NULL, micro_architecture VARCHAR(255) DEFAULT NULL, codename VARCHAR(255) DEFAULT NULL, base_speed INT NOT NULL, boost_speed INT DEFAULT NULL, cores INT NOT NULL, threads INT NOT NULL, igp VARCHAR(255) DEFAULT NULL, voltage DOUBLE PRECISION DEFAULT NULL, tdp INT DEFAULT NULL, process_node INT DEFAULT NULL, count INT NOT NULL, usable BOOLEAN NOT NULL, received BOOLEAN NOT NULL, link VARCHAR(255) NOT NULL, notes TEXT DEFAULT NULL, l1_data_size INT DEFAULT NULL, l1_code_size INT DEFAULT NULL, l1_unified_size INT DEFAULT NULL, l1_unified_way INT DEFAULT NULL, l2_count INT NOT NULL, l2_size INT DEFAULT NULL, l2_way INT DEFAULT NULL, l3_count INT NOT NULL, l3_size INT DEFAULT NULL, l3_way INT DEFAULT NULL, l1_data_way INT DEFAULT NULL, l1_code_way INT DEFAULT NULL, l1_data_count INT DEFAULT NULL, l1_code_count INT DEFAULT NULL, l1_unified_count INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_C18A38B344F5D008 ON collection.cpu (brand_id)');
$this->addSql('COMMENT ON COLUMN collection.cpu.lot_number IS \'The CPU lot number, such as s-spec for Intel CPUs\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.base_speed IS \'The stock speed of the cpu in MHz\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.boost_speed IS \'The max boost speed of the cpu in MHz, if applicable\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.igp IS \'The name of the integrated graphics processor\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.usable IS \'Whether the chip is working, and can be used with other hardware I have\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.received IS \'Whether I have the chip in my possession (instead of in shipping)\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_data_size IS \'The size of each Level 1 data cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_code_size IS \'The size of each Level 1 instruction cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_unified_size IS \'The size of each Level 1 unified cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l2_count IS \'The number of L2 caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l2_size IS \'The size of each Level 2 cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l3_count IS \'The number of L3 caches on the package\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l3_size IS \'The size of each Level 3 cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_data_count IS \'The number of L1 data caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_code_count IS \'The number of L1 instruction caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_unified_count IS \'The number of L1 caches on the package, usually the same as the number of cores\'');
$this->addSql('CREATE TABLE collection.camera (id SERIAL NOT NULL, type_id INT NOT NULL, brand VARCHAR(64) NOT NULL, mount VARCHAR(32) NOT NULL, model VARCHAR(255) NOT NULL, is_digital BOOLEAN NOT NULL, crop_factor NUMERIC(10, 0) NOT NULL, is_working BOOLEAN NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(20) NOT NULL, formerly_owned BOOLEAN NOT NULL, purchase_price MONEY DEFAULT NULL, battery_type VARCHAR(255) DEFAULT NULL, film_format VARCHAR(255) DEFAULT NULL, received BOOLEAN DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_8326CD6CC54C8C93 ON collection.camera (type_id)');
$this->addSql('COMMENT ON COLUMN collection.camera.purchase_price IS \'(DC2Type:money)\'');
$this->addSql('CREATE TABLE collection.previously_owned_camera (id SERIAL NOT NULL, type_id INT NOT NULL, brand VARCHAR(64) NOT NULL, mount VARCHAR(32) NOT NULL, model VARCHAR(255) NOT NULL, is_digital BOOLEAN NOT NULL, crop_factor NUMERIC(10, 0) NOT NULL, is_working BOOLEAN NOT NULL, notes TEXT DEFAULT NULL, serial VARCHAR(20) NOT NULL, formerly_owned BOOLEAN NOT NULL, purchase_price MONEY DEFAULT NULL, battery_type VARCHAR(255) DEFAULT NULL, film_format VARCHAR(255) DEFAULT NULL, received BOOLEAN DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_78B0E96CC54C8C93 ON collection.previously_owned_camera (type_id)');
$this->addSql('COMMENT ON COLUMN collection.previously_owned_camera.purchase_price IS \'(DC2Type:money)\'');
$this->addSql('CREATE TABLE collection.gpu_core (id SERIAL NOT NULL, brand_id INT NOT NULL, name VARCHAR(255) NOT NULL, variant VARCHAR(255) DEFAULT NULL, generation_name VARCHAR(255) DEFAULT NULL, architecture VARCHAR(255) DEFAULT NULL, process_node INT DEFAULT NULL, architecture_link VARCHAR(255) DEFAULT NULL, generation_link VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_EE59217D44F5D008 ON collection.gpu_core (brand_id)');
$this->addSql('CREATE TABLE collection.gpu (id SERIAL NOT NULL, board_brand_id INT DEFAULT NULL, gpu_brand_id INT NOT NULL, gpu_core_id INT DEFAULT NULL, reference_model_name VARCHAR(255) NOT NULL, alternate_model_name VARCHAR(255) DEFAULT NULL, notes TEXT DEFAULT NULL, count INT DEFAULT 1 NOT NULL, molex_power INT DEFAULT 0 NOT NULL, pcie_6_pin INT DEFAULT 0 NOT NULL, pcie_8_pin INT DEFAULT 0 NOT NULL, card_key VARCHAR(255) DEFAULT \'PCIe x16\' NOT NULL, tdp INT DEFAULT NULL, link VARCHAR(255) DEFAULT NULL, bus_interface VARCHAR(255) DEFAULT NULL, slot_span INT DEFAULT 1 NOT NULL, base_clock INT DEFAULT NULL, boost_clock INT DEFAULT NULL, memory_clock INT DEFAULT NULL, memory_size INT DEFAULT NULL, memory_bus INT DEFAULT NULL, memory_type VARCHAR(255) DEFAULT NULL, shading_units INT DEFAULT NULL, tmus INT DEFAULT NULL, rops INT DEFAULT NULL, compute_units INT DEFAULT NULL, l1_cache VARCHAR(255) DEFAULT NULL, l2_cache VARCHAR(255) DEFAULT NULL, direct_x_support VARCHAR(255) DEFAULT NULL, opengl_support VARCHAR(255) DEFAULT NULL, opencl_support VARCHAR(255) DEFAULT NULL, vulkan_support VARCHAR(255) DEFAULT NULL, shader_model VARCHAR(255) DEFAULT NULL, acquired BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_C683906FD402D3B1 ON collection.gpu (board_brand_id)');
$this->addSql('CREATE INDEX IDX_C683906F4561DE01 ON collection.gpu (gpu_brand_id)');
$this->addSql('CREATE INDEX IDX_C683906F87059374 ON collection.gpu (gpu_core_id)');
$this->addSql('COMMENT ON COLUMN collection.gpu.card_key IS \'The shape of the card connector\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.tdp IS \'Thermal Design Power (in Watts)\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.bus_interface IS \'The type of electrical bus this card uses\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.slot_span IS \'How many expansion slots the card occupies\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.base_clock IS \'Base speed of the gpu core, in MHz\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.boost_clock IS \'GPU core boost clock, in MHz\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.memory_clock IS \'Clock speed of the VRAM, in MHz\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.memory_size IS \'VRAM size, in MiB\'');
$this->addSql('COMMENT ON COLUMN collection.gpu.memory_bus IS \'The width of the memory bus in bits\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf(
! $this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform,
"Migration can only be executed safely on '\Doctrine\DBAL\Platforms\PostgreSQLPlatform'."
);
$this->addSql('DROP TABLE collection.brand_category');
$this->addSql('DROP TABLE collection.brand');
$this->addSql('DROP TABLE collection.cpu_socket_link');
$this->addSql('DROP TABLE collection.battery_type');
$this->addSql('DROP TABLE collection.film_format');
$this->addSql('DROP TABLE collection.flash');
$this->addSql('DROP TABLE collection.brand_category_link');
$this->addSql('DROP TABLE collection.previously_owned_flash');
$this->addSql('DROP TABLE collection.previously_owned_lenses');
$this->addSql('DROP TABLE collection.lenses');
$this->addSql('DROP TABLE collection.film');
$this->addSql('DROP TABLE collection.fpu');
$this->addSql('DROP TABLE collection.socket');
$this->addSql('DROP TABLE collection.camera_type');
$this->addSql('DROP TABLE collection.cpu');
$this->addSql('DROP TABLE collection.camera');
$this->addSql('DROP TABLE collection.previously_owned_camera');
$this->addSql('DROP TABLE collection.gpu_core');
$this->addSql('DROP TABLE collection.gpu');
}
}

View File

@ -1,30 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221014203914 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 collection.gpu ALTER card_key TYPE character varying');
$this->addSql('ALTER TABLE collection.gpu ALTER bus_interface TYPE character varying');
}
public function down(Schema $schema): void
{
}
}

View File

@ -1,31 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221014212753 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
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
}
}

View File

@ -1,32 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221019183925 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('CREATE TABLE collection.socket (id SERIAL NOT NULL, name VARCHAR(255) NOT NULL, other_name VARCHAR(255) DEFAULT NULL, pin_count INT NOT NULL, socket_type VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP TABLE collection.socket');
}
}

View File

@ -1,46 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221025152435 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('CREATE TABLE collection.cpu_socket_link (socket_id INT NOT NULL, cpu_id INT NOT NULL, PRIMARY KEY(socket_id, cpu_id))');
$this->addSql('CREATE INDEX IDX_B1ADF47DD20E239C ON collection.cpu_socket_link (socket_id)');
$this->addSql('CREATE INDEX IDX_B1ADF47D3917014 ON collection.cpu_socket_link (cpu_id)');
$this->addSql('CREATE TABLE collection.fpu (id SERIAL NOT NULL, brand_id INT NOT NULL, socket_id INT NOT NULL, model VARCHAR(255) NOT NULL, clock_speed INT NOT NULL, count INT DEFAULT 1 NOT NULL, notes TEXT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_C741FA5844F5D008 ON collection.fpu (brand_id)');
$this->addSql('CREATE INDEX IDX_C741FA58D20E239C ON collection.fpu (socket_id)');
$this->addSql('ALTER TABLE collection.cpu_socket_link ADD CONSTRAINT FK_B1ADF47DD20E239C FOREIGN KEY (socket_id) REFERENCES collection.cpu (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE collection.cpu_socket_link ADD CONSTRAINT FK_B1ADF47D3917014 FOREIGN KEY (cpu_id) REFERENCES collection.socket (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE collection.fpu ADD CONSTRAINT FK_C741FA5844F5D008 FOREIGN KEY (brand_id) REFERENCES collection.brand (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE collection.fpu ADD CONSTRAINT FK_C741FA58D20E239C FOREIGN KEY (socket_id) REFERENCES collection.socket (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu_socket_link DROP CONSTRAINT FK_B1ADF47DD20E239C');
$this->addSql('ALTER TABLE collection.cpu_socket_link DROP CONSTRAINT FK_B1ADF47D3917014');
$this->addSql('ALTER TABLE collection.fpu DROP CONSTRAINT FK_C741FA5844F5D008');
$this->addSql('ALTER TABLE collection.fpu DROP CONSTRAINT FK_C741FA58D20E239C');
$this->addSql('DROP TABLE collection.cpu_socket_link');
$this->addSql('DROP TABLE collection.fpu');
}
}

View File

@ -1,32 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221025172539 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 collection.fpu ADD series VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.fpu DROP series');
}
}

View File

@ -1,108 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027154708 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 collection.cpu ADD architecture VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD product_line VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD model VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD part_number VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD lot_number VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD micro_architecture VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD codename VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD base_speed INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD boost_speed INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD cores INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD threads INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD igp VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD voltage DOUBLE PRECISION DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD tdp INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD process_node INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD count INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD usable BOOLEAN NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD received BOOLEAN NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD link VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD notes VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_count INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_data_size INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_code_size INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_unified_size INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_way INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l2_count INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l2_size INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l2_way INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l3_count INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l3_size INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l3_way INT DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN collection.cpu.lot_number IS \'The CPU lot number, such as s-spec for Intel CPUs\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.base_speed IS \'The stock speed of the cpu in MHz\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.boost_speed IS \'The max boost speed of the cpu in MHz, if applicable\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.igp IS \'The name of the integrated graphics processor\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.usable IS \'Whether the chip is working, and can be used with other hardware I have\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.received IS \'Whether I have the chip in my possession (instead of in shipping)\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_count IS \'The number of L1 caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_data_size IS \'The size of each Level 1 data cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_code_size IS \'The size of each Level 1 instruction cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_unified_size IS \'The size of each Level 1 unified cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l2_count IS \'The number of L2 caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l2_size IS \'The size of each Level 2 cache in KB\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l3_count IS \'The number of L3 caches on the package\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l3_size IS \'The size of each Level 3 cache in KB\'');
$this->addSql('ALTER TABLE collection.fpu ALTER series DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu DROP architecture');
$this->addSql('ALTER TABLE collection.cpu DROP product_line');
$this->addSql('ALTER TABLE collection.cpu DROP model');
$this->addSql('ALTER TABLE collection.cpu DROP part_number');
$this->addSql('ALTER TABLE collection.cpu DROP lot_number');
$this->addSql('ALTER TABLE collection.cpu DROP micro_architecture');
$this->addSql('ALTER TABLE collection.cpu DROP codename');
$this->addSql('ALTER TABLE collection.cpu DROP base_speed');
$this->addSql('ALTER TABLE collection.cpu DROP boost_speed');
$this->addSql('ALTER TABLE collection.cpu DROP cores');
$this->addSql('ALTER TABLE collection.cpu DROP threads');
$this->addSql('ALTER TABLE collection.cpu DROP igp');
$this->addSql('ALTER TABLE collection.cpu DROP voltage');
$this->addSql('ALTER TABLE collection.cpu DROP tdp');
$this->addSql('ALTER TABLE collection.cpu DROP process_node');
$this->addSql('ALTER TABLE collection.cpu DROP count');
$this->addSql('ALTER TABLE collection.cpu DROP usable');
$this->addSql('ALTER TABLE collection.cpu DROP received');
$this->addSql('ALTER TABLE collection.cpu DROP link');
$this->addSql('ALTER TABLE collection.cpu DROP notes');
$this->addSql('ALTER TABLE collection.cpu DROP l1_count');
$this->addSql('ALTER TABLE collection.cpu DROP l1_data_size');
$this->addSql('ALTER TABLE collection.cpu DROP l1_code_size');
$this->addSql('ALTER TABLE collection.cpu DROP l1_unified_size');
$this->addSql('ALTER TABLE collection.cpu DROP l1_way');
$this->addSql('ALTER TABLE collection.cpu DROP l2_count');
$this->addSql('ALTER TABLE collection.cpu DROP l2_size');
$this->addSql('ALTER TABLE collection.cpu DROP l2_way');
$this->addSql('ALTER TABLE collection.cpu DROP l3_count');
$this->addSql('ALTER TABLE collection.cpu DROP l3_size');
$this->addSql('ALTER TABLE collection.cpu DROP l3_way');
$this->addSql('ALTER TABLE collection.fpu ALTER series SET NOT NULL');
}
}

View File

@ -1,34 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027192946 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 collection.cpu ADD l1_data_way INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_code_way INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu DROP l1_data_way');
$this->addSql('ALTER TABLE collection.cpu DROP l1_code_way');
}
}

View File

@ -1,32 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027200731 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 collection.cpu ALTER notes TYPE TEXT');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu ALTER notes TYPE VARCHAR(255)');
}
}

View File

@ -1,44 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027211813 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 collection.cpu ADD l1_data_count INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_code_count INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu ADD l1_unified_count INT DEFAULT NULL');
$this->addSql('ALTER TABLE collection.cpu DROP l1_count');
$this->addSql('ALTER TABLE collection.cpu RENAME COLUMN l1_way TO l1_unified_way');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_data_count IS \'The number of L1 data caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_code_count IS \'The number of L1 instruction caches on the package, usually the same as the number of cores\'');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_unified_count IS \'The number of L1 caches on the package, usually the same as the number of cores\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu ADD l1_count INT NOT NULL');
$this->addSql('ALTER TABLE collection.cpu DROP l1_data_count');
$this->addSql('ALTER TABLE collection.cpu DROP l1_code_count');
$this->addSql('ALTER TABLE collection.cpu DROP l1_unified_count');
$this->addSql('ALTER TABLE collection.cpu RENAME COLUMN l1_unified_way TO l1_way');
$this->addSql('COMMENT ON COLUMN collection.cpu.l1_count IS \'The number of L1 caches on the package, usually the same as the number of cores\'');
}
}

View File

@ -1,38 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221027214731 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 collection.cpu ALTER micro_architecture DROP NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER codename DROP NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER tdp DROP NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER notes DROP NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu ALTER micro_architecture SET NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER codename SET NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER tdp SET NOT NULL');
$this->addSql('ALTER TABLE collection.cpu ALTER notes SET NOT NULL');
}
}

View File

@ -1,38 +0,0 @@
<?php
declare(strict_types=1);
namespace App\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221028145449 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 collection.cpu_socket_link ADD CONSTRAINT FK_B1ADF47D3917014 FOREIGN KEY (cpu_id) REFERENCES collection.cpu (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE collection.cpu_socket_link ADD CONSTRAINT FK_B1ADF47DD20E239C FOREIGN KEY (socket_id) REFERENCES collection.socket (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_B1ADF47D3917014 ON collection.cpu_socket_link (cpu_id)');
$this->addSql('CREATE INDEX IDX_B1ADF47DD20E239C ON collection.cpu_socket_link (socket_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE collection.cpu_socket_link DROP CONSTRAINT FK_B1ADF47D3917014');
$this->addSql('ALTER TABLE collection.cpu_socket_link DROP CONSTRAINT FK_B1ADF47DD20E239C');
$this->addSql('DROP INDEX IDX_B1ADF47D3917014');
$this->addSql('DROP INDEX IDX_B1ADF47DD20E239C');
}
}