38 lines
1.6 KiB
PHP
38 lines
1.6 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 Version20251122185520 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 members_cotisations (id SERIAL NOT NULL, members_id INT DEFAULT NULL, startd_ate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, end_date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, amount DOUBLE PRECISION DEFAULT NULL, is_paid BOOLEAN NOT NULL, PRIMARY KEY(id))');
|
||
|
|
$this->addSql('CREATE INDEX IDX_C7D1EB64BD01F5ED ON members_cotisations (members_id)');
|
||
|
|
$this->addSql('COMMENT ON COLUMN members_cotisations.startd_ate IS \'(DC2Type:datetime_immutable)\'');
|
||
|
|
$this->addSql('COMMENT ON COLUMN members_cotisations.end_date IS \'(DC2Type:datetime_immutable)\'');
|
||
|
|
$this->addSql('ALTER TABLE members_cotisations ADD CONSTRAINT FK_C7D1EB64BD01F5ED FOREIGN KEY (members_id) REFERENCES members (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(Schema $schema): void
|
||
|
|
{
|
||
|
|
// this down() migration is auto-generated, please modify it to your needs
|
||
|
|
$this->addSql('CREATE SCHEMA public');
|
||
|
|
$this->addSql('ALTER TABLE members_cotisations DROP CONSTRAINT FK_C7D1EB64BD01F5ED');
|
||
|
|
$this->addSql('DROP TABLE members_cotisations');
|
||
|
|
}
|
||
|
|
}
|