<?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 Version20240207103906 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function isTransactional(): bool
{
return false;
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE customer_product_recurrent (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, service_id INT NOT NULL, date_start DATE NOT NULL, date_finish DATE NOT NULL, is_recurrent_enabled TINYINT(1) NOT NULL, stripe_subscription_id VARCHAR(255) DEFAULT NULL, hash VARCHAR(255) NOT NULL, cdate DATETIME NOT NULL, UNIQUE INDEX UNIQ_9B79F1C7D1B862B8 (hash), INDEX IDX_9B79F1C79395C3F3 (customer_id), INDEX IDX_9B79F1C7ED5CA9E6 (service_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE customer_product_recurrent ADD CONSTRAINT FK_9B79F1C79395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE customer_product_recurrent ADD CONSTRAINT FK_9B79F1C7ED5CA9E6 FOREIGN KEY (service_id) REFERENCES service (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE customer_product_recurrent');
}
}