From ca3cb787d71b1ee90aa103e5bcf506b4973b704a Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Thu, 6 May 2021 12:42:47 +0200 Subject: [PATCH] Fix migration classes namespaces. --- .../src/Migrations/Version20141129010948.php | 2 +- .../src/Migrations/Version20150212173934.php | 2 +- .../src/Migrations/Version20150607231010.php | 2 +- .../src/Migrations/Version20150811152608.php | 18 +++---- .../src/Migrations/Version20150812110708.php | 14 +++--- .../src/Migrations/Version20150820113409.php | 14 +++--- .../src/Migrations/Version20160310161006.php | 4 +- .../src/Migrations/Version20160422000000.php | 8 ++-- .../src/Migrations/Version20160818113633.php | 2 +- .../src/Migrations/Version20160818151130.php | 2 +- .../src/Migrations/Version20170117131924.php | 48 +++++++++---------- .../src/Migrations/Version20180518144221.php | 2 +- .../src/Migrations/Version20180820120000.php | 4 +- .../src/Migrations/Version20181005140249.php | 2 +- .../src/Migrations/Version20181023101621.php | 6 +-- .../src/Migrations/Version20190701124238.php | 2 +- .../src/Migrations/Version20191106103452.php | 4 +- .../src/Migrations/Version20200128084445.php | 2 +- .../src/Migrations/Version20200130213446.php | 14 +++--- .../src/Migrations/Version20200310090632.php | 2 +- .../src/Migrations/Version20200422125935.php | 44 ++++++++--------- .../src/Migrations/Version20210128152747.php | 2 +- .../src/Migrations/Version20210318095831.php | 2 +- .../src/Migrations/Version20210325141540.php | 2 +- .../src/Migrations/Version20210326113045.php | 14 +++--- .../src/Migrations/Version20210329090904.php | 12 ++--- .../src/Migrations/Version20210329113152.php | 18 +++---- .../src/Migrations/Version20210329144338.php | 22 ++++----- .../src/Migrations/Version20210330164922.php | 2 +- .../src/Migrations/Version20210331084527.php | 18 +++---- .../src/Migrations/Version20210419105054.php | 2 +- .../src/Migrations/Version20210419105940.php | 2 +- .../src/Migrations/Version20210419112619.php | 2 +- .../src/Migrations/Version20210426145930.php | 2 +- .../src/Migrations/Version20210427125700.php | 2 +- 35 files changed, 150 insertions(+), 150 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20141129010948.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20141129010948.php index bb0ae1850..542377d4f 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20141129010948.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20141129010948.php @@ -1,6 +1,6 @@ , - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; @@ -30,7 +30,7 @@ use Doctrine\DBAL\Schema\Schema; * - RENAMING : * - - date_of_birth TO birthdate * - - genre to gender - * + * */ class Version20150811152608 extends AbstractMigration { @@ -42,7 +42,7 @@ class Version20150811152608 extends AbstractMigration $this->abortIf( $this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); - + $this->addSql('ALTER TABLE person RENAME COLUMN date_of_birth TO birthdate'); $this->addSql('ALTER TABLE person RENAME COLUMN genre TO gender'); diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20150812110708.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20150812110708.php index efe46d436..548d559c8 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20150812110708.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20150812110708.php @@ -1,26 +1,26 @@ , - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20150820113409.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20150820113409.php index 4e99cf185..0fd03cc59 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20150820113409.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20150820113409.php @@ -1,26 +1,26 @@ , - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\Migrations\AbstractMigration; use Doctrine\DBAL\Schema\Schema; diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20160310161006.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20160310161006.php index 847802f94..50442668c 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20160310161006.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20160310161006.php @@ -1,6 +1,6 @@ abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->addSql('DROP TABLE chill_person_persons_to_addresses'); - + } } diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20160422000000.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20160422000000.php index 3bfba03d9..530c026b4 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20160422000000.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20160422000000.php @@ -1,6 +1,6 @@ 1'); - + $personWithTwoAddressWithSameValidFrom = $stmt->fetchAll(); - + foreach ($personWithTwoAddressWithSameValidFrom as $p) { $this->warnIf(true, 'The person with id '.$p['id'].' has two adresses with the same validFrom date'); } - + $this->abortIf( sizeof($personWithTwoAddressWithSameValidFrom) != 0, 'There exists some person with multiple adress with the same validFrom' diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20160818113633.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20160818113633.php index b8ca9d8db..d82efb2fd 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20160818113633.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20160818113633.php @@ -1,6 +1,6 @@ 'integer', - 'streetaddress1' => 'varchar(255)', + 'address_id' => 'integer', + 'streetaddress1' => 'varchar(255)', 'streetaddress2' => 'varchar(255)', - 'validfrom' => 'date', - 'postcode_label' => 'varchar(255)', - 'postcode_code' => 'varchar(100)', - 'postcode_id' => 'integer', - 'country_name' => 'json', - 'country_code' => 'varchar(3)', + 'validfrom' => 'date', + 'postcode_label' => 'varchar(255)', + 'postcode_code' => 'varchar(100)', + 'postcode_id' => 'integer', + 'country_name' => 'json', + 'country_code' => 'varchar(3)', 'country_id' => 'integer' ); - + /** * @param Schema $schema */ @@ -35,19 +35,19 @@ CREATE OR REPLACE FUNCTION public.get_last_address ( before_date date) RETURNS TABLE( person_id integer, - address_id integer, - streetaddress1 varchar(255), + address_id integer, + streetaddress1 varchar(255), streetaddress2 varchar(255), - validfrom date, - postcode_label varchar(255), - postcode_code varchar(100), - postcode_id integer, - country_name json, - country_code varchar(3), + validfrom date, + postcode_label varchar(255), + postcode_code varchar(100), + postcode_id integer, + country_name json, + country_code varchar(3), country_id integer) AS $BODY$ -SELECT +SELECT pid AS person_id, chill_main_address.id AS address_id, chill_main_address.streetaddress1, @@ -61,11 +61,11 @@ SELECT country.id AS country_id FROM chill_main_address JOIN ( - SELECT + SELECT chill_main_address.id AS address_id, validfrom, rank() OVER (PARTITION BY person_id ORDER BY validfrom DESC) as pos - FROM chill_person_persons_to_addresses + FROM chill_person_persons_to_addresses JOIN chill_main_address ON chill_person_persons_to_addresses.address_id = chill_main_address.id WHERE person_id = pid AND chill_main_address.validfrom <= before_date @@ -78,7 +78,7 @@ LANGUAGE sql VOLATILE COST 100; SQL ); - + // create function to get part of address foreach ($this->fields as $var => $type) { $this->addSql(sprintf(<<<'SQL' @@ -111,7 +111,7 @@ DROP FUNCTION get_last_address_$var ( SQL ); } - + $this->addSQL(<<addSql("ALTER TABLE chill_person_person ADD fullnameCanonical VARCHAR(255) DEFAULT '' "); $this->addSql("UPDATE chill_person_person SET fullnameCanonical=LOWER(UNACCENT(CONCAT(firstname, ' ', lastname)))"); $this->addSql("CREATE INDEX fullnameCanonical_trgm_idx ON chill_person_person USING GIN (fullnameCanonical gin_trgm_ops)"); - + $this->addSql(<<<'SQL' CREATE OR REPLACE FUNCTION canonicalize_fullname_on_update() RETURNS TRIGGER AS $BODY$ @@ -42,7 +42,7 @@ SQL EXECUTE PROCEDURE canonicalize_fullname_on_update(); SQL ); - + $this->addSql(<<<'SQL' CREATE OR REPLACE FUNCTION canonicalize_fullname_on_insert() RETURNS TRIGGER AS $BODY$ diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20190701124238.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20190701124238.php index abe3a11f2..6e1fd302a 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20190701124238.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20190701124238.php @@ -1,6 +1,6 @@ addSql("CREATE INDEX phonenumber_trgm_idx ON public.chill_person_person USING gin (phonenumber gin_trgm_ops)"); - + $this->addSql("CREATE INDEX mobilenumber_trgm_idx ON public.chill_person_person USING gin (mobilenumber gin_trgm_ops)"); diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20200128084445.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20200128084445.php index 26f5f4683..3439abd95 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20200128084445.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20200128084445.php @@ -1,6 +1,6 @@ addSql(self::CANONICALIZE_FULLNAME_ON_ALT_NAME_INSERT); $this->addSql(self::CANONICALIZE_FULLNAME_ON_ALT_NAME_DELETE); $this->addSql(self::CANONICALIZE_FULLNAME_ON_ALT_NAME_UPDATE); - + } public function down(Schema $schema): void @@ -150,5 +150,5 @@ SQL; SQL ); } - + } diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20200310090632.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20200310090632.php index 3a32f4bfc..4cfafea03 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20200310090632.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20200310090632.php @@ -1,6 +1,6 @@ addSql('CREATE INDEX IDX_49A3871F550B0C53 ON persons_accompanying_periods (accompanyingperiod_id)'); $this->addSql('ALTER TABLE persons_accompanying_periods ADD CONSTRAINT FK_49A3871F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE persons_accompanying_periods ADD CONSTRAINT FK_49A3871F550B0C53 FOREIGN KEY (accompanyingperiod_id) REFERENCES chill_person_accompanying_period (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); - + // insert datas in new join table $this->addSql('INSERT INTO persons_accompanying_periods (person_id, accompanyingperiod_id) ' . 'SELECT person_id, id as accompagnying_period_id FROM chill_person_accompanying_period WHERE person_id IS NOT NULL'); - + // drop column $this->addSql('DROP INDEX idx_64a4a621217bbb47'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT fk_64a4a621217bbb47'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP person_id'); } - + /** * The distinct clause makes that for each group of duplicates, it keeps only the first row in the returned result set. * Then we have only few lost datas. Lost datas: when many persons for one AccompanyingPeriod (keep only first person) @@ -63,7 +63,7 @@ final class Version20210326113045 extends AbstractMigration . 'ORDER BY id, person_id ASC ' . ') AS jt ' . 'WHERE ap.id = jt.id'); - + // drop join table $this->addSql('DROP TABLE persons_accompanying_periods'); } diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329090904.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329090904.php index 1ccab6a50..9ac49663f 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329090904.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329090904.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -24,22 +24,22 @@ final class Version20210329090904 extends AbstractMigration $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_origin_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE TABLE chill_person_accompanying_period_origin (id INT NOT NULL, label VARCHAR(255) NOT NULL, noActiveAfter DATE DEFAULT NULL, PRIMARY KEY(id))'); $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_origin.noActiveAfter IS \'(DC2Type:date_immutable)\''); - + $this->addSql('ALTER TABLE chill_person_accompanying_period ADD origin_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT FK_E260A86856A273CC FOREIGN KEY (origin_id) REFERENCES chill_person_accompanying_period_origin (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('CREATE INDEX IDX_E260A86856A273CC ON chill_person_accompanying_period (origin_id)'); - + } public function down(Schema $schema) : void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A86856A273CC'); - + $this->addSql('DROP SEQUENCE chill_person_accompanying_period_origin_id_seq CASCADE'); $this->addSql('DROP TABLE chill_person_accompanying_period_origin'); - + $this->addSql('DROP INDEX IDX_E260A86856A273CC'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP origin_id'); - + } } diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329113152.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329113152.php index 2cba2dd7e..b9d0912cb 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329113152.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329113152.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -23,29 +23,29 @@ final class Version20210329113152 extends AbstractMigration { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_comment_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE TABLE chill_person_accompanying_period_comment (id INT NOT NULL, creator_id INT NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, content TEXT NOT NULL, accompanyingPeriod_id INT NOT NULL, updatedBy_id INT NOT NULL, PRIMARY KEY(id))'); - + $this->addSql('CREATE INDEX IDX_CD960EF3D7FA8EF0 ON chill_person_accompanying_period_comment (accompanyingPeriod_id)'); $this->addSql('CREATE INDEX IDX_CD960EF361220EA6 ON chill_person_accompanying_period_comment (creator_id)'); $this->addSql('CREATE INDEX IDX_CD960EF365FF1AEC ON chill_person_accompanying_period_comment (updatedBy_id)'); - + $this->addSql('ALTER TABLE chill_person_accompanying_period_comment ADD CONSTRAINT FK_CD960EF3D7FA8EF0 FOREIGN KEY (accompanyingPeriod_id) REFERENCES chill_person_accompanying_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period_comment ADD CONSTRAINT FK_CD960EF361220EA6 FOREIGN KEY (creator_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period_comment ADD CONSTRAINT FK_CD960EF365FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - - + + $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_resource_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE TABLE chill_person_accompanying_period_resource (id INT NOT NULL, person_id INT DEFAULT NULL, comment_id INT DEFAULT NULL, accompanyingPeriod_id INT NOT NULL, thirdParty_id INT DEFAULT NULL, PRIMARY KEY(id))'); - + $this->addSql('CREATE INDEX IDX_DC78989FD7FA8EF0 ON chill_person_accompanying_period_resource (accompanyingPeriod_id)'); $this->addSql('CREATE INDEX IDX_DC78989F3EA5CAB0 ON chill_person_accompanying_period_resource (thirdParty_id)'); $this->addSql('CREATE INDEX IDX_DC78989F217BBB47 ON chill_person_accompanying_period_resource (person_id)'); $this->addSql('CREATE INDEX IDX_DC78989FF8697D13 ON chill_person_accompanying_period_resource (comment_id)'); - + $this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD CONSTRAINT FK_DC78989FD7FA8EF0 FOREIGN KEY (accompanyingPeriod_id) REFERENCES chill_person_accompanying_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD CONSTRAINT FK_DC78989F3EA5CAB0 FOREIGN KEY (thirdParty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD CONSTRAINT FK_DC78989F217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD CONSTRAINT FK_DC78989FF8697D13 FOREIGN KEY (comment_id) REFERENCES chill_person_accompanying_period_comment (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - + } public function down(Schema $schema) : void @@ -55,6 +55,6 @@ final class Version20210329113152 extends AbstractMigration $this->addSql('DROP SEQUENCE chill_person_accompanying_period_comment_id_seq CASCADE'); $this->addSql('DROP TABLE chill_person_accompanying_period_comment'); - + } } diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329144338.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329144338.php index dc75997ab..cedcc2438 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329144338.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210329144338.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -22,13 +22,13 @@ final class Version20210329144338 extends AbstractMigration public function up(Schema $schema) : void { $this->addSql('CREATE TABLE accompanying_periods_scopes (accompanying_period_id INT NOT NULL, scope_id INT NOT NULL, PRIMARY KEY(accompanying_period_id, scope_id))'); - + $this->addSql('CREATE INDEX IDX_87C4EAB032A7A428 ON accompanying_periods_scopes (accompanying_period_id)'); $this->addSql('CREATE INDEX IDX_87C4EAB0682B5931 ON accompanying_periods_scopes (scope_id)'); - + $this->addSql('ALTER TABLE accompanying_periods_scopes ADD CONSTRAINT FK_87C4EAB032A7A428 FOREIGN KEY (accompanying_period_id) REFERENCES chill_person_accompanying_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE accompanying_periods_scopes ADD CONSTRAINT FK_87C4EAB0682B5931 FOREIGN KEY (scope_id) REFERENCES scopes (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - + $this->addSql('ALTER TABLE chill_person_accompanying_period ADD step VARCHAR(32) DEFAULT NULL'); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD intensity VARCHAR(255) DEFAULT NULL'); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD createdBy_id INT DEFAULT NULL'); @@ -37,11 +37,11 @@ final class Version20210329144338 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period ADD requestorAnonymous BOOLEAN NOT NULL DEFAULT \'false\''); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD emergency BOOLEAN NOT NULL DEFAULT \'false\''); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD confidential BOOLEAN NOT NULL DEFAULT \'false\''); - + $this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT FK_E260A8683174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT FK_E260A86834269C3F FOREIGN KEY (requestorPerson_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT FK_E260A868CFE4D554 FOREIGN KEY (requestorThirdParty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - + $this->addSql('CREATE INDEX IDX_E260A8683174800F ON chill_person_accompanying_period (createdBy_id)'); $this->addSql('CREATE INDEX IDX_E260A86834269C3F ON chill_person_accompanying_period (requestorPerson_id)'); $this->addSql('CREATE INDEX IDX_E260A868CFE4D554 ON chill_person_accompanying_period (requestorThirdParty_id)'); @@ -50,17 +50,17 @@ final class Version20210329144338 extends AbstractMigration public function down(Schema $schema) : void { - + $this->addSql('DROP TABLE accompanying_periods_scopes'); - + $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A8683174800F'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A86834269C3F'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868CFE4D554'); - + $this->addSql('DROP INDEX IDX_E260A8683174800F'); $this->addSql('DROP INDEX IDX_E260A86834269C3F'); $this->addSql('DROP INDEX IDX_E260A868CFE4D554'); - + $this->addSql('ALTER TABLE chill_person_accompanying_period DROP step'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP intensity'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP createdBy_id'); @@ -69,6 +69,6 @@ final class Version20210329144338 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period DROP requestorAnonymous'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP emergency'); $this->addSql('ALTER TABLE chill_person_accompanying_period DROP confidential'); - + } } diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210330164922.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210330164922.php index 681132565..4bec623c4 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210330164922.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210330164922.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210331084527.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210331084527.php index 9c379c4b0..39e80d000 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210331084527.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210331084527.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; @@ -16,23 +16,23 @@ final class Version20210331084527 extends AbstractMigration { return 'Transform join table between Person and AccompanyingPeriod in Doctrine entity'; } - + public function up(Schema $schema) : void { // 1 $this->addSql('ALTER TABLE persons_accompanying_periods DROP CONSTRAINT persons_accompanying_periods_pkey'); $this->addSql('ALTER TABLE persons_accompanying_periods RENAME TO chill_person_accompanying_period_participation'); - + // 2 // SERIAL automatically create sequence with NEXTVAL() $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ADD COLUMN id SERIAL NOT NULL PRIMARY KEY'); // drop NEXTVAL() in column definition $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER id DROP DEFAULT'); - + // 3 $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ADD startDate DATE NOT NULL DEFAULT \'1970-01-01\''); $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ADD endDate DATE DEFAULT NULL'); - + // 4 $this->addSql('ALTER TABLE chill_person_accompanying_period_participation DROP CONSTRAINT fk_49a3871f217bbb47'); $this->addSql('ALTER TABLE chill_person_accompanying_period_participation DROP CONSTRAINT fk_49a3871f550b0c53'); @@ -41,7 +41,7 @@ final class Version20210331084527 extends AbstractMigration $this->addSql('ALTER INDEX idx_49a3871f217bbb47 RENAME TO IDX_A59DF89F217BBB47'); $this->addSql('ALTER INDEX idx_49a3871f550b0c53 RENAME TO IDX_A59DF89F550B0C53'); } - + public function down(Schema $schema) : void { // 4 @@ -51,15 +51,15 @@ final class Version20210331084527 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period_participation ADD CONSTRAINT fk_49a3871f550b0c53 FOREIGN KEY (accompanyingperiod_id) REFERENCES chill_person_accompanying_period (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER INDEX idx_a59df89f550b0c53 RENAME TO idx_49a3871f550b0c53'); $this->addSql('ALTER INDEX idx_a59df89f217bbb47 RENAME TO idx_49a3871f217bbb47'); - + // 3 $this->addSql('ALTER TABLE chill_person_accompanying_period_participation DROP startDate'); $this->addSql('ALTER TABLE chill_person_accompanying_period_participation DROP endDate'); - + // 2 $this->addSql('DROP SEQUENCE chill_person_accompanying_period_participation_id_seq CASCADE'); $this->addSql('ALTER TABLE chill_person_accompanying_period_participation DROP id'); - + // 1 $this->addSql('ALTER TABLE chill_person_accompanying_period_participation RENAME TO persons_accompanying_periods'); $this->addSql('ALTER TABLE persons_accompanying_periods ADD CONSTRAINT persons_accompanying_periods_pkey PRIMARY KEY (person_id, accompanyingperiod_id)'); diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105054.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105054.php index c2b752822..3487a5c8a 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105054.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105054.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105940.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105940.php index 4214c7069..48c24e92b 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105940.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419105940.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419112619.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419112619.php index 919fe4cff..4f0436460 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419112619.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210419112619.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210426145930.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210426145930.php index 177633433..b6f59030a 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210426145930.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210426145930.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration; diff --git a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210427125700.php b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210427125700.php index 853d0b763..4fa0bce65 100644 --- a/src/Bundle/ChillPersonBundle/src/Migrations/Version20210427125700.php +++ b/src/Bundle/ChillPersonBundle/src/Migrations/Version20210427125700.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Chill\Migrations\Person; +namespace Chill\PersonBundle\Migrations; use Doctrine\DBAL\Schema\Schema; use Doctrine\Migrations\AbstractMigration;