migrations/Version20220218140110.php line 1

  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 Version20220218140110 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 playable_entity (id INT AUTO_INCREMENT NOT NULL, player_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, gender SMALLINT NOT NULL, trombinoscope LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', size SMALLINT NOT NULL, hp INT NOT NULL, ap INT NOT NULL, max_hp INT NOT NULL, max_ap INT NOT NULL, armor_class INT NOT NULL, agility INT NOT NULL, charisma INT NOT NULL, intelligence INT NOT NULL, perception INT NOT NULL, strength INT NOT NULL, skills LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', abilities LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', INDEX IDX_114242BE99E6F5DF (player_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
            $this->addSql('ALTER TABLE playable_entity ADD CONSTRAINT FK_114242BE99E6F5DF FOREIGN KEY (player_id) REFERENCES user (id)');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('DROP TABLE playable_entity');
            $this->addSql('ALTER TABLE message CHANGE content content LONGTEXT NOT NULL COLLATE `utf8mb4_unicode_ci`');
            $this->addSql('ALTER TABLE path CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
            $this->addSql('ALTER TABLE place CHANGE name name VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
            $this->addSql('ALTER TABLE user CHANGE email email VARCHAR(180) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE password password VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`, CHANGE nickname nickname VARCHAR(255) NOT NULL COLLATE `utf8mb4_unicode_ci`');
        }
    }