|
|
@@ -69,12 +69,17 @@ class PostUpgradeCommand extends Command
|
|
|
|
|
|
$this->logger->info('Populate Subdomain table from openassos.sys_domain');
|
|
|
$sql = "INSERT INTO opentalent.Subdomain (parameters_id, subdomain)
|
|
|
- SELECT o.parameters_id, SUBSTRING_INDEX(d.domainName,'.',1)
|
|
|
+ SELECT o.parameters_id, REGEXP_REPLACE(d.domainName, '^(.+)\\\\.opentalent\\\\.fr$', '\\\\1')
|
|
|
FROM openassos.sys_domain d
|
|
|
inner join opentalent.Organization o on o.cmsId = d.pid
|
|
|
where d.domainName like '%.opentalent.fr';";
|
|
|
$cnn->query($sql);
|
|
|
|
|
|
+ $sql = "update opentalent.Subdomain
|
|
|
+ set subdomain = REGEXP_REPLACE(subdomain, '\\\\.', '-')
|
|
|
+ where subdomain REGEXP '^(.*)\\\\.(.*)$';";
|
|
|
+ $cnn->query($sql);
|
|
|
+
|
|
|
$this->logger->info('Complete with subdomains from Parameters table');
|
|
|
$sql = "insert into opentalent.Subdomain (parameters_id, subdomain)
|
|
|
select p.id, p.subDomain
|