migrations/Version20231211221056.php line 1
<?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 Version20231211221056 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 skill_tree (id INT AUTO_INCREMENT NOT NULL, type_id INT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, cost INT NOT NULL, icon VARCHAR(255) NOT NULL, INDEX IDX_F07FC26EC54C8C93 (type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE skill_tree_type (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, background VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE user_ranking (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, xp BIGINT NOT NULL, rank INT NOT NULL, skill_point INT NOT NULL, UNIQUE INDEX UNIQ_D8B527DAA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE skill_tree ADD CONSTRAINT FK_F07FC26EC54C8C93 FOREIGN KEY (type_id) REFERENCES skill_tree_type (id)');
$this->addSql('ALTER TABLE user_ranking ADD CONSTRAINT FK_D8B527DAA76ED395 FOREIGN KEY (user_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE user ADD avatar VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE skill_tree DROP FOREIGN KEY FK_F07FC26EC54C8C93');
$this->addSql('ALTER TABLE user_ranking DROP FOREIGN KEY FK_D8B527DAA76ED395');
$this->addSql('DROP TABLE skill_tree');
$this->addSql('DROP TABLE skill_tree_type');
$this->addSql('DROP TABLE user_ranking');
$this->addSql('ALTER TABLE `user` DROP avatar');
}
}