| Conditions | 20 |
| Paths | 18912 |
| Total Lines | 311 |
| Code Lines | 254 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 76 | public function up(Schema $schema) |
||
| 77 | { |
||
| 78 | $parameters = Parameters::parseFile(static::DIRECTORY.'/parameters.yaml'); |
||
| 79 | $this->acl->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/acl.yaml', $parameters)); |
||
| 80 | $this->config->setContainer($this->container)->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/config.yaml', $parameters)); |
||
| 81 | $this->metadata->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/metadata.yaml', $parameters)); |
||
| 82 | $this->parameter->setContainer($this->container)->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/system/parameter.yaml', $parameters)); |
||
| 83 | $this->tenant->up($schema, Objects::parseFile(static::DIRECTORY.'/0_15_0/system/tenant.yaml', $parameters)); |
||
| 84 | |||
| 85 | $businessUnits = Objects::parseFile(static::DIRECTORY.'/0_15_0/business_unit.yaml', $parameters); |
||
| 86 | $roles = Objects::parseFile(static::DIRECTORY.'/0_15_0/role.yaml', $parameters); |
||
| 87 | $staffs = Objects::parseFile(static::DIRECTORY.'/0_15_0/staff.yaml', $parameters); |
||
| 88 | $systems = Objects::parseFile(static::DIRECTORY.'/0_15_0/system.yaml', $parameters); |
||
| 89 | |||
| 90 | $ids = []; |
||
| 91 | $sequences['app_anonymous_id_seq'] = 1; |
||
| 92 | $sequences['app_anonymous_persona_id_seq'] = 1; |
||
| 93 | $sequences['app_anonymous_persona_trans_id_seq'] = 1; |
||
| 94 | $sequences['app_bu_id_seq'] = 1 + count($businessUnits); |
||
| 95 | $sequences['app_bu_trans_id_seq'] = 1; |
||
| 96 | $sequences['app_individual_id_seq'] = 1; |
||
| 97 | $sequences['app_individual_persona_id_seq'] = 1; |
||
| 98 | $sequences['app_individual_persona_trans_id_seq'] = 1; |
||
| 99 | $sequences['app_organization_id_seq'] = 1; |
||
| 100 | $sequences['app_organization_persona_id_seq'] = 1; |
||
| 101 | $sequences['app_organization_persona_trans_id_seq'] = 1; |
||
| 102 | $sequences['app_role_id_seq'] = 1 + count($roles); |
||
| 103 | $sequences['app_role_trans_id_seq'] = 1; |
||
| 104 | $sequences['app_staff_id_seq'] = 1 + count($staffs); |
||
| 105 | $sequences['app_staff_persona_id_seq'] = 1; |
||
| 106 | $sequences['app_staff_persona_trans_id_seq'] = 1; |
||
| 107 | $sequences['app_system_id_seq'] = 1 + count($businessUnits); |
||
| 108 | |||
| 109 | foreach ($businessUnits as $businessUnit) { |
||
| 110 | $sequences['app_bu_trans_id_seq'] += count((array) $businessUnit->title); |
||
| 111 | } |
||
| 112 | |||
| 113 | foreach ($roles as $role) { |
||
| 114 | $sequences['app_role_trans_id_seq'] += count((array) $role->title); |
||
| 115 | } |
||
| 116 | |||
| 117 | foreach ($staffs as $staff) { |
||
| 118 | $sequences['app_staff_persona_id_seq'] += count((array) $staff->personas); |
||
| 119 | |||
| 120 | foreach ($staff->personas as $persona) { |
||
| 121 | $sequences['app_staff_persona_trans_id_seq'] += count((array) $persona->title); |
||
| 122 | } |
||
| 123 | } |
||
| 124 | |||
| 125 | switch ($this->platform->getName()) { |
||
| 126 | case 'postgresql': |
||
| 127 | $this->addSql('CREATE SEQUENCE app_anonymous_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_anonymous_id_seq']); |
||
| 128 | $this->addSql('CREATE SEQUENCE app_anonymous_persona_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_anonymous_persona_id_seq']); |
||
| 129 | $this->addSql('CREATE SEQUENCE app_anonymous_persona_trans_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_anonymous_persona_trans_id_seq']); |
||
| 130 | $this->addSql('CREATE SEQUENCE app_bu_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_bu_id_seq']); |
||
| 131 | $this->addSql('CREATE SEQUENCE app_bu_trans_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_bu_trans_id_seq']); |
||
| 132 | $this->addSql('CREATE SEQUENCE app_individual_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_individual_id_seq']); |
||
| 133 | $this->addSql('CREATE SEQUENCE app_individual_persona_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_individual_persona_id_seq']); |
||
| 134 | $this->addSql('CREATE SEQUENCE app_individual_persona_trans_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_individual_persona_trans_id_seq']); |
||
| 135 | $this->addSql('CREATE SEQUENCE app_organization_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_organization_id_seq']); |
||
| 136 | $this->addSql('CREATE SEQUENCE app_organization_persona_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_organization_persona_id_seq']); |
||
| 137 | $this->addSql('CREATE SEQUENCE app_organization_persona_trans_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_organization_persona_trans_id_seq']); |
||
| 138 | $this->addSql('CREATE SEQUENCE app_role_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_role_id_seq']); |
||
| 139 | $this->addSql('CREATE SEQUENCE app_role_trans_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_role_trans_id_seq']); |
||
| 140 | $this->addSql('CREATE SEQUENCE app_staff_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_staff_id_seq']); |
||
| 141 | $this->addSql('CREATE SEQUENCE app_staff_persona_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_staff_persona_id_seq']); |
||
| 142 | $this->addSql('CREATE SEQUENCE app_staff_persona_trans_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_staff_persona_trans_id_seq']); |
||
| 143 | $this->addSql('CREATE SEQUENCE app_system_id_seq INCREMENT BY 1 MINVALUE 1 START '.$sequences['app_system_id_seq']); |
||
| 144 | $this->addSql('CREATE TABLE app_anonymous (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 145 | $this->addSql('CREATE UNIQUE INDEX UNIQ_6A5EB29BD17F50A6 ON app_anonymous (uuid)'); |
||
| 146 | $this->addSql('CREATE TABLE app_anonymous_role (anonymous_id INT NOT NULL, role_id INT NOT NULL, PRIMARY KEY(anonymous_id, role_id))'); |
||
| 147 | $this->addSql('CREATE INDEX IDX_E2D1EAF6FA93803 ON app_anonymous_role (anonymous_id)'); |
||
| 148 | $this->addSql('CREATE INDEX IDX_E2D1EAF6D60322AC ON app_anonymous_role (role_id)'); |
||
| 149 | $this->addSql('CREATE TABLE app_anonymous_persona (id INT NOT NULL, anonymous_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, data JSON NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 150 | $this->addSql('CREATE UNIQUE INDEX UNIQ_5ABA7A3D17F50A6 ON app_anonymous_persona (uuid)'); |
||
| 151 | $this->addSql('CREATE INDEX IDX_5ABA7A3FA93803 ON app_anonymous_persona (anonymous_id)'); |
||
| 152 | $this->addSql('COMMENT ON COLUMN app_anonymous_persona.data IS \'(DC2Type:json_array)\''); |
||
| 153 | $this->addSql('CREATE TABLE app_anonymous_persona_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
| 154 | $this->addSql('CREATE INDEX IDX_3B378E082C2AC5D3 ON app_anonymous_persona_trans (translatable_id)'); |
||
| 155 | $this->addSql('CREATE UNIQUE INDEX app_anonymous_persona_trans_unique_translation ON app_anonymous_persona_trans (translatable_id, locale)'); |
||
| 156 | $this->addSql('CREATE TABLE app_bu (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 157 | $this->addSql('CREATE UNIQUE INDEX UNIQ_F0C3D814D17F50A6 ON app_bu (uuid)'); |
||
| 158 | $this->addSql('CREATE TABLE app_bu_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) NOT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
| 159 | $this->addSql('CREATE INDEX IDX_AE7B40C2C2AC5D3 ON app_bu_trans (translatable_id)'); |
||
| 160 | $this->addSql('CREATE UNIQUE INDEX app_bu_trans_unique_translation ON app_bu_trans (translatable_id, locale)'); |
||
| 161 | $this->addSql('CREATE TABLE app_individual (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 162 | $this->addSql('CREATE UNIQUE INDEX UNIQ_D188576BD17F50A6 ON app_individual (uuid)'); |
||
| 163 | $this->addSql('CREATE TABLE app_individual_role (individual_id INT NOT NULL, role_id INT NOT NULL, PRIMARY KEY(individual_id, role_id))'); |
||
| 164 | $this->addSql('CREATE INDEX IDX_C5713550AE271C0D ON app_individual_role (individual_id)'); |
||
| 165 | $this->addSql('CREATE INDEX IDX_C5713550D60322AC ON app_individual_role (role_id)'); |
||
| 166 | $this->addSql('CREATE TABLE app_individual_persona (id INT NOT NULL, individual_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, data JSON NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 167 | $this->addSql('CREATE UNIQUE INDEX UNIQ_828FC6ED17F50A6 ON app_individual_persona (uuid)'); |
||
| 168 | $this->addSql('CREATE INDEX IDX_828FC6EAE271C0D ON app_individual_persona (individual_id)'); |
||
| 169 | $this->addSql('COMMENT ON COLUMN app_individual_persona.data IS \'(DC2Type:json_array)\''); |
||
| 170 | $this->addSql('CREATE TABLE app_individual_persona_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
| 171 | $this->addSql('CREATE INDEX IDX_2EB6F73E2C2AC5D3 ON app_individual_persona_trans (translatable_id)'); |
||
| 172 | $this->addSql('CREATE UNIQUE INDEX app_individual_persona_trans_unique_translation ON app_individual_persona_trans (translatable_id, locale)'); |
||
| 173 | $this->addSql('CREATE TABLE app_organization (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 174 | $this->addSql('CREATE UNIQUE INDEX UNIQ_36079FDD17F50A6 ON app_organization (uuid)'); |
||
| 175 | $this->addSql('CREATE TABLE app_organization_role (organization_id INT NOT NULL, role_id INT NOT NULL, PRIMARY KEY(organization_id, role_id))'); |
||
| 176 | $this->addSql('CREATE INDEX IDX_CF25196832C8A3DE ON app_organization_role (organization_id)'); |
||
| 177 | $this->addSql('CREATE INDEX IDX_CF251968D60322AC ON app_organization_role (role_id)'); |
||
| 178 | $this->addSql('CREATE TABLE app_organization_persona (id INT NOT NULL, organization_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, data JSON NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 179 | $this->addSql('CREATE UNIQUE INDEX UNIQ_7767B60FD17F50A6 ON app_organization_persona (uuid)'); |
||
| 180 | $this->addSql('CREATE INDEX IDX_7767B60F32C8A3DE ON app_organization_persona (organization_id)'); |
||
| 181 | $this->addSql('COMMENT ON COLUMN app_organization_persona.data IS \'(DC2Type:json_array)\''); |
||
| 182 | $this->addSql('CREATE TABLE app_organization_persona_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
| 183 | $this->addSql('CREATE INDEX IDX_63870C2F2C2AC5D3 ON app_organization_persona_trans (translatable_id)'); |
||
| 184 | $this->addSql('CREATE UNIQUE INDEX app_organization_persona_trans_unique_translation ON app_organization_persona_trans (translatable_id, locale)'); |
||
| 185 | $this->addSql('CREATE TABLE app_role (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, slug VARCHAR(255) NOT NULL, permissions JSON NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 186 | $this->addSql('CREATE UNIQUE INDEX UNIQ_5247AFCAD17F50A6 ON app_role (uuid)'); |
||
| 187 | $this->addSql('CREATE UNIQUE INDEX UNIQ_5247AFCA989D9B624E59C462 ON app_role (slug, tenant)'); |
||
| 188 | $this->addSql('COMMENT ON COLUMN app_role.permissions IS \'(DC2Type:json_array)\''); |
||
| 189 | $this->addSql('CREATE TABLE app_role_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
| 190 | $this->addSql('CREATE INDEX IDX_D1E65DEE2C2AC5D3 ON app_role_trans (translatable_id)'); |
||
| 191 | $this->addSql('CREATE UNIQUE INDEX app_role_trans_unique_translation ON app_role_trans (translatable_id, locale)'); |
||
| 192 | $this->addSql('CREATE TABLE app_staff (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 193 | $this->addSql('CREATE UNIQUE INDEX UNIQ_94BD7E5FD17F50A6 ON app_staff (uuid)'); |
||
| 194 | $this->addSql('CREATE TABLE app_staff_role (staff_id INT NOT NULL, role_id INT NOT NULL, PRIMARY KEY(staff_id, role_id))'); |
||
| 195 | $this->addSql('CREATE INDEX IDX_E3445799D4D57CD ON app_staff_role (staff_id)'); |
||
| 196 | $this->addSql('CREATE INDEX IDX_E3445799D60322AC ON app_staff_role (role_id)'); |
||
| 197 | $this->addSql('CREATE TABLE app_staff_bu (staff_id INT NOT NULL, bu_id INT NOT NULL, PRIMARY KEY(staff_id, bu_id))'); |
||
| 198 | $this->addSql('CREATE INDEX IDX_8C89CE59D4D57CD ON app_staff_bu (staff_id)'); |
||
| 199 | $this->addSql('CREATE INDEX IDX_8C89CE59E0319FBC ON app_staff_bu (bu_id)'); |
||
| 200 | $this->addSql('CREATE TABLE app_staff_persona (id INT NOT NULL, staff_id INT DEFAULT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, data JSON NOT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 201 | $this->addSql('CREATE UNIQUE INDEX UNIQ_972E9C81D17F50A6 ON app_staff_persona (uuid)'); |
||
| 202 | $this->addSql('CREATE INDEX IDX_972E9C81D4D57CD ON app_staff_persona (staff_id)'); |
||
| 203 | $this->addSql('COMMENT ON COLUMN app_staff_persona.data IS \'(DC2Type:json_array)\''); |
||
| 204 | $this->addSql('CREATE TABLE app_staff_persona_trans (id INT NOT NULL, translatable_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, locale VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); |
||
| 205 | $this->addSql('CREATE INDEX IDX_83B289352C2AC5D3 ON app_staff_persona_trans (translatable_id)'); |
||
| 206 | $this->addSql('CREATE UNIQUE INDEX app_staff_persona_trans_unique_translation ON app_staff_persona_trans (translatable_id, locale)'); |
||
| 207 | $this->addSql('CREATE TABLE app_system (id INT NOT NULL, uuid UUID NOT NULL, "owner" VARCHAR(255) DEFAULT NULL, owner_uuid UUID DEFAULT NULL, version INT DEFAULT 1 NOT NULL, tenant UUID NOT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))'); |
||
| 208 | $this->addSql('CREATE UNIQUE INDEX UNIQ_2C4E7C0BD17F50A6 ON app_system (uuid)'); |
||
| 209 | $this->addSql('CREATE TABLE app_system_role (system_id INT NOT NULL, role_id INT NOT NULL, PRIMARY KEY(system_id, role_id))'); |
||
| 210 | $this->addSql('CREATE INDEX IDX_1F401F20D0952FA5 ON app_system_role (system_id)'); |
||
| 211 | $this->addSql('CREATE INDEX IDX_1F401F20D60322AC ON app_system_role (role_id)'); |
||
| 212 | $this->addSql('ALTER TABLE app_anonymous_role ADD CONSTRAINT FK_E2D1EAF6FA93803 FOREIGN KEY (anonymous_id) REFERENCES app_anonymous (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 213 | $this->addSql('ALTER TABLE app_anonymous_role ADD CONSTRAINT FK_E2D1EAF6D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 214 | $this->addSql('ALTER TABLE app_anonymous_persona ADD CONSTRAINT FK_5ABA7A3FA93803 FOREIGN KEY (anonymous_id) REFERENCES app_anonymous (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 215 | $this->addSql('ALTER TABLE app_anonymous_persona_trans ADD CONSTRAINT FK_3B378E082C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_anonymous_persona (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 216 | $this->addSql('ALTER TABLE app_bu_trans ADD CONSTRAINT FK_AE7B40C2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 217 | $this->addSql('ALTER TABLE app_individual_role ADD CONSTRAINT FK_C5713550AE271C0D FOREIGN KEY (individual_id) REFERENCES app_individual (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 218 | $this->addSql('ALTER TABLE app_individual_role ADD CONSTRAINT FK_C5713550D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 219 | $this->addSql('ALTER TABLE app_individual_persona ADD CONSTRAINT FK_828FC6EAE271C0D FOREIGN KEY (individual_id) REFERENCES app_individual (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 220 | $this->addSql('ALTER TABLE app_individual_persona_trans ADD CONSTRAINT FK_2EB6F73E2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_individual_persona (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 221 | $this->addSql('ALTER TABLE app_organization_role ADD CONSTRAINT FK_CF25196832C8A3DE FOREIGN KEY (organization_id) REFERENCES app_organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 222 | $this->addSql('ALTER TABLE app_organization_role ADD CONSTRAINT FK_CF251968D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 223 | $this->addSql('ALTER TABLE app_organization_persona ADD CONSTRAINT FK_7767B60F32C8A3DE FOREIGN KEY (organization_id) REFERENCES app_organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 224 | $this->addSql('ALTER TABLE app_organization_persona_trans ADD CONSTRAINT FK_63870C2F2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_organization_persona (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 225 | $this->addSql('ALTER TABLE app_role_trans ADD CONSTRAINT FK_D1E65DEE2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_role (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 226 | $this->addSql('ALTER TABLE app_staff_role ADD CONSTRAINT FK_E3445799D4D57CD FOREIGN KEY (staff_id) REFERENCES app_staff (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 227 | $this->addSql('ALTER TABLE app_staff_role ADD CONSTRAINT FK_E3445799D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 228 | $this->addSql('ALTER TABLE app_staff_bu ADD CONSTRAINT FK_8C89CE59D4D57CD FOREIGN KEY (staff_id) REFERENCES app_staff (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 229 | $this->addSql('ALTER TABLE app_staff_bu ADD CONSTRAINT FK_8C89CE59E0319FBC FOREIGN KEY (bu_id) REFERENCES app_bu (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 230 | $this->addSql('ALTER TABLE app_staff_persona ADD CONSTRAINT FK_972E9C81D4D57CD FOREIGN KEY (staff_id) REFERENCES app_staff (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 231 | $this->addSql('ALTER TABLE app_staff_persona_trans ADD CONSTRAINT FK_83B289352C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES app_staff_persona (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 232 | $this->addSql('ALTER TABLE app_system_role ADD CONSTRAINT FK_1F401F20D0952FA5 FOREIGN KEY (system_id) REFERENCES app_system (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 233 | $this->addSql('ALTER TABLE app_system_role ADD CONSTRAINT FK_1F401F20D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 234 | |||
| 235 | $i = 0; |
||
| 236 | $j = 0; |
||
| 237 | |||
| 238 | foreach ($businessUnits as $businessUnit) { |
||
| 239 | if (null === $businessUnit->uuid) { |
||
| 240 | $businessUnit->uuid = Uuid::uuid4()->toString(); |
||
| 241 | } |
||
| 242 | |||
| 243 | $this->addSql(sprintf( |
||
| 244 | 'INSERT INTO app_bu (id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at, deleted_at) VALUES (%d, %s, %s, %s, %d, %s, %s, %s, %s);', |
||
| 245 | ++$i, |
||
| 246 | $this->connection->quote($businessUnit->uuid), |
||
| 247 | $this->connection->quote($businessUnit->owner), |
||
| 248 | $this->connection->quote($businessUnit->owner_uuid), |
||
| 249 | $businessUnit->version, |
||
| 250 | $this->connection->quote($businessUnit->tenant), |
||
| 251 | 'now()', |
||
| 252 | 'now()', |
||
| 253 | 'NULL' |
||
| 254 | )); |
||
| 255 | |||
| 256 | foreach ($businessUnit->title as $locale => $title) { |
||
| 257 | $this->addSql(sprintf('INSERT INTO app_bu_trans (id, translatable_id, title, locale) VALUES (%d, %d, %s, %s);', |
||
| 258 | ++$j, |
||
| 259 | $i, |
||
| 260 | $this->connection->quote($title), |
||
| 261 | $this->connection->quote($locale) |
||
| 262 | )); |
||
| 263 | } |
||
| 264 | } |
||
| 265 | |||
| 266 | $i = 0; |
||
| 267 | $j = 0; |
||
| 268 | |||
| 269 | foreach ($roles as $role) { |
||
| 270 | if (null === $role->uuid) { |
||
| 271 | $role->uuid = Uuid::uuid4()->toString(); |
||
| 272 | } |
||
| 273 | |||
| 274 | $this->addSql(sprintf( |
||
| 275 | 'INSERT INTO app_role (id, uuid, owner, owner_uuid, slug, permissions, version, tenant, created_at, updated_at) VALUES (%d, %s, %s, %s, %s, %s, %d, %s, %s, %s);', |
||
| 276 | ++$i, |
||
| 277 | $this->connection->quote($role->uuid), |
||
| 278 | $this->connection->quote($role->owner), |
||
| 279 | $this->connection->quote($role->owner_uuid), |
||
| 280 | $this->connection->quote($role->slug), |
||
| 281 | $this->connection->quote(json_encode($role->permissions)), |
||
| 282 | $role->version, |
||
| 283 | $this->connection->quote($role->tenant), |
||
| 284 | 'now()', |
||
| 285 | 'now()' |
||
| 286 | )); |
||
| 287 | |||
| 288 | $ids['role'][$role->uuid] = $i; |
||
| 289 | |||
| 290 | foreach ($role->title as $locale => $title) { |
||
| 291 | $this->addSql(sprintf('INSERT INTO app_role_trans (id, translatable_id, title, locale) VALUES (%d, %d, %s, %s);', |
||
| 292 | ++$j, |
||
| 293 | $i, |
||
| 294 | $this->connection->quote($title), |
||
| 295 | $this->connection->quote($locale) |
||
| 296 | )); |
||
| 297 | } |
||
| 298 | } |
||
| 299 | |||
| 300 | $i = 0; |
||
| 301 | $j = 0; |
||
| 302 | $k = 0; |
||
| 303 | |||
| 304 | foreach ($staffs as $staff) { |
||
| 305 | if (null === $staff->uuid) { |
||
| 306 | $staff->uuid = Uuid::uuid4()->toString(); |
||
| 307 | } |
||
| 308 | |||
| 309 | $this->addSql(sprintf( |
||
| 310 | 'INSERT INTO app_staff (id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at, deleted_at) VALUES (%d, %s, %s, %s, %d, %s, %s, %s, %s);', |
||
| 311 | ++$i, |
||
| 312 | $this->connection->quote($staff->uuid), |
||
| 313 | $this->connection->quote($staff->owner), |
||
| 314 | $this->connection->quote($staff->owner_uuid), |
||
| 315 | $staff->version, |
||
| 316 | $this->connection->quote($staff->tenant), |
||
| 317 | 'now()', |
||
| 318 | 'now()', |
||
| 319 | 'NULL' |
||
| 320 | )); |
||
| 321 | |||
| 322 | foreach ($staff->personas as $persona) { |
||
| 323 | if (null === $persona->uuid) { |
||
| 324 | $persona->uuid = Uuid::uuid4()->toString(); |
||
| 325 | } |
||
| 326 | |||
| 327 | $this->addSql(sprintf( |
||
| 328 | 'INSERT INTO app_staff_persona (id, staff_id, uuid, owner, owner_uuid, data, version, tenant, created_at, updated_at, deleted_at) VALUES (%d, %d, %s, %s, %s, %s, %d, %s, %s, %s, %s);', |
||
| 329 | ++$j, |
||
| 330 | $i, |
||
| 331 | $this->connection->quote($persona->uuid), |
||
| 332 | $this->connection->quote($staff->owner), |
||
| 333 | $this->connection->quote($staff->owner_uuid), |
||
| 334 | $this->connection->quote(json_encode($persona->data)), |
||
| 335 | $persona->version, |
||
| 336 | $this->connection->quote($staff->tenant), |
||
| 337 | 'now()', |
||
| 338 | 'now()', |
||
| 339 | 'NULL' |
||
| 340 | )); |
||
| 341 | |||
| 342 | foreach ($persona->title as $locale => $title) { |
||
| 343 | $this->addSql(sprintf('INSERT INTO app_staff_persona_trans (id, translatable_id, title, locale) VALUES (%d, %d, %s, %s);', |
||
| 344 | ++$k, |
||
| 345 | $j, |
||
| 346 | $this->connection->quote($title), |
||
| 347 | $this->connection->quote($locale) |
||
| 348 | )); |
||
| 349 | } |
||
| 350 | } |
||
| 351 | |||
| 352 | foreach ($staff->roles as $role) { |
||
| 353 | $this->addSql(sprintf( |
||
| 354 | 'INSERT INTO app_staff_role (staff_id, role_id) VALUES (%d, %d);', |
||
| 355 | $i, |
||
| 356 | $ids['role'][$role] |
||
| 357 | )); |
||
| 358 | } |
||
| 359 | } |
||
| 360 | |||
| 361 | $i = 0; |
||
| 362 | |||
| 363 | foreach ($systems as $system) { |
||
| 364 | if (null === $system->uuid) { |
||
| 365 | $system->uuid = Uuid::uuid4()->toString(); |
||
| 366 | } |
||
| 367 | |||
| 368 | $this->addSql(sprintf( |
||
| 369 | 'INSERT INTO app_system (id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at, deleted_at) VALUES (%d, %s, %s, %s, %d, %s, %s, %s, %s);', |
||
| 370 | ++$i, |
||
| 371 | $this->connection->quote($system->uuid), |
||
| 372 | $this->connection->quote($system->owner), |
||
| 373 | $this->connection->quote($system->owner_uuid), |
||
| 374 | $system->version, |
||
| 375 | $this->connection->quote($system->tenant), |
||
| 376 | 'now()', |
||
| 377 | 'now()', |
||
| 378 | 'NULL' |
||
| 379 | )); |
||
| 380 | } |
||
| 381 | |||
| 382 | break; |
||
| 383 | |||
| 384 | default: |
||
| 385 | $this->abortIf(true,'Migration cannot be executed on "'.$this->platform->getName().'".'); |
||
| 386 | break; |
||
| 387 | } |
||
| 475 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths