Files
pf2e-builder/migrations/Version20241210102535.php
2024-12-11 09:53:41 +04:00

36 lines
1.3 KiB
PHP

<?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');
}
}