<?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 Version20240620162452 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 abap_payment (id UUID NOT NULL, payment_position_id UUID DEFAULT NULL, created_by UUID DEFAULT NULL, transaction_id VARCHAR(255) DEFAULT NULL, status VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, client_name VARCHAR(255) DEFAULT NULL, client_email VARCHAR(255) DEFAULT NULL, client_first_name VARCHAR(255) DEFAULT NULL, client_last_name VARCHAR(255) DEFAULT NULL, total_amount INT DEFAULT NULL, currency_code VARCHAR(255) DEFAULT NULL, details JSON DEFAULT NULL, language VARCHAR(255) DEFAULT NULL, credit_card VARCHAR(255) DEFAULT NULL, street VARCHAR(255) DEFAULT NULL, street_number VARCHAR(255) DEFAULT NULL, flat_number VARCHAR(255) DEFAULT NULL, town VARCHAR(255) DEFAULT NULL, gateway VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_725EDF732B08FE9C ON abap_payment (payment_position_id)');
$this->addSql('CREATE INDEX IDX_725EDF73DE12AB56 ON abap_payment (created_by)');
$this->addSql('COMMENT ON COLUMN abap_payment.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN abap_payment.payment_position_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN abap_payment.created_by IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE abap_payment_category (id UUID NOT NULL, name VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN abap_payment_category.id IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE abap_payment_position (id UUID NOT NULL, payment_category_id UUID DEFAULT NULL, name VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, price DOUBLE PRECISION DEFAULT NULL, is_multiple BOOLEAN NOT NULL, has_description BOOLEAN NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_4BFF0415E4CA4D38 ON abap_payment_position (payment_category_id)');
$this->addSql('COMMENT ON COLUMN abap_payment_position.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN abap_payment_position.payment_category_id IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE abap_payment_security_token (hash VARCHAR(255) NOT NULL, details TEXT DEFAULT NULL, after_url VARCHAR(255) DEFAULT NULL, target_url VARCHAR(255) DEFAULT NULL, gateway_name VARCHAR(255) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(hash))');
$this->addSql('COMMENT ON COLUMN abap_payment_security_token.details IS \'(DC2Type:object)\'');
$this->addSql('CREATE TABLE attachment (id UUID NOT NULL, file_path VARCHAR(255) DEFAULT NULL, original_name VARCHAR(255) DEFAULT NULL, file_size INT DEFAULT NULL, file_type VARCHAR(255) DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN attachment.id IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE group_notification (id UUID NOT NULL, name VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN group_notification.id IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE notification (id UUID NOT NULL, recipient UUID DEFAULT NULL, title VARCHAR(255) NOT NULL, content TEXT NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, read_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_BF5476CA6804FB49 ON notification (recipient)');
$this->addSql('COMMENT ON COLUMN notification.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN notification.recipient IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE service (id UUID NOT NULL, service_group_id UUID DEFAULT NULL, name VARCHAR(255) NOT NULL, card_number VARCHAR(10) NOT NULL, position INT NOT NULL, content TEXT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_E19D9AD2722827A ON service (service_group_id)');
$this->addSql('COMMENT ON COLUMN service.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN service.service_group_id IS \'(DC2Type:uuid)\'');
$this->addSql('CREATE TABLE service_group (id UUID NOT NULL, name VARCHAR(255) NOT NULL, position INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN service_group.id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE abap_payment ADD CONSTRAINT FK_725EDF732B08FE9C FOREIGN KEY (payment_position_id) REFERENCES abap_payment_position (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE abap_payment ADD CONSTRAINT FK_725EDF73DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE abap_payment_position ADD CONSTRAINT FK_4BFF0415E4CA4D38 FOREIGN KEY (payment_category_id) REFERENCES abap_payment_category (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA6804FB49 FOREIGN KEY (recipient) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE service ADD CONSTRAINT FK_E19D9AD2722827A FOREIGN KEY (service_group_id) REFERENCES service_group (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE "user" ADD group_id UUID DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD first_name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD last_name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD email VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD phone_number VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD notifications_consent BOOLEAN DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD terms_consent BOOLEAN DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD gdpr_consent BOOLEAN DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD notifications_consent_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD terms_consent_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD gdpr_consent_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD inhabitant BOOLEAN DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD accepted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD first_login_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD logingov_personal_identifier VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ADD is_notification_user BOOLEAN DEFAULT NULL');
$this->addSql('ALTER TABLE "user" ALTER id DROP DEFAULT');
$this->addSql('ALTER TABLE "user" ALTER password DROP NOT NULL');
$this->addSql('COMMENT ON COLUMN "user".group_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE "user" ADD CONSTRAINT FK_8D93D649FE54D947 FOREIGN KEY (group_id) REFERENCES group_notification (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_8D93D649FE54D947 ON "user" (group_id)');
}
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 "user" DROP CONSTRAINT FK_8D93D649FE54D947');
$this->addSql('ALTER TABLE abap_payment DROP CONSTRAINT FK_725EDF732B08FE9C');
$this->addSql('ALTER TABLE abap_payment DROP CONSTRAINT FK_725EDF73DE12AB56');
$this->addSql('ALTER TABLE abap_payment_position DROP CONSTRAINT FK_4BFF0415E4CA4D38');
$this->addSql('ALTER TABLE notification DROP CONSTRAINT FK_BF5476CA6804FB49');
$this->addSql('ALTER TABLE service DROP CONSTRAINT FK_E19D9AD2722827A');
$this->addSql('DROP TABLE abap_payment');
$this->addSql('DROP TABLE abap_payment_category');
$this->addSql('DROP TABLE abap_payment_position');
$this->addSql('DROP TABLE abap_payment_security_token');
$this->addSql('DROP TABLE attachment');
$this->addSql('DROP TABLE group_notification');
$this->addSql('DROP TABLE notification');
$this->addSql('DROP TABLE service');
$this->addSql('DROP TABLE service_group');
$this->addSql('DROP INDEX IDX_8D93D649FE54D947');
$this->addSql('ALTER TABLE "user" DROP group_id');
$this->addSql('ALTER TABLE "user" DROP first_name');
$this->addSql('ALTER TABLE "user" DROP last_name');
$this->addSql('ALTER TABLE "user" DROP email');
$this->addSql('ALTER TABLE "user" DROP phone_number');
$this->addSql('ALTER TABLE "user" DROP notifications_consent');
$this->addSql('ALTER TABLE "user" DROP terms_consent');
$this->addSql('ALTER TABLE "user" DROP gdpr_consent');
$this->addSql('ALTER TABLE "user" DROP notifications_consent_date');
$this->addSql('ALTER TABLE "user" DROP terms_consent_date');
$this->addSql('ALTER TABLE "user" DROP gdpr_consent_date');
$this->addSql('ALTER TABLE "user" DROP inhabitant');
$this->addSql('ALTER TABLE "user" DROP accepted_at');
$this->addSql('ALTER TABLE "user" DROP first_login_at');
$this->addSql('ALTER TABLE "user" DROP logingov_personal_identifier');
$this->addSql('ALTER TABLE "user" DROP is_notification_user');
$this->addSql('ALTER TABLE "user" ALTER id SET DEFAULT \'gen_random_uuid()\'');
$this->addSql('ALTER TABLE "user" ALTER password SET NOT NULL');
}
}