38 lines
1.8 KiB
PHP
38 lines
1.8 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 Version20260825211700 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 user_setting (id INT AUTO_INCREMENT NOT NULL, label VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, user_id_id INT NOT NULL, INDEX IDX_C779A6929D86650F (user_id_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci`');
|
|
$this->addSql('ALTER TABLE user_setting ADD CONSTRAINT FK_C779A6929D86650F FOREIGN KEY (user_id_id) REFERENCES `user` (id)');
|
|
$this->addSql('ALTER TABLE user_settings DROP FOREIGN KEY `FK_5C844C59D86650F`');
|
|
$this->addSql('DROP TABLE user_settings');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('CREATE TABLE user_settings (id INT AUTO_INCREMENT NOT NULL, user_id_id INT NOT NULL, label VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, value VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_5C844C59D86650F (user_id_id), PRIMARY KEY (id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
|
|
$this->addSql('ALTER TABLE user_settings ADD CONSTRAINT `FK_5C844C59D86650F` FOREIGN KEY (user_id_id) REFERENCES user (id)');
|
|
$this->addSql('ALTER TABLE user_setting DROP FOREIGN KEY FK_C779A6929D86650F');
|
|
$this->addSql('DROP TABLE user_setting');
|
|
}
|
|
}
|