caisse-bliss/migrations/Version20250217165029.php

42 lines
1.7 KiB
PHP
Raw Normal View History

2025-02-17 17:51:01 +01:00
<?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 Version20250217165029 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 group_of_products DROP FOREIGN KEY FK_2A99B370A76ED395');
$this->addSql('DROP INDEX IDX_2A99B370A76ED395 ON group_of_products');
$this->addSql('ALTER TABLE group_of_products CHANGE user_id owner_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE group_of_products ADD CONSTRAINT FK_2A99B3707E3C61F9 FOREIGN KEY (owner_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_2A99B3707E3C61F9 ON group_of_products (owner_id)');
$this->addSql('ALTER TABLE selling DROP date');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE selling ADD date VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE group_of_products DROP FOREIGN KEY FK_2A99B3707E3C61F9');
$this->addSql('DROP INDEX IDX_2A99B3707E3C61F9 ON group_of_products');
$this->addSql('ALTER TABLE group_of_products CHANGE owner_id user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE group_of_products ADD CONSTRAINT FK_2A99B370A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_2A99B370A76ED395 ON group_of_products (user_id)');
}
}