<?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 Version20240228134906 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 subscription_sms_package (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, messages INT NOT NULL, price DOUBLE PRECISION NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE customer ADD subscription_sms_package_id INT DEFAULT NULL, ADD number_of_left_messages INT NOT NULL');
$this->addSql('ALTER TABLE customer ADD CONSTRAINT FK_81398E098B3FC2D2 FOREIGN KEY (subscription_sms_package_id) REFERENCES subscription_sms_package (id)');
$this->addSql('ALTER TABLE generator_options ADD sms_subscription_package_name VARCHAR(255) DEFAULT NULL, ADD sms_subscription_number_of_messages INT DEFAULT NULL, ADD sms_subscription_price DOUBLE PRECISION DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customer DROP FOREIGN KEY FK_81398E098B3FC2D2');
$this->addSql('DROP TABLE subscription_sms_package');
$this->addSql('ALTER TABLE customer DROP subscription_sms_package_id, DROP number_of_left_messages');
$this->addSql('ALTER TABLE generator_options DROP sms_subscription_package_name, DROP sms_subscription_number_of_messages, DROP sms_subscription_price');
}
}