cs: Enable a couple of risky rules.

This commit is contained in:
Pol Dellaiera
2021-11-24 12:38:18 +01:00
parent acc4647346
commit f531cdc0ec
51 changed files with 130 additions and 132 deletions

View File

@@ -36,7 +36,7 @@ class Version20160422000000 extends AbstractMigration
}
$this->abortIf(
sizeof($personWithTwoAddressWithSameValidFrom) != 0,
count($personWithTwoAddressWithSameValidFrom) != 0,
'There exists some person with multiple adress with the same validFrom'
);
}

View File

@@ -62,19 +62,19 @@ class Version20170117131924 extends AbstractMigration
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,
@@ -88,11 +88,11 @@ class Version20170117131924 extends AbstractMigration
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

View File

@@ -30,19 +30,19 @@ final class Version20200422125935 extends AbstractMigration
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,
@@ -56,11 +56,11 @@ final class Version20200422125935 extends AbstractMigration
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
@@ -85,20 +85,20 @@ final class Version20200422125935 extends AbstractMigration
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),
validfrom date,
postcode_label varchar(255),
postcode_code varchar(100),
postcode_id integer,
isnoaddress boolean,
country_name json,
country_code varchar(3),
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,
@@ -113,11 +113,11 @@ final class Version20200422125935 extends AbstractMigration
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