mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 02:25:00 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\ThirdParty;
|
||||
@@ -8,10 +15,20 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Create trigger for canonicalisation on 3party + indexes
|
||||
* Create trigger for canonicalisation on 3party + indexes.
|
||||
*/
|
||||
final class Version20211007165001 extends AbstractMigration
|
||||
{
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP TRIGGER canonicalize_fullname_on_update ON chill_3party.third_party');
|
||||
$this->addSql('DROP TRIGGER canonicalize_fullname_on_insert ON chill_3party.third_party');
|
||||
$this->addSql('DROP FUNCTION chill_3party.canonicalize()');
|
||||
$this->addSql('
|
||||
DROP INDEX chill_3party.chill_custom_canonicalized_trgm_idx_gist
|
||||
');
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Create trigger for canonicalisation on 3party + indexes';
|
||||
@@ -54,33 +71,23 @@ final class Version20211007165001 extends AbstractMigration
|
||||
END
|
||||
$$
|
||||
");
|
||||
$this->addSql("
|
||||
$this->addSql('
|
||||
CREATE TRIGGER canonicalize_fullname_on_insert
|
||||
BEFORE INSERT
|
||||
ON chill_3party.third_party
|
||||
FOR EACH ROW
|
||||
EXECUTE procedure chill_3party.canonicalize();
|
||||
");
|
||||
$this->addSql("
|
||||
');
|
||||
$this->addSql('
|
||||
CREATE TRIGGER canonicalize_fullname_on_update
|
||||
BEFORE UPDATE
|
||||
ON chill_3party.third_party
|
||||
FOR EACH ROW
|
||||
EXECUTE procedure chill_3party.canonicalize();
|
||||
");
|
||||
$this->addSql("
|
||||
');
|
||||
$this->addSql('
|
||||
CREATE INDEX chill_custom_canonicalized_trgm_idx_gist
|
||||
ON chill_3party.third_party USING GIST (canonicalized gist_trgm_ops) WHERE active IS TRUE
|
||||
");
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP TRIGGER canonicalize_fullname_on_update ON chill_3party.third_party');
|
||||
$this->addSql('DROP TRIGGER canonicalize_fullname_on_insert ON chill_3party.third_party');
|
||||
$this->addSql('DROP FUNCTION chill_3party.canonicalize()');
|
||||
$this->addSql("
|
||||
DROP INDEX chill_3party.chill_custom_canonicalized_trgm_idx_gist
|
||||
");
|
||||
');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user