<?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 Version20250610140756 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('ALTER TABLE account DROP INDEX account_subuser_id_fk, ADD UNIQUE INDEX UNIQ_7D3656A4EC0C7B5A (subuser_id)');
$this->addSql('ALTER TABLE account DROP INDEX account_login_log_id_fk, ADD UNIQUE INDEX UNIQ_7D3656A41D037A1C (login_log_id)');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY account_manager_id_fk');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY account_subuser_id_fk');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY account_login_log_id_fk');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY account_user_id_fk');
$this->addSql('ALTER TABLE account CHANGE enabled enabled TINYINT(1) DEFAULT NULL, CHANGE roles roles LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE errored_login_count errored_login_count INT NOT NULL, CHANGE locked locked TINYINT(1) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE account ADD CONSTRAINT FK_7D3656A4783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE account ADD CONSTRAINT FK_7D3656A4A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE account ADD CONSTRAINT FK_7D3656A4EC0C7B5A FOREIGN KEY (subuser_id) REFERENCES subuser (id)');
$this->addSql('ALTER TABLE account ADD CONSTRAINT FK_7D3656A41D037A1C FOREIGN KEY (login_log_id) REFERENCES login_log (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_7D3656A4783E3463 ON account (manager_id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_7D3656A4A76ED395 ON account (user_id)');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY action_user_id_fk');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY action_user_id_fk_2');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY action_action_id_fk');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY action_user_id_fk_2');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY action_action_id_fk');
$this->addSql('ALTER TABLE action CHANGE useful_link useful_link VARCHAR(255) DEFAULT NULL, CHANGE `terminated` `terminated` TINYINT(1) DEFAULT NULL, CHANGE by_manager by_manager TINYINT(1) DEFAULT NULL, CHANGE for_dpo for_dpo TINYINT(1) DEFAULT NULL, CHANGE estimation_time estimation_time INT DEFAULT NULL, CHANGE real_time real_time INT DEFAULT NULL, CHANGE priority `priority` INT DEFAULT NULL, CHANGE by_group by_group TINYINT(1) DEFAULT NULL, CHANGE group_user_concerned group_user_concerned TINYINT(1) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE action ADD CONSTRAINT FK_47CC8C92A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE action ADD CONSTRAINT FK_47CC8C92216E8799 FOREIGN KEY (group_user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE action ADD CONSTRAINT FK_47CC8C925D81ACD4 FOREIGN KEY (group_action_id) REFERENCES action (id)');
$this->addSql('DROP INDEX action_user_id_fk_2 ON action');
$this->addSql('CREATE INDEX IDX_47CC8C92216E8799 ON action (group_user_id)');
$this->addSql('DROP INDEX action_action_id_fk ON action');
$this->addSql('CREATE INDEX IDX_47CC8C925D81ACD4 ON action (group_action_id)');
$this->addSql('ALTER TABLE action ADD CONSTRAINT action_user_id_fk_2 FOREIGN KEY (group_user_id) REFERENCES user (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE action ADD CONSTRAINT action_action_id_fk FOREIGN KEY (group_action_id) REFERENCES action (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE action_has_treatment DROP FOREIGN KEY action_has_treatment_treatment_id_fk');
$this->addSql('ALTER TABLE action_has_treatment DROP FOREIGN KEY action_has_treatment_action_id_fk');
$this->addSql('ALTER TABLE action_has_treatment DROP FOREIGN KEY action_has_treatment_treatment_id_fk');
$this->addSql('ALTER TABLE action_has_treatment ADD CONSTRAINT FK_8256FC629D32F035 FOREIGN KEY (action_id) REFERENCES action (id)');
$this->addSql('ALTER TABLE action_has_treatment ADD CONSTRAINT FK_8256FC62471C0366 FOREIGN KEY (treatment_id) REFERENCES treatment (id)');
$this->addSql('DROP INDEX action_has_treatment_treatment_id_fk ON action_has_treatment');
$this->addSql('CREATE INDEX IDX_8256FC62471C0366 ON action_has_treatment (treatment_id)');
$this->addSql('ALTER TABLE action_has_treatment ADD CONSTRAINT action_has_treatment_treatment_id_fk FOREIGN KEY (treatment_id) REFERENCES treatment (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_has_sheet DROP FOREIGN KEY action_has_sheet_document_id_fk');
$this->addSql('ALTER TABLE action_has_sheet DROP FOREIGN KEY action_has_sheet_action_id_fk');
$this->addSql('ALTER TABLE action_has_sheet DROP FOREIGN KEY action_has_sheet_document_id_fk');
$this->addSql('ALTER TABLE action_has_sheet ADD CONSTRAINT FK_D8B392419D32F035 FOREIGN KEY (action_id) REFERENCES action (id)');
$this->addSql('ALTER TABLE action_has_sheet ADD CONSTRAINT FK_D8B39241C33F7837 FOREIGN KEY (document_id) REFERENCES document (id)');
$this->addSql('DROP INDEX action_has_sheet_document_id_fk ON action_has_sheet');
$this->addSql('CREATE INDEX IDX_D8B39241C33F7837 ON action_has_sheet (document_id)');
$this->addSql('ALTER TABLE action_has_sheet ADD CONSTRAINT action_has_sheet_document_id_fk FOREIGN KEY (document_id) REFERENCES document (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_std DROP FOREIGN KEY action_std_manager_id_fk');
$this->addSql('ALTER TABLE action_std ADD CONSTRAINT FK_958088E8783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE action_std_has_sheet DROP FOREIGN KEY action_std_has_sheet_document_id_fk');
$this->addSql('ALTER TABLE action_std_has_sheet DROP FOREIGN KEY action_std_has_sheet_action_std_id_fk');
$this->addSql('ALTER TABLE action_std_has_sheet DROP FOREIGN KEY action_std_has_sheet_document_id_fk');
$this->addSql('ALTER TABLE action_std_has_sheet ADD CONSTRAINT FK_265A13D2DF52D5DE FOREIGN KEY (action_std_id) REFERENCES action_std (id)');
$this->addSql('ALTER TABLE action_std_has_sheet ADD CONSTRAINT FK_265A13D2C33F7837 FOREIGN KEY (document_id) REFERENCES document (id)');
$this->addSql('DROP INDEX action_std_has_sheet_document_id_fk ON action_std_has_sheet');
$this->addSql('CREATE INDEX IDX_265A13D2C33F7837 ON action_std_has_sheet (document_id)');
$this->addSql('ALTER TABLE action_std_has_sheet ADD CONSTRAINT action_std_has_sheet_document_id_fk FOREIGN KEY (document_id) REFERENCES document (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_std_document DROP FOREIGN KEY action_std_document_manager_id_fk');
$this->addSql('ALTER TABLE action_std_document DROP FOREIGN KEY action_std_document_action_std_id_fk');
$this->addSql('ALTER TABLE action_std_document ADD CONSTRAINT FK_32241F88DF52D5DE FOREIGN KEY (action_std_id) REFERENCES action_std (id)');
$this->addSql('ALTER TABLE action_std_document ADD CONSTRAINT FK_32241F88783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE credit DROP FOREIGN KEY credit_manager_id_fk');
$this->addSql('ALTER TABLE credit DROP FOREIGN KEY credit_user_id_fk');
$this->addSql('ALTER TABLE credit CHANGE stock stock DOUBLE PRECISION DEFAULT NULL');
$this->addSql('ALTER TABLE credit ADD CONSTRAINT FK_1CC16EFE783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE credit ADD CONSTRAINT FK_1CC16EFEA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY document_document_type_id_fk');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY document_manager_id_fk');
$this->addSql('ALTER TABLE document CHANGE translated_en `translated_en` TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE document ADD CONSTRAINT FK_D8698A76C54C8C93 FOREIGN KEY (type_id) REFERENCES document_type (id)');
$this->addSql('ALTER TABLE document_subtype DROP FOREIGN KEY document_subtype_document_type_id_fk');
$this->addSql('ALTER TABLE document_subtype DROP FOREIGN KEY document_subtype_document_type_id_fk');
$this->addSql('ALTER TABLE document_subtype ADD CONSTRAINT FK_F104837EC54C8C93 FOREIGN KEY (type_id) REFERENCES document_type (id)');
$this->addSql('DROP INDEX document_subtype_document_type_id_fk ON document_subtype');
$this->addSql('CREATE INDEX IDX_F104837EC54C8C93 ON document_subtype (type_id)');
$this->addSql('ALTER TABLE document_subtype ADD CONSTRAINT document_subtype_document_type_id_fk FOREIGN KEY (type_id) REFERENCES document_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE document_type DROP FOREIGN KEY document_type_document_type_id_fk');
$this->addSql('ALTER TABLE document_type DROP FOREIGN KEY document_type_document_type_id_fk');
$this->addSql('ALTER TABLE document_type ADD CONSTRAINT FK_2B6ADBBA727ACA70 FOREIGN KEY (parent_id) REFERENCES document_type (id)');
$this->addSql('DROP INDEX document_type_document_type_id_fk ON document_type');
$this->addSql('CREATE INDEX IDX_2B6ADBBA727ACA70 ON document_type (parent_id)');
$this->addSql('ALTER TABLE document_type ADD CONSTRAINT document_type_document_type_id_fk FOREIGN KEY (parent_id) REFERENCES document_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE exercising_claim_request DROP FOREIGN KEY exercising_claim_request_user_id_fk');
$this->addSql('ALTER TABLE exercising_claim_request CHANGE precisions precisions VARCHAR(65535) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE exercising_claim_request ADD CONSTRAINT FK_40F9907BA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX general_translations_lookup_idx ON ext_translations (object_class, foreign_key)');
$this->addSql('ALTER TABLE incident DROP FOREIGN KEY incident_user_id_fk');
$this->addSql('ALTER TABLE incident CHANGE cnil_informed cnil_informed TINYINT(1) DEFAULT NULL, CHANGE notice_72_h notice_72_h TINYINT(1) DEFAULT NULL, CHANGE people_informed people_informed TINYINT(1) DEFAULT NULL, CHANGE `group` `group` TINYINT(1) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE incident ADD CONSTRAINT FK_3D03A11AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE info CHANGE content content VARCHAR(65535) DEFAULT NULL, CHANGE enabled enabled TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE login_log DROP FOREIGN KEY login_log_account_id_fk');
$this->addSql('ALTER TABLE login_log ADD CONSTRAINT FK_F16D9FFF9B6B5FBA FOREIGN KEY (account_id) REFERENCES account (id)');
$this->addSql('ALTER TABLE subcontractor DROP FOREIGN KEY subcontractor_subcontractor_type_id_fk');
$this->addSql('ALTER TABLE subcontractor DROP FOREIGN KEY subcontractor_user_id_fk');
$this->addSql('ALTER TABLE subcontractor DROP FOREIGN KEY subcontractor_subcontractor_type_id_fk');
$this->addSql('ALTER TABLE subcontractor CHANGE type_id type_id INT DEFAULT NULL, CHANGE `group` `group` TINYINT(1) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE subcontractor ADD CONSTRAINT FK_1CEA354CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE subcontractor ADD CONSTRAINT FK_1CEA354CC54C8C93 FOREIGN KEY (type_id) REFERENCES subcontractor_type (id)');
$this->addSql('DROP INDEX subcontractor_subcontractor_type_id_fk ON subcontractor');
$this->addSql('CREATE INDEX IDX_1CEA354CC54C8C93 ON subcontractor (type_id)');
$this->addSql('ALTER TABLE subcontractor ADD CONSTRAINT subcontractor_subcontractor_type_id_fk FOREIGN KEY (type_id) REFERENCES subcontractor_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY subcontractor_std_conformity_id_fk');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY subcontractor_std_manager_id_fk');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY subcontractor_std_user_id_fk');
$this->addSql('DROP INDEX subcontractor_std_user_id_fk ON subcontractor_std');
$this->addSql('DROP INDEX subcontractor_std_manager_id_fk ON subcontractor_std');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY subcontractor_std_conformity_id_fk');
$this->addSql('ALTER TABLE subcontractor_std ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT FK_A6E388851380D476 FOREIGN KEY (conformity_id) REFERENCES conformity (id)');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT FK_A6E38885783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT FK_A6E38885A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_A6E38885783E3463 ON subcontractor_std (manager_id)');
$this->addSql('CREATE INDEX subcontractor_std_manager_id_fk ON subcontractor_std (user_id)');
$this->addSql('DROP INDEX subcontractor_std_conformity_id_fk ON subcontractor_std');
$this->addSql('CREATE INDEX subcontractor_conformity_id_fk ON subcontractor_std (conformity_id)');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT subcontractor_std_conformity_id_fk FOREIGN KEY (conformity_id) REFERENCES conformity (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE subcontractor_std_document DROP FOREIGN KEY subcontractor_std_document_manager_id_fk');
$this->addSql('ALTER TABLE subcontractor_std_document DROP FOREIGN KEY subcontractor_std_document_subcontractor_std_id_fk');
$this->addSql('ALTER TABLE subcontractor_std_document ADD CONSTRAINT FK_A7B85A00783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE subcontractor_std_document ADD CONSTRAINT FK_A7B85A004BE6BD7C FOREIGN KEY (subcontractor_std_id) REFERENCES subcontractor_std (id)');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY subscription_user_id_fk');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY subscription_subscription_type_id_fk');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY subscription_subscription_type_id_fk');
$this->addSql('ALTER TABLE subscription CHANGE involvement_months involvement_months INT DEFAULT NULL, CHANGE billing_months billing_months INT DEFAULT NULL, CHANGE unit_billing_price unit_billing_price DOUBLE PRECISION DEFAULT NULL, CHANGE active `active` TINYINT(1) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D3A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D3C54C8C93 FOREIGN KEY (type_id) REFERENCES subscription_type (id)');
$this->addSql('DROP INDEX subscription_subscription_type_id_fk ON subscription');
$this->addSql('CREATE INDEX IDX_A3C664D3C54C8C93 ON subscription (type_id)');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT subscription_subscription_type_id_fk FOREIGN KEY (type_id) REFERENCES subscription_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE subuser DROP FOREIGN KEY subuser_user_id_fk');
$this->addSql('ALTER TABLE subuser ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE subuser ADD CONSTRAINT FK_5426A4C2A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE system DROP FOREIGN KEY system_user_id_fk');
$this->addSql('ALTER TABLE system CHANGE data data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE `group` `group` TINYINT(1) DEFAULT NULL, CHANGE auto_apply_to_treatments `auto_apply_to_treatments` TINYINT(1) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE system ADD CONSTRAINT FK_C94D118BA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE system_std DROP FOREIGN KEY system_std_manager_id_fk');
$this->addSql('ALTER TABLE system_std ADD user_id INT DEFAULT NULL, CHANGE data data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\'');
$this->addSql('ALTER TABLE system_std ADD CONSTRAINT FK_65C2BC73783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE system_std ADD CONSTRAINT FK_65C2BC73A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_65C2BC73A76ED395 ON system_std (user_id)');
$this->addSql('ALTER TABLE training CHANGE questions questions LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE answers answers LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE active active TINYINT(1) DEFAULT NULL, CHANGE answered answered TINYINT(1) DEFAULT NULL, CHANGE available_for_all available_for_all TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE training_has_user DROP FOREIGN KEY training_has_user_user_id_fk');
$this->addSql('ALTER TABLE training_has_user DROP FOREIGN KEY training_has_user_training_id_fk');
$this->addSql('ALTER TABLE training_has_user DROP FOREIGN KEY training_has_user_user_id_fk');
$this->addSql('ALTER TABLE training_has_user ADD CONSTRAINT FK_37AA1E81BEFD98D1 FOREIGN KEY (training_id) REFERENCES training (id)');
$this->addSql('ALTER TABLE training_has_user ADD CONSTRAINT FK_37AA1E81A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('DROP INDEX training_has_user_user_id_fk ON training_has_user');
$this->addSql('CREATE INDEX IDX_37AA1E81A76ED395 ON training_has_user (user_id)');
$this->addSql('ALTER TABLE training_has_user ADD CONSTRAINT training_has_user_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE training_campain DROP FOREIGN KEY training_campain_training_id_fk');
$this->addSql('ALTER TABLE training_campain DROP FOREIGN KEY training_campain_user_id_fk');
$this->addSql('ALTER TABLE training_campain CHANGE questions questions LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE answers answers LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE emails emails LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE emails_count emails_count INT NOT NULL, CHANGE traineeship traineeship TINYINT(1) DEFAULT NULL, CHANGE external external TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE training_campain ADD CONSTRAINT FK_6419EB31BEFD98D1 FOREIGN KEY (training_id) REFERENCES training (id)');
$this->addSql('ALTER TABLE training_campain ADD CONSTRAINT FK_6419EB31A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE training_campain_has_team DROP FOREIGN KEY training_campain_has_team_training_campain_id_fk');
$this->addSql('ALTER TABLE training_campain_has_team DROP FOREIGN KEY training_campain_has_team_training_team_id_fk');
$this->addSql('ALTER TABLE training_campain_has_team DROP FOREIGN KEY training_campain_has_team_training_team_id_fk');
$this->addSql('ALTER TABLE training_campain_has_team ADD CONSTRAINT FK_31AF41D79A09C814 FOREIGN KEY (training_campain_id) REFERENCES training_campain (id)');
$this->addSql('ALTER TABLE training_campain_has_team ADD CONSTRAINT FK_31AF41D7F45248A0 FOREIGN KEY (training_team_id) REFERENCES training_team (id)');
$this->addSql('DROP INDEX training_campain_has_team_training_team_id_fk ON training_campain_has_team');
$this->addSql('CREATE INDEX IDX_31AF41D7F45248A0 ON training_campain_has_team (training_team_id)');
$this->addSql('ALTER TABLE training_campain_has_team ADD CONSTRAINT training_campain_has_team_training_team_id_fk FOREIGN KEY (training_team_id) REFERENCES training_team (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE training_request DROP FOREIGN KEY training_request_training_campain_id_fk');
$this->addSql('ALTER TABLE training_request CHANGE user_answers user_answers LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE result result DOUBLE PRECISION DEFAULT NULL');
$this->addSql('ALTER TABLE training_request ADD CONSTRAINT FK_E6A91F919A09C814 FOREIGN KEY (training_campain_id) REFERENCES training_campain (id)');
$this->addSql('ALTER TABLE training_request_history DROP FOREIGN KEY training_request_history_training_request_id_fk');
$this->addSql('ALTER TABLE training_request_history CHANGE user_answers user_answers LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE result result DOUBLE PRECISION DEFAULT NULL');
$this->addSql('ALTER TABLE training_request_history ADD CONSTRAINT FK_B8C9BB27F8C002C3 FOREIGN KEY (training_request_id) REFERENCES training_request (id)');
$this->addSql('ALTER TABLE training_team DROP FOREIGN KEY training_team_user_id_fk');
$this->addSql('ALTER TABLE training_team DROP FOREIGN KEY training_team_user_id_fk');
$this->addSql('ALTER TABLE training_team ADD CONSTRAINT FK_CB7AE15CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('DROP INDEX training_team_user_id_fk ON training_team');
$this->addSql('CREATE INDEX IDX_CB7AE15CA76ED395 ON training_team (user_id)');
$this->addSql('ALTER TABLE training_team ADD CONSTRAINT training_team_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY treatment_treatment_state_id_fk');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY treatment_user_id_fk');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY treatment_subcontractor_type_id_fk');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY treatment_treatment_state_id_fk');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY treatment_subcontractor_type_id_fk');
$this->addSql('ALTER TABLE treatment CHANGE number number INT DEFAULT NULL, CHANGE description description VARCHAR(65535) DEFAULT NULL, CHANGE personal_data personal_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE people_data people_data VARCHAR(65535) DEFAULT NULL, CHANGE sensitive_data sensitive_data TINYINT(1) DEFAULT NULL, CHANGE consent_asked consent_asked TINYINT(1) DEFAULT NULL, CHANGE consent_how consent_how VARCHAR(65535) DEFAULT NULL, CHANGE pia_criteria pia_criteria LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE pia_needed pia_needed TINYINT(1) DEFAULT NULL, CHANGE pia_exoneration pia_exoneration TINYINT(1) DEFAULT NULL, CHANGE legal_basis legal_basis VARCHAR(65535) DEFAULT NULL, CHANGE data_source data_source VARCHAR(65535) DEFAULT NULL, CHANGE automated_decision automated_decision TINYINT(1) DEFAULT NULL, CHANGE data_retention_period data_retention_period VARCHAR(65535) DEFAULT NULL, CHANGE insufficient_criteria insufficient_criteria TINYINT(1) DEFAULT NULL, CHANGE `group` `group` TINYINT(1) DEFAULT NULL, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT FK_98013C31A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT FK_98013C315D83CC1 FOREIGN KEY (state_id) REFERENCES treatment_state (id)');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT FK_98013C313E9377D9 FOREIGN KEY (company_subcontractor_type_id) REFERENCES subcontractor_type (id)');
$this->addSql('DROP INDEX treatment_treatment_state_id_fk ON treatment');
$this->addSql('CREATE INDEX IDX_98013C315D83CC1 ON treatment (state_id)');
$this->addSql('DROP INDEX treatment_subcontractor_type_id_fk ON treatment');
$this->addSql('CREATE INDEX IDX_98013C313E9377D9 ON treatment (company_subcontractor_type_id)');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT treatment_treatment_state_id_fk FOREIGN KEY (state_id) REFERENCES treatment_state (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT treatment_subcontractor_type_id_fk FOREIGN KEY (company_subcontractor_type_id) REFERENCES subcontractor_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE treatment_has_subcontractor DROP FOREIGN KEY treatment_has_subcontractor_subcontractor_id_fk');
$this->addSql('ALTER TABLE treatment_has_subcontractor DROP FOREIGN KEY treatment_has_subcontractor_treatment_id_fk');
$this->addSql('ALTER TABLE treatment_has_subcontractor DROP FOREIGN KEY treatment_has_subcontractor_subcontractor_id_fk');
$this->addSql('ALTER TABLE treatment_has_subcontractor ADD CONSTRAINT FK_29EF5C56471C0366 FOREIGN KEY (treatment_id) REFERENCES treatment (id)');
$this->addSql('ALTER TABLE treatment_has_subcontractor ADD CONSTRAINT FK_29EF5C56FD2F7858 FOREIGN KEY (subcontractor_id) REFERENCES subcontractor (id)');
$this->addSql('DROP INDEX treatment_has_subcontractor_subcontractor_id_fk ON treatment_has_subcontractor');
$this->addSql('CREATE INDEX IDX_29EF5C56FD2F7858 ON treatment_has_subcontractor (subcontractor_id)');
$this->addSql('ALTER TABLE treatment_has_subcontractor ADD CONSTRAINT treatment_has_subcontractor_subcontractor_id_fk FOREIGN KEY (subcontractor_id) REFERENCES subcontractor (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE treatment_has_system DROP FOREIGN KEY treatment_has_system_system_id_fk');
$this->addSql('ALTER TABLE treatment_has_system DROP FOREIGN KEY treatment_has_system_treatment_id_fk');
$this->addSql('ALTER TABLE treatment_has_system DROP FOREIGN KEY treatment_has_system_system_id_fk');
$this->addSql('ALTER TABLE treatment_has_system ADD CONSTRAINT FK_F611BB05471C0366 FOREIGN KEY (treatment_id) REFERENCES treatment (id)');
$this->addSql('ALTER TABLE treatment_has_system ADD CONSTRAINT FK_F611BB05D0952FA5 FOREIGN KEY (system_id) REFERENCES system (id)');
$this->addSql('DROP INDEX treatment_has_system_system_id_fk ON treatment_has_system');
$this->addSql('CREATE INDEX IDX_F611BB05D0952FA5 ON treatment_has_system (system_id)');
$this->addSql('ALTER TABLE treatment_has_system ADD CONSTRAINT treatment_has_system_system_id_fk FOREIGN KEY (system_id) REFERENCES system (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY treatment_std_manager_id_fk');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY treatment_std_treatment_std_category_id_fk');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY treatment_std_user_id_fk');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY treatment_std_treatment_std_category_id_fk');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY treatment_std_user_id_fk');
$this->addSql('ALTER TABLE treatment_std CHANGE description description VARCHAR(65535) DEFAULT NULL, CHANGE personal_data personal_data LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE people_data people_data VARCHAR(65535) DEFAULT NULL, CHANGE sensitive_data sensitive_data TINYINT(1) DEFAULT NULL, CHANGE consent_asked consent_asked TINYINT(1) DEFAULT NULL, CHANGE consent_how consent_how VARCHAR(65535) DEFAULT NULL, CHANGE pia_criteria pia_criteria LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', CHANGE pia_needed pia_needed TINYINT(1) DEFAULT NULL, CHANGE pia_exoneration pia_exoneration TINYINT(1) DEFAULT NULL, CHANGE legal_basis legal_basis VARCHAR(65535) DEFAULT NULL, CHANGE data_source data_source VARCHAR(65535) DEFAULT NULL, CHANGE automated_decision automated_decision TINYINT(1) DEFAULT NULL, CHANGE data_retention_period data_retention_period VARCHAR(65535) DEFAULT NULL, CHANGE insufficient_criteria insufficient_criteria TINYINT(1) DEFAULT NULL');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT FK_6738A655783E3463 FOREIGN KEY (manager_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT FK_6738A655A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT FK_6738A65512469DE2 FOREIGN KEY (category_id) REFERENCES treatment_std_category (id)');
$this->addSql('DROP INDEX treatment_std_user_id_fk ON treatment_std');
$this->addSql('CREATE INDEX IDX_6738A655A76ED395 ON treatment_std (user_id)');
$this->addSql('DROP INDEX treatment_std_treatment_std_category_id_fk ON treatment_std');
$this->addSql('CREATE INDEX IDX_6738A65512469DE2 ON treatment_std (category_id)');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT treatment_std_treatment_std_category_id_fk FOREIGN KEY (category_id) REFERENCES treatment_std_category (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT treatment_std_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY user_user_id_fk');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY user_manager_id_fk_2');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY user_subscription_id_fk');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY user_user_id_fk');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY user_manager_id_fk_2');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY user_subscription_id_fk');
$this->addSql('ALTER TABLE user CHANGE manager_dpo manager_dpo TINYINT(1) DEFAULT NULL, CHANGE demo demo TINYINT(1) DEFAULT NULL, CHANGE credit credit DOUBLE PRECISION DEFAULT NULL, CHANGE employees_number employees_number INT NOT NULL, CHANGE language language VARCHAR(5) DEFAULT NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6494C19F89F FOREIGN KEY (lawyer_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649DDE45DDE FOREIGN KEY (current_subscription_id) REFERENCES subscription (id)');
$this->addSql('DROP INDEX user_manager_id_fk_2 ON user');
$this->addSql('CREATE INDEX IDX_8D93D6494C19F89F ON user (lawyer_id)');
$this->addSql('DROP INDEX user_user_id_fk ON user');
$this->addSql('CREATE INDEX IDX_8D93D649A76ED395 ON user (user_id)');
$this->addSql('DROP INDEX user_subscription_id_fk ON user');
$this->addSql('CREATE INDEX IDX_8D93D649DDE45DDE ON user (current_subscription_id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT user_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT user_manager_id_fk_2 FOREIGN KEY (lawyer_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT user_subscription_id_fk FOREIGN KEY (current_subscription_id) REFERENCES subscription (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE user_has_treatment_group DROP FOREIGN KEY user_has_treatment_group_user_id_fk');
$this->addSql('ALTER TABLE user_has_treatment_group DROP FOREIGN KEY user_has_treatment_group_treatment_id_fk');
$this->addSql('ALTER TABLE user_has_treatment_group DROP FOREIGN KEY user_has_treatment_group_treatment_id_fk');
$this->addSql('ALTER TABLE user_has_treatment_group ADD CONSTRAINT FK_3B82C1A0A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user_has_treatment_group ADD CONSTRAINT FK_3B82C1A0471C0366 FOREIGN KEY (treatment_id) REFERENCES treatment (id)');
$this->addSql('DROP INDEX user_has_treatment_group_treatment_id_fk ON user_has_treatment_group');
$this->addSql('CREATE INDEX IDX_3B82C1A0471C0366 ON user_has_treatment_group (treatment_id)');
$this->addSql('ALTER TABLE user_has_treatment_group ADD CONSTRAINT user_has_treatment_group_treatment_id_fk FOREIGN KEY (treatment_id) REFERENCES treatment (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY user_document_subcontractor_id_fk');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY user_document_user_id_fk');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY user_document_action_id_fk');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY user_document_action_id_fk');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT FK_38E46E76FD2F7858 FOREIGN KEY (subcontractor_id) REFERENCES subcontractor (id)');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT FK_38E46E769D32F035 FOREIGN KEY (action_id) REFERENCES action (id)');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT FK_38E46E76A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('DROP INDEX user_document_action_id_fk ON user_document');
$this->addSql('CREATE INDEX IDX_38E46E769D32F035 ON user_document (action_id)');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT user_document_action_id_fk FOREIGN KEY (action_id) REFERENCES action (id) ON UPDATE CASCADE ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE action MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY FK_47CC8C92A76ED395');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY FK_47CC8C92216E8799');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY FK_47CC8C925D81ACD4');
$this->addSql('DROP INDEX `primary` ON action');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY FK_47CC8C92216E8799');
$this->addSql('ALTER TABLE action DROP FOREIGN KEY FK_47CC8C925D81ACD4');
$this->addSql('ALTER TABLE action CHANGE useful_link useful_link TEXT DEFAULT NULL, CHANGE `terminated` `terminated` TINYINT(1) DEFAULT 0, CHANGE by_manager by_manager TINYINT(1) DEFAULT 0, CHANGE for_dpo for_dpo TINYINT(1) DEFAULT 0, CHANGE estimation_time estimation_time INT DEFAULT 0, CHANGE real_time real_time INT DEFAULT 0, CHANGE `priority` priority INT DEFAULT 1, CHANGE by_group by_group TINYINT(1) DEFAULT 0, CHANGE group_user_concerned group_user_concerned TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE action ADD CONSTRAINT action_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action ADD CONSTRAINT action_user_id_fk_2 FOREIGN KEY (group_user_id) REFERENCES user (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE action ADD CONSTRAINT action_action_id_fk FOREIGN KEY (group_action_id) REFERENCES action (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('DROP INDEX idx_47cc8c925d81acd4 ON action');
$this->addSql('CREATE INDEX action_action_id_fk ON action (group_action_id)');
$this->addSql('DROP INDEX idx_47cc8c92216e8799 ON action');
$this->addSql('CREATE INDEX action_user_id_fk_2 ON action (group_user_id)');
$this->addSql('ALTER TABLE action ADD CONSTRAINT FK_47CC8C92216E8799 FOREIGN KEY (group_user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE action ADD CONSTRAINT FK_47CC8C925D81ACD4 FOREIGN KEY (group_action_id) REFERENCES action (id)');
$this->addSql('ALTER TABLE system_std DROP FOREIGN KEY FK_65C2BC73783E3463');
$this->addSql('ALTER TABLE system_std DROP FOREIGN KEY FK_65C2BC73A76ED395');
$this->addSql('DROP INDEX IDX_65C2BC73A76ED395 ON system_std');
$this->addSql('ALTER TABLE system_std DROP user_id, CHANGE data data TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE system_std ADD CONSTRAINT system_std_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE subcontractor_std MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY FK_A6E388851380D476');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY FK_A6E38885783E3463');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY FK_A6E38885A76ED395');
$this->addSql('DROP INDEX IDX_A6E38885783E3463 ON subcontractor_std');
$this->addSql('DROP INDEX `primary` ON subcontractor_std');
$this->addSql('DROP INDEX subcontractor_std_manager_id_fk ON subcontractor_std');
$this->addSql('ALTER TABLE subcontractor_std DROP FOREIGN KEY FK_A6E388851380D476');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT subcontractor_std_conformity_id_fk FOREIGN KEY (conformity_id) REFERENCES conformity (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT subcontractor_std_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT subcontractor_std_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('CREATE INDEX subcontractor_std_user_id_fk ON subcontractor_std (user_id)');
$this->addSql('CREATE INDEX subcontractor_std_manager_id_fk ON subcontractor_std (manager_id)');
$this->addSql('DROP INDEX subcontractor_conformity_id_fk ON subcontractor_std');
$this->addSql('CREATE INDEX subcontractor_std_conformity_id_fk ON subcontractor_std (conformity_id)');
$this->addSql('ALTER TABLE subcontractor_std ADD CONSTRAINT FK_A6E388851380D476 FOREIGN KEY (conformity_id) REFERENCES conformity (id)');
$this->addSql('ALTER TABLE training_request_history DROP FOREIGN KEY FK_B8C9BB27F8C002C3');
$this->addSql('ALTER TABLE training_request_history CHANGE user_answers user_answers TEXT DEFAULT NULL, CHANGE result result DOUBLE PRECISION DEFAULT \'0\'');
$this->addSql('ALTER TABLE training_request_history ADD CONSTRAINT training_request_history_training_request_id_fk FOREIGN KEY (training_request_id) REFERENCES training_request (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_has_treatment_group DROP FOREIGN KEY FK_3B82C1A0A76ED395');
$this->addSql('ALTER TABLE user_has_treatment_group DROP FOREIGN KEY FK_3B82C1A0471C0366');
$this->addSql('ALTER TABLE user_has_treatment_group DROP FOREIGN KEY FK_3B82C1A0471C0366');
$this->addSql('ALTER TABLE user_has_treatment_group ADD CONSTRAINT user_has_treatment_group_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_has_treatment_group ADD CONSTRAINT user_has_treatment_group_treatment_id_fk FOREIGN KEY (treatment_id) REFERENCES treatment (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_3b82c1a0471c0366 ON user_has_treatment_group');
$this->addSql('CREATE INDEX user_has_treatment_group_treatment_id_fk ON user_has_treatment_group (treatment_id)');
$this->addSql('ALTER TABLE user_has_treatment_group ADD CONSTRAINT FK_3B82C1A0471C0366 FOREIGN KEY (treatment_id) REFERENCES treatment (id)');
$this->addSql('ALTER TABLE training_campain DROP FOREIGN KEY FK_6419EB31BEFD98D1');
$this->addSql('ALTER TABLE training_campain DROP FOREIGN KEY FK_6419EB31A76ED395');
$this->addSql('ALTER TABLE training_campain CHANGE questions questions TEXT DEFAULT NULL, CHANGE answers answers TEXT DEFAULT NULL, CHANGE emails emails TEXT DEFAULT NULL, CHANGE emails_count emails_count INT DEFAULT 0, CHANGE traineeship traineeship TINYINT(1) DEFAULT 0, CHANGE external external TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE training_campain ADD CONSTRAINT training_campain_training_id_fk FOREIGN KEY (training_id) REFERENCES training (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE training_campain ADD CONSTRAINT training_campain_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE treatment_has_subcontractor DROP FOREIGN KEY FK_29EF5C56471C0366');
$this->addSql('ALTER TABLE treatment_has_subcontractor DROP FOREIGN KEY FK_29EF5C56FD2F7858');
$this->addSql('ALTER TABLE treatment_has_subcontractor DROP FOREIGN KEY FK_29EF5C56FD2F7858');
$this->addSql('ALTER TABLE treatment_has_subcontractor ADD CONSTRAINT treatment_has_subcontractor_subcontractor_id_fk FOREIGN KEY (subcontractor_id) REFERENCES subcontractor (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE treatment_has_subcontractor ADD CONSTRAINT treatment_has_subcontractor_treatment_id_fk FOREIGN KEY (treatment_id) REFERENCES treatment (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_29ef5c56fd2f7858 ON treatment_has_subcontractor');
$this->addSql('CREATE INDEX treatment_has_subcontractor_subcontractor_id_fk ON treatment_has_subcontractor (subcontractor_id)');
$this->addSql('ALTER TABLE treatment_has_subcontractor ADD CONSTRAINT FK_29EF5C56FD2F7858 FOREIGN KEY (subcontractor_id) REFERENCES subcontractor (id)');
$this->addSql('ALTER TABLE action_has_sheet DROP FOREIGN KEY FK_D8B392419D32F035');
$this->addSql('ALTER TABLE action_has_sheet DROP FOREIGN KEY FK_D8B39241C33F7837');
$this->addSql('ALTER TABLE action_has_sheet DROP FOREIGN KEY FK_D8B39241C33F7837');
$this->addSql('ALTER TABLE action_has_sheet ADD CONSTRAINT action_has_sheet_document_id_fk FOREIGN KEY (document_id) REFERENCES document (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_has_sheet ADD CONSTRAINT action_has_sheet_action_id_fk FOREIGN KEY (action_id) REFERENCES action (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_d8b39241c33f7837 ON action_has_sheet');
$this->addSql('CREATE INDEX action_has_sheet_document_id_fk ON action_has_sheet (document_id)');
$this->addSql('ALTER TABLE action_has_sheet ADD CONSTRAINT FK_D8B39241C33F7837 FOREIGN KEY (document_id) REFERENCES document (id)');
$this->addSql('ALTER TABLE treatment_has_system DROP FOREIGN KEY FK_F611BB05471C0366');
$this->addSql('ALTER TABLE treatment_has_system DROP FOREIGN KEY FK_F611BB05D0952FA5');
$this->addSql('ALTER TABLE treatment_has_system DROP FOREIGN KEY FK_F611BB05D0952FA5');
$this->addSql('ALTER TABLE treatment_has_system ADD CONSTRAINT treatment_has_system_system_id_fk FOREIGN KEY (system_id) REFERENCES system (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE treatment_has_system ADD CONSTRAINT treatment_has_system_treatment_id_fk FOREIGN KEY (treatment_id) REFERENCES treatment (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_f611bb05d0952fa5 ON treatment_has_system');
$this->addSql('CREATE INDEX treatment_has_system_system_id_fk ON treatment_has_system (system_id)');
$this->addSql('ALTER TABLE treatment_has_system ADD CONSTRAINT FK_F611BB05D0952FA5 FOREIGN KEY (system_id) REFERENCES system (id)');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY FK_6738A655783E3463');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY FK_6738A655A76ED395');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY FK_6738A65512469DE2');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY FK_6738A655A76ED395');
$this->addSql('ALTER TABLE treatment_std DROP FOREIGN KEY FK_6738A65512469DE2');
$this->addSql('ALTER TABLE treatment_std CHANGE description description TEXT DEFAULT NULL, CHANGE personal_data personal_data TEXT DEFAULT NULL, CHANGE people_data people_data TEXT DEFAULT NULL, CHANGE sensitive_data sensitive_data TINYINT(1) DEFAULT 0, CHANGE consent_asked consent_asked TINYINT(1) DEFAULT 0, CHANGE consent_how consent_how TEXT DEFAULT NULL, CHANGE pia_criteria pia_criteria TEXT DEFAULT NULL, CHANGE pia_needed pia_needed TINYINT(1) DEFAULT 0, CHANGE pia_exoneration pia_exoneration TINYINT(1) DEFAULT 0, CHANGE legal_basis legal_basis TEXT DEFAULT NULL, CHANGE data_source data_source TEXT DEFAULT NULL, CHANGE automated_decision automated_decision TINYINT(1) DEFAULT 0, CHANGE insufficient_criteria insufficient_criteria TINYINT(1) DEFAULT 0, CHANGE data_retention_period data_retention_period TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT treatment_std_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT treatment_std_treatment_std_category_id_fk FOREIGN KEY (category_id) REFERENCES treatment_std_category (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT treatment_std_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('DROP INDEX idx_6738a65512469de2 ON treatment_std');
$this->addSql('CREATE INDEX treatment_std_treatment_std_category_id_fk ON treatment_std (category_id)');
$this->addSql('DROP INDEX idx_6738a655a76ed395 ON treatment_std');
$this->addSql('CREATE INDEX treatment_std_user_id_fk ON treatment_std (user_id)');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT FK_6738A655A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE treatment_std ADD CONSTRAINT FK_6738A65512469DE2 FOREIGN KEY (category_id) REFERENCES treatment_std_category (id)');
$this->addSql('ALTER TABLE training_campain_has_team DROP FOREIGN KEY FK_31AF41D79A09C814');
$this->addSql('ALTER TABLE training_campain_has_team DROP FOREIGN KEY FK_31AF41D7F45248A0');
$this->addSql('ALTER TABLE training_campain_has_team DROP FOREIGN KEY FK_31AF41D7F45248A0');
$this->addSql('ALTER TABLE training_campain_has_team ADD CONSTRAINT training_campain_has_team_training_campain_id_fk FOREIGN KEY (training_campain_id) REFERENCES training_campain (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE training_campain_has_team ADD CONSTRAINT training_campain_has_team_training_team_id_fk FOREIGN KEY (training_team_id) REFERENCES training_team (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_31af41d7f45248a0 ON training_campain_has_team');
$this->addSql('CREATE INDEX training_campain_has_team_training_team_id_fk ON training_campain_has_team (training_team_id)');
$this->addSql('ALTER TABLE training_campain_has_team ADD CONSTRAINT FK_31AF41D7F45248A0 FOREIGN KEY (training_team_id) REFERENCES training_team (id)');
$this->addSql('ALTER TABLE action_std_has_sheet DROP FOREIGN KEY FK_265A13D2DF52D5DE');
$this->addSql('ALTER TABLE action_std_has_sheet DROP FOREIGN KEY FK_265A13D2C33F7837');
$this->addSql('ALTER TABLE action_std_has_sheet DROP FOREIGN KEY FK_265A13D2C33F7837');
$this->addSql('ALTER TABLE action_std_has_sheet ADD CONSTRAINT action_std_has_sheet_document_id_fk FOREIGN KEY (document_id) REFERENCES document (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_std_has_sheet ADD CONSTRAINT action_std_has_sheet_action_std_id_fk FOREIGN KEY (action_std_id) REFERENCES action_std (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_265a13d2c33f7837 ON action_std_has_sheet');
$this->addSql('CREATE INDEX action_std_has_sheet_document_id_fk ON action_std_has_sheet (document_id)');
$this->addSql('ALTER TABLE action_std_has_sheet ADD CONSTRAINT FK_265A13D2C33F7837 FOREIGN KEY (document_id) REFERENCES document (id)');
$this->addSql('ALTER TABLE document_subtype DROP FOREIGN KEY FK_F104837EC54C8C93');
$this->addSql('ALTER TABLE document_subtype DROP FOREIGN KEY FK_F104837EC54C8C93');
$this->addSql('ALTER TABLE document_subtype ADD CONSTRAINT document_subtype_document_type_id_fk FOREIGN KEY (type_id) REFERENCES document_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('DROP INDEX idx_f104837ec54c8c93 ON document_subtype');
$this->addSql('CREATE INDEX document_subtype_document_type_id_fk ON document_subtype (type_id)');
$this->addSql('ALTER TABLE document_subtype ADD CONSTRAINT FK_F104837EC54C8C93 FOREIGN KEY (type_id) REFERENCES document_type (id)');
$this->addSql('DROP INDEX general_translations_lookup_idx ON ext_translations');
$this->addSql('ALTER TABLE training_has_user DROP FOREIGN KEY FK_37AA1E81BEFD98D1');
$this->addSql('ALTER TABLE training_has_user DROP FOREIGN KEY FK_37AA1E81A76ED395');
$this->addSql('ALTER TABLE training_has_user DROP FOREIGN KEY FK_37AA1E81A76ED395');
$this->addSql('ALTER TABLE training_has_user ADD CONSTRAINT training_has_user_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE training_has_user ADD CONSTRAINT training_has_user_training_id_fk FOREIGN KEY (training_id) REFERENCES training (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_37aa1e81a76ed395 ON training_has_user');
$this->addSql('CREATE INDEX training_has_user_user_id_fk ON training_has_user (user_id)');
$this->addSql('ALTER TABLE training_has_user ADD CONSTRAINT FK_37AA1E81A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE info CHANGE content content TEXT DEFAULT NULL, CHANGE enabled enabled TINYINT(1) DEFAULT 1');
$this->addSql('ALTER TABLE training_team DROP FOREIGN KEY FK_CB7AE15CA76ED395');
$this->addSql('ALTER TABLE training_team DROP FOREIGN KEY FK_CB7AE15CA76ED395');
$this->addSql('ALTER TABLE training_team ADD CONSTRAINT training_team_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_cb7ae15ca76ed395 ON training_team');
$this->addSql('CREATE INDEX training_team_user_id_fk ON training_team (user_id)');
$this->addSql('ALTER TABLE training_team ADD CONSTRAINT FK_CB7AE15CA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE subscription MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D3A76ED395');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D3C54C8C93');
$this->addSql('DROP INDEX `primary` ON subscription');
$this->addSql('ALTER TABLE subscription DROP FOREIGN KEY FK_A3C664D3C54C8C93');
$this->addSql('ALTER TABLE subscription CHANGE involvement_months involvement_months INT DEFAULT 1, CHANGE billing_months billing_months INT DEFAULT 1, CHANGE unit_billing_price unit_billing_price DOUBLE PRECISION DEFAULT \'0\', CHANGE `active` active TINYINT(1) DEFAULT 1');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT subscription_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT subscription_subscription_type_id_fk FOREIGN KEY (type_id) REFERENCES subscription_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('DROP INDEX idx_a3c664d3c54c8c93 ON subscription');
$this->addSql('CREATE INDEX subscription_subscription_type_id_fk ON subscription (type_id)');
$this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D3C54C8C93 FOREIGN KEY (type_id) REFERENCES subscription_type (id)');
$this->addSql('ALTER TABLE subcontractor_std_document DROP FOREIGN KEY FK_A7B85A00783E3463');
$this->addSql('ALTER TABLE subcontractor_std_document DROP FOREIGN KEY FK_A7B85A004BE6BD7C');
$this->addSql('ALTER TABLE subcontractor_std_document ADD CONSTRAINT subcontractor_std_document_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE subcontractor_std_document ADD CONSTRAINT subcontractor_std_document_subcontractor_std_id_fk FOREIGN KEY (subcontractor_std_id) REFERENCES subcontractor_std (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6494C19F89F');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649A76ED395');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649DDE45DDE');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6494C19F89F');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649A76ED395');
$this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649DDE45DDE');
$this->addSql('ALTER TABLE user CHANGE manager_dpo manager_dpo TINYINT(1) DEFAULT 0, CHANGE demo demo TINYINT(1) DEFAULT 0, CHANGE credit credit DOUBLE PRECISION DEFAULT \'0\', CHANGE employees_number employees_number INT DEFAULT 0, CHANGE language language VARCHAR(5) DEFAULT \'fr\'');
$this->addSql('ALTER TABLE user ADD CONSTRAINT user_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT user_manager_id_fk_2 FOREIGN KEY (lawyer_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE user ADD CONSTRAINT user_subscription_id_fk FOREIGN KEY (current_subscription_id) REFERENCES subscription (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('DROP INDEX idx_8d93d6494c19f89f ON user');
$this->addSql('CREATE INDEX user_manager_id_fk_2 ON user (lawyer_id)');
$this->addSql('DROP INDEX idx_8d93d649a76ed395 ON user');
$this->addSql('CREATE INDEX user_user_id_fk ON user (user_id)');
$this->addSql('DROP INDEX idx_8d93d649dde45dde ON user');
$this->addSql('CREATE INDEX user_subscription_id_fk ON user (current_subscription_id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D6494C19F89F FOREIGN KEY (lawyer_id) REFERENCES manager (id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user ADD CONSTRAINT FK_8D93D649DDE45DDE FOREIGN KEY (current_subscription_id) REFERENCES subscription (id)');
$this->addSql('ALTER TABLE training_request DROP FOREIGN KEY FK_E6A91F919A09C814');
$this->addSql('ALTER TABLE training_request CHANGE user_answers user_answers TEXT DEFAULT NULL, CHANGE result result DOUBLE PRECISION DEFAULT \'0\'');
$this->addSql('ALTER TABLE training_request ADD CONSTRAINT training_request_training_campain_id_fk FOREIGN KEY (training_campain_id) REFERENCES training_campain (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_std_document DROP FOREIGN KEY FK_32241F88DF52D5DE');
$this->addSql('ALTER TABLE action_std_document DROP FOREIGN KEY FK_32241F88783E3463');
$this->addSql('ALTER TABLE action_std_document ADD CONSTRAINT action_std_document_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE action_std_document ADD CONSTRAINT action_std_document_action_std_id_fk FOREIGN KEY (action_std_id) REFERENCES action_std (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE treatment MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY FK_98013C31A76ED395');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY FK_98013C315D83CC1');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY FK_98013C313E9377D9');
$this->addSql('DROP INDEX `primary` ON treatment');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY FK_98013C315D83CC1');
$this->addSql('ALTER TABLE treatment DROP FOREIGN KEY FK_98013C313E9377D9');
$this->addSql('ALTER TABLE treatment CHANGE number number INT DEFAULT 1, CHANGE description description TEXT DEFAULT NULL, CHANGE personal_data personal_data TEXT DEFAULT NULL, CHANGE people_data people_data TEXT DEFAULT NULL, CHANGE sensitive_data sensitive_data TINYINT(1) DEFAULT 0, CHANGE consent_asked consent_asked TINYINT(1) DEFAULT 0, CHANGE consent_how consent_how TEXT DEFAULT NULL, CHANGE pia_criteria pia_criteria TEXT DEFAULT NULL, CHANGE pia_needed pia_needed TINYINT(1) DEFAULT 0, CHANGE pia_exoneration pia_exoneration TINYINT(1) DEFAULT 0, CHANGE legal_basis legal_basis TEXT DEFAULT NULL, CHANGE data_source data_source TEXT DEFAULT NULL, CHANGE automated_decision automated_decision TINYINT(1) DEFAULT 0, CHANGE insufficient_criteria insufficient_criteria TINYINT(1) DEFAULT 0, CHANGE data_retention_period data_retention_period TEXT DEFAULT NULL, CHANGE `group` `group` TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT treatment_treatment_state_id_fk FOREIGN KEY (state_id) REFERENCES treatment_state (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT treatment_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT treatment_subcontractor_type_id_fk FOREIGN KEY (company_subcontractor_type_id) REFERENCES subcontractor_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('DROP INDEX idx_98013c315d83cc1 ON treatment');
$this->addSql('CREATE INDEX treatment_treatment_state_id_fk ON treatment (state_id)');
$this->addSql('DROP INDEX idx_98013c313e9377d9 ON treatment');
$this->addSql('CREATE INDEX treatment_subcontractor_type_id_fk ON treatment (company_subcontractor_type_id)');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT FK_98013C315D83CC1 FOREIGN KEY (state_id) REFERENCES treatment_state (id)');
$this->addSql('ALTER TABLE treatment ADD CONSTRAINT FK_98013C313E9377D9 FOREIGN KEY (company_subcontractor_type_id) REFERENCES subcontractor_type (id)');
$this->addSql('ALTER TABLE subuser MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE subuser DROP FOREIGN KEY FK_5426A4C2A76ED395');
$this->addSql('DROP INDEX `primary` ON subuser');
$this->addSql('ALTER TABLE subuser ADD CONSTRAINT subuser_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE document_type DROP FOREIGN KEY FK_2B6ADBBA727ACA70');
$this->addSql('ALTER TABLE document_type DROP FOREIGN KEY FK_2B6ADBBA727ACA70');
$this->addSql('ALTER TABLE document_type ADD CONSTRAINT document_type_document_type_id_fk FOREIGN KEY (parent_id) REFERENCES document_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('DROP INDEX idx_2b6adbba727aca70 ON document_type');
$this->addSql('CREATE INDEX document_type_document_type_id_fk ON document_type (parent_id)');
$this->addSql('ALTER TABLE document_type ADD CONSTRAINT FK_2B6ADBBA727ACA70 FOREIGN KEY (parent_id) REFERENCES document_type (id)');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY FK_D8698A76783E3463');
$this->addSql('ALTER TABLE document DROP FOREIGN KEY FK_D8698A76C54C8C93');
$this->addSql('ALTER TABLE document CHANGE `translated_en` translated_en TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE document ADD CONSTRAINT document_document_type_id_fk FOREIGN KEY (type_id) REFERENCES document_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE document ADD CONSTRAINT document_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE credit DROP FOREIGN KEY FK_1CC16EFE783E3463');
$this->addSql('ALTER TABLE credit DROP FOREIGN KEY FK_1CC16EFEA76ED395');
$this->addSql('ALTER TABLE credit CHANGE stock stock DOUBLE PRECISION DEFAULT \'1\'');
$this->addSql('ALTER TABLE credit ADD CONSTRAINT credit_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE credit ADD CONSTRAINT credit_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_std DROP FOREIGN KEY FK_958088E8783E3463');
$this->addSql('ALTER TABLE action_std ADD CONSTRAINT action_std_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE training CHANGE questions questions TEXT DEFAULT NULL, CHANGE answers answers TEXT DEFAULT NULL, CHANGE active active TINYINT(1) DEFAULT 0, CHANGE answered answered TINYINT(1) DEFAULT 0, CHANGE available_for_all available_for_all TINYINT(1) DEFAULT 1');
$this->addSql('ALTER TABLE system MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE system DROP FOREIGN KEY FK_C94D118BA76ED395');
$this->addSql('DROP INDEX `primary` ON system');
$this->addSql('ALTER TABLE system CHANGE data data TEXT DEFAULT NULL, CHANGE `group` `group` TINYINT(1) DEFAULT 0, CHANGE `auto_apply_to_treatments` auto_apply_to_treatments TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE system ADD CONSTRAINT system_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE login_log DROP FOREIGN KEY FK_F16D9FFF9B6B5FBA');
$this->addSql('ALTER TABLE login_log ADD CONSTRAINT login_log_account_id_fk FOREIGN KEY (account_id) REFERENCES account (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY FK_38E46E76FD2F7858');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY FK_38E46E769D32F035');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY FK_38E46E76A76ED395');
$this->addSql('ALTER TABLE user_document DROP FOREIGN KEY FK_38E46E769D32F035');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT user_document_subcontractor_id_fk FOREIGN KEY (subcontractor_id) REFERENCES subcontractor (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT user_document_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT user_document_action_id_fk FOREIGN KEY (action_id) REFERENCES action (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_38e46e769d32f035 ON user_document');
$this->addSql('CREATE INDEX user_document_action_id_fk ON user_document (action_id)');
$this->addSql('ALTER TABLE user_document ADD CONSTRAINT FK_38E46E769D32F035 FOREIGN KEY (action_id) REFERENCES action (id)');
$this->addSql('ALTER TABLE account DROP INDEX UNIQ_7D3656A4EC0C7B5A, ADD INDEX account_subuser_id_fk (subuser_id)');
$this->addSql('ALTER TABLE account DROP INDEX UNIQ_7D3656A41D037A1C, ADD INDEX account_login_log_id_fk (login_log_id)');
$this->addSql('ALTER TABLE account MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY FK_7D3656A4783E3463');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY FK_7D3656A4A76ED395');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY FK_7D3656A4EC0C7B5A');
$this->addSql('ALTER TABLE account DROP FOREIGN KEY FK_7D3656A41D037A1C');
$this->addSql('DROP INDEX UNIQ_7D3656A4783E3463 ON account');
$this->addSql('DROP INDEX UNIQ_7D3656A4A76ED395 ON account');
$this->addSql('DROP INDEX `primary` ON account');
$this->addSql('ALTER TABLE account CHANGE enabled enabled TINYINT(1) DEFAULT 1, CHANGE roles roles TEXT DEFAULT NULL, CHANGE errored_login_count errored_login_count INT DEFAULT 0, CHANGE locked locked TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE account ADD CONSTRAINT account_manager_id_fk FOREIGN KEY (manager_id) REFERENCES manager (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE account ADD CONSTRAINT account_subuser_id_fk FOREIGN KEY (subuser_id) REFERENCES subuser (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE account ADD CONSTRAINT account_login_log_id_fk FOREIGN KEY (login_log_id) REFERENCES login_log (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE account ADD CONSTRAINT account_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE subcontractor MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE subcontractor DROP FOREIGN KEY FK_1CEA354CA76ED395');
$this->addSql('ALTER TABLE subcontractor DROP FOREIGN KEY FK_1CEA354CC54C8C93');
$this->addSql('DROP INDEX `primary` ON subcontractor');
$this->addSql('ALTER TABLE subcontractor DROP FOREIGN KEY FK_1CEA354CC54C8C93');
$this->addSql('ALTER TABLE subcontractor CHANGE type_id type_id INT DEFAULT 1, CHANGE `group` `group` TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE subcontractor ADD CONSTRAINT subcontractor_subcontractor_type_id_fk FOREIGN KEY (type_id) REFERENCES subcontractor_type (id) ON UPDATE SET NULL ON DELETE SET NULL');
$this->addSql('ALTER TABLE subcontractor ADD CONSTRAINT subcontractor_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_1cea354cc54c8c93 ON subcontractor');
$this->addSql('CREATE INDEX subcontractor_subcontractor_type_id_fk ON subcontractor (type_id)');
$this->addSql('ALTER TABLE subcontractor ADD CONSTRAINT FK_1CEA354CC54C8C93 FOREIGN KEY (type_id) REFERENCES subcontractor_type (id)');
$this->addSql('ALTER TABLE incident MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE incident DROP FOREIGN KEY FK_3D03A11AA76ED395');
$this->addSql('DROP INDEX `primary` ON incident');
$this->addSql('ALTER TABLE incident CHANGE cnil_informed cnil_informed TINYINT(1) DEFAULT 1, CHANGE notice_72_h notice_72_h TINYINT(1) DEFAULT 1, CHANGE people_informed people_informed TINYINT(1) DEFAULT 1, CHANGE `group` `group` TINYINT(1) DEFAULT 0');
$this->addSql('ALTER TABLE incident ADD CONSTRAINT incident_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE exercising_claim_request MODIFY id INT NOT NULL');
$this->addSql('ALTER TABLE exercising_claim_request DROP FOREIGN KEY FK_40F9907BA76ED395');
$this->addSql('DROP INDEX `primary` ON exercising_claim_request');
$this->addSql('ALTER TABLE exercising_claim_request CHANGE precisions precisions TEXT DEFAULT NULL');
$this->addSql('ALTER TABLE exercising_claim_request ADD CONSTRAINT exercising_claim_request_user_id_fk FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_has_treatment DROP FOREIGN KEY FK_8256FC629D32F035');
$this->addSql('ALTER TABLE action_has_treatment DROP FOREIGN KEY FK_8256FC62471C0366');
$this->addSql('ALTER TABLE action_has_treatment DROP FOREIGN KEY FK_8256FC62471C0366');
$this->addSql('ALTER TABLE action_has_treatment ADD CONSTRAINT action_has_treatment_treatment_id_fk FOREIGN KEY (treatment_id) REFERENCES treatment (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('ALTER TABLE action_has_treatment ADD CONSTRAINT action_has_treatment_action_id_fk FOREIGN KEY (action_id) REFERENCES action (id) ON UPDATE CASCADE ON DELETE CASCADE');
$this->addSql('DROP INDEX idx_8256fc62471c0366 ON action_has_treatment');
$this->addSql('CREATE INDEX action_has_treatment_treatment_id_fk ON action_has_treatment (treatment_id)');
$this->addSql('ALTER TABLE action_has_treatment ADD CONSTRAINT FK_8256FC62471C0366 FOREIGN KEY (treatment_id) REFERENCES treatment (id)');
}
}