Work, work, work~~~

This commit is contained in:
2024-12-11 09:53:41 +04:00
parent c7c6ee27a9
commit 8ddb44f6b1
26 changed files with 1416 additions and 254 deletions
+42
View File
@@ -0,0 +1,42 @@
<?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 Version20241210083555 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('DROP SEQUENCE tpait_id_seq CASCADE');
$this->addSql('ALTER TABLE item ADD aonprd_id VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE item_localization ADD locale VARCHAR(10) NOT NULL');
$this->addSql('ALTER TABLE tpait ALTER id TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE tpait ALTER id DROP DEFAULT');
}
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('CREATE SEQUENCE tpait_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('ALTER TABLE item_localization DROP locale');
$this->addSql('ALTER TABLE item DROP aonprd_id');
$this->addSql('ALTER TABLE tpait ALTER id TYPE INT');
$this->addSql('CREATE SEQUENCE tpait_id_seq');
$this->addSql('SELECT setval(\'tpait_id_seq\', (SELECT MAX(id) FROM tpait))');
$this->addSql('ALTER TABLE tpait ALTER id SET DEFAULT nextval(\'tpait_id_seq\')');
}
}
+41
View File
@@ -0,0 +1,41 @@
<?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 Version20241210084313 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('DROP INDEX uniq_1f1b251ed17f50a6');
$this->addSql('ALTER TABLE item DROP uuid');
$this->addSql('CREATE SEQUENCE item_id_seq');
$this->addSql('SELECT setval(\'item_id_seq\', (SELECT MAX(id) FROM item))');
$this->addSql('ALTER TABLE item ALTER id SET DEFAULT nextval(\'item_id_seq\')');
$this->addSql('CREATE UNIQUE INDEX UNIQ_1F1B251EDA27C6FE ON item (aonprd_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 INDEX UNIQ_1F1B251EDA27C6FE');
$this->addSql('ALTER TABLE item ADD uuid UUID NOT NULL');
$this->addSql('ALTER TABLE item ALTER id DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN item.uuid IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE UNIQUE INDEX uniq_1f1b251ed17f50a6 ON item (uuid)');
}
}
+32
View File
@@ -0,0 +1,32 @@
<?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 Version20241210085754 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 item_localization ADD type 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 item_localization DROP type');
}
}
+35
View File
@@ -0,0 +1,35 @@
<?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 Version20241210102535 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 source (id SERIAL NOT NULL, item_id INT NOT NULL, rarity INT NOT NULL, primary_source_category VARCHAR(255) NOT NULL, primary_source_group VARCHAR(255) NOT NULL, source_category JSON NOT NULL, source_group JSON NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_5F8A7F73126F525E ON source (item_id)');
$this->addSql('ALTER TABLE source ADD CONSTRAINT FK_5F8A7F73126F525E FOREIGN KEY (item_id) REFERENCES item (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 source DROP CONSTRAINT FK_5F8A7F73126F525E');
$this->addSql('DROP TABLE source');
}
}
+38
View File
@@ -0,0 +1,38 @@
<?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 Version20241210103436 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('DROP SEQUENCE source_id_seq CASCADE');
$this->addSql('ALTER TABLE source ALTER id TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE source ALTER id DROP DEFAULT');
}
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('CREATE SEQUENCE source_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('ALTER TABLE source ALTER id TYPE INT');
$this->addSql('CREATE SEQUENCE source_id_seq');
$this->addSql('SELECT setval(\'source_id_seq\', (SELECT MAX(id) FROM source))');
$this->addSql('ALTER TABLE source ALTER id SET DEFAULT nextval(\'source_id_seq\')');
}
}
+34
View File
@@ -0,0 +1,34 @@
<?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 Version20241210103547 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 source ALTER primary_source_category DROP NOT NULL');
$this->addSql('ALTER TABLE source ALTER primary_source_group 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 source ALTER primary_source_category SET NOT NULL');
$this->addSql('ALTER TABLE source ALTER primary_source_group SET NOT NULL');
}
}
+42
View File
@@ -0,0 +1,42 @@
<?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 Version20241210103818 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 source DROP primary_source_category');
$this->addSql('ALTER TABLE source DROP primary_source_group');
$this->addSql('ALTER TABLE source ALTER source_category TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE source ALTER source_category DROP NOT NULL');
$this->addSql('ALTER TABLE source ALTER source_group TYPE VARCHAR(255)');
$this->addSql('ALTER TABLE source ALTER source_group 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 source ADD primary_source_category VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE source ADD primary_source_group VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE source ALTER source_category TYPE JSON');
$this->addSql('ALTER TABLE source ALTER source_category SET NOT NULL');
$this->addSql('ALTER TABLE source ALTER source_group TYPE JSON');
$this->addSql('ALTER TABLE source ALTER source_group SET NOT NULL');
}
}