mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -22,7 +22,7 @@ class Version20150701091248 extends AbstractMigration
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE Activity DROP CONSTRAINT FK_55026B0C59BB1592');
|
||||
$this->addSql('ALTER TABLE ActivityReason DROP CONSTRAINT FK_654A2FCD12469DE2');
|
||||
@@ -40,7 +40,7 @@ class Version20150701091248 extends AbstractMigration
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('CREATE SEQUENCE Activity_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE ActivityReason_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
|
@@ -22,7 +22,7 @@ class Version20150702093317 extends AbstractMigration
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN name;');
|
||||
$this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN label VARCHAR(255) NOT NULL;');
|
||||
@@ -35,7 +35,7 @@ class Version20150702093317 extends AbstractMigration
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE ActivityReasonCategory DROP COLUMN label;');
|
||||
$this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN name JSON;');
|
||||
|
@@ -22,7 +22,7 @@ class Version20150704091347 extends AbstractMigration
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE Activity ALTER COLUMN remark SET NOT NULL;');
|
||||
$this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;');
|
||||
@@ -31,7 +31,7 @@ class Version20150704091347 extends AbstractMigration
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
$this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE Activity ALTER COLUMN remark DROP NOT NULL;');
|
||||
$this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;');
|
||||
|
@@ -25,14 +25,14 @@ class Version20160222103457 extends AbstractMigration
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->abortIf(
|
||||
$this->connection->getDatabasePlatform()->getName() !== 'postgresql',
|
||||
'postgresql' !== $this->connection->getDatabasePlatform()->getName(),
|
||||
'Migration can only be executed safely on \'postgresql\'.'
|
||||
);
|
||||
|
||||
$this->addSql('ALTER TABLE Activity ADD reason_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE Activity ADD CONSTRAINT '
|
||||
. 'fk_55026b0c59bb1592 FOREIGN KEY (reason_id) '
|
||||
. 'REFERENCES activityreason (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
.'fk_55026b0c59bb1592 FOREIGN KEY (reason_id) '
|
||||
.'REFERENCES activityreason (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX idx_55026b0c59bb1592 ON Activity (reason_id)');
|
||||
|
||||
// try to keep at least on activity reason...
|
||||
@@ -52,29 +52,29 @@ class Version20160222103457 extends AbstractMigration
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->abortIf(
|
||||
$this->connection->getDatabasePlatform()->getName() !== 'postgresql',
|
||||
'postgresql' !== $this->connection->getDatabasePlatform()->getName(),
|
||||
'Migration can only be executed safely on \'postgresql\'.'
|
||||
);
|
||||
|
||||
// create the new table activity reason
|
||||
$this->addSql(
|
||||
'CREATE TABLE activity_activityreason ('
|
||||
. 'activity_id INT NOT NULL, '
|
||||
. 'activityreason_id INT NOT NULL, '
|
||||
. 'PRIMARY KEY(activity_id, activityreason_id))'
|
||||
.'activity_id INT NOT NULL, '
|
||||
.'activityreason_id INT NOT NULL, '
|
||||
.'PRIMARY KEY(activity_id, activityreason_id))'
|
||||
);
|
||||
$this->addSql('CREATE INDEX IDX_338A864381C06096 ON activity_activityreason (activity_id)');
|
||||
$this->addSql('CREATE INDEX IDX_338A8643D771E0FC ON activity_activityreason (activityreason_id)');
|
||||
$this->addSql('ALTER TABLE activity_activityreason '
|
||||
. 'ADD CONSTRAINT FK_338A864381C06096 FOREIGN KEY (activity_id) '
|
||||
. 'REFERENCES Activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
.'ADD CONSTRAINT FK_338A864381C06096 FOREIGN KEY (activity_id) '
|
||||
.'REFERENCES Activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE activity_activityreason '
|
||||
. 'ADD CONSTRAINT FK_338A8643D771E0FC FOREIGN KEY (activityreason_id) '
|
||||
. 'REFERENCES ActivityReason (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
.'ADD CONSTRAINT FK_338A8643D771E0FC FOREIGN KEY (activityreason_id) '
|
||||
.'REFERENCES ActivityReason (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
|
||||
// migrate old data to new table
|
||||
$this->addSql('INSERT INTO activity_activityreason (activity_id, activityreason_id) '
|
||||
. 'SELECT id, reason_id FROM activity WHERE reason_id IS NOT NULL');
|
||||
.'SELECT id, reason_id FROM activity WHERE reason_id IS NOT NULL');
|
||||
|
||||
// remove old column
|
||||
$this->addSql('ALTER TABLE activity DROP CONSTRAINT fk_55026b0c59bb1592');
|
||||
|
@@ -14,8 +14,6 @@ namespace Chill\Migrations\Activity;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
@@ -49,8 +47,8 @@ final class Version20210422073711 extends AbstractMigration
|
||||
'Domicile erronéee',
|
||||
];
|
||||
|
||||
for ($i = 1; count($list) >= $i; ++$i) {
|
||||
$this->addSql('INSERT INTO activitytpresence VALUES(' . $i . ", json_build_object('fr', '" . $list[$i - 1] . "'), true)");
|
||||
for ($i = 1; \count($list) >= $i; ++$i) {
|
||||
$this->addSql('INSERT INTO activitytpresence VALUES('.$i.", json_build_object('fr', '".$list[$i - 1]."'), true)");
|
||||
}
|
||||
|
||||
$this->addSql('ALTER TABLE activity ADD emergency BOOLEAN NOT NULL DEFAULT false');
|
||||
|
@@ -58,7 +58,7 @@ final class Version20210422123846 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE0381C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE activity_thirdparty ADD CONSTRAINT FK_C6F0DE03C7D3A8E6 FOREIGN KEY (thirdparty_id) REFERENCES chill_3party.third_party (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A7881C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
//$this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A78C33F7837 FOREIGN KEY (document_id) REFERENCES Document (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
// $this->addSql('ALTER TABLE activity_document ADD CONSTRAINT FK_78633A78C33F7837 FOREIGN KEY (document_id) REFERENCES Document (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDB81C06096 FOREIGN KEY (activity_id) REFERENCES activity (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE activity_user ADD CONSTRAINT FK_8E570DDBA76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
|
||||
|
Reference in New Issue
Block a user