This commit is contained in:
2025-03-26 19:12:04 +04:00
parent 8ddb44f6b1
commit ff40c87730
6 changed files with 333 additions and 1 deletions
+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 Version20241211060919 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 ancestry (id VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, rarity INT NOT NULL, type VARCHAR(255) NOT NULL, attribute JSON DEFAULT NULL, attribute_flaw JSON DEFAULT NULL, hp_raw INT DEFAULT NULL, image JSON DEFAULT NULL, size JSON NOT NULL, speed 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 ancestry');
}
}
+36
View File
@@ -0,0 +1,36 @@
<?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 Version20241211061051 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 ancestry ADD item_id INT NOT NULL');
$this->addSql('ALTER TABLE ancestry ADD CONSTRAINT FK_63FAD02F126F525E FOREIGN KEY (item_id) REFERENCES item (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE UNIQUE INDEX UNIQ_63FAD02F126F525E ON ancestry (item_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 ancestry DROP CONSTRAINT FK_63FAD02F126F525E');
$this->addSql('DROP INDEX UNIQ_63FAD02F126F525E');
$this->addSql('ALTER TABLE ancestry DROP item_id');
}
}
+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 Version20241211061203 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 ancestry ALTER hp_raw TYPE VARCHAR(255)');
}
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 ancestry ALTER hp_raw TYPE INT');
}
}