36 lines
1.7 KiB
PHP
36 lines
1.7 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 Version20260401080346 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 revendeur (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, code_revendeur VARCHAR(10) NOT NULL, raison_sociale VARCHAR(255) DEFAULT NULL, siret VARCHAR(14) DEFAULT NULL, address VARCHAR(500) DEFAULT NULL, zip_code VARCHAR(10) DEFAULT NULL, city VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, phone VARCHAR(20) DEFAULT NULL, stripe_connect_id VARCHAR(255) DEFAULT NULL, is_use_stripe BOOLEAN NOT NULL, is_active BOOLEAN NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, user_id INT NOT NULL, PRIMARY KEY (id))');
|
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_47CF17CAEB8A6FF2 ON revendeur (code_revendeur)');
|
|
$this->addSql('CREATE UNIQUE INDEX UNIQ_47CF17CAA76ED395 ON revendeur (user_id)');
|
|
$this->addSql('ALTER TABLE revendeur ADD CONSTRAINT FK_47CF17CAA76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) ON DELETE CASCADE NOT DEFERRABLE');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('ALTER TABLE revendeur DROP CONSTRAINT FK_47CF17CAA76ED395');
|
|
$this->addSql('DROP TABLE revendeur');
|
|
}
|
|
}
|