Passed
Push — master ( 281a99...43b2c9 )
by Angel Fernando Quiroz
09:10 queued 14s
created

Version20230904173401   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 14 2
A getDescription() 0 3 1
1
<?php
2
3
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
4
5
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
6
use Doctrine\DBAL\Schema\Schema;
7
8
class Version20230904173401 extends AbstractMigrationChamilo
9
{
10
    public function getDescription(): string
11
    {
12
        return 'Calendar: Cleanup about invitations/subscriptions';
13
    }
14
15
    /**
16
     * @inheritDoc
17
     */
18
    public function up(Schema $schema): void
19
    {
20
        if ($schema->hasTable('agenda_event_invitation')) {
21
22
            $this->addSql('ALTER TABLE personal_agenda DROP FOREIGN KEY FK_D8612460AF68C6B');
23
            $this->addSql("DROP INDEX UNIQ_D8612460AF68C6B ON personal_agenda");
24
25
            $this->addSql("ALTER TABLE personal_agenda DROP agenda_event_invitation_id, DROP collective, DROP subscription_visibility, DROP subscription_item_id");
26
27
            $this->addSql("ALTER TABLE agenda_event_invitation DROP FOREIGN KEY FK_52A2D5E161220EA6");
28
            $this->addSql("DROP TABLE agenda_event_invitation");
29
30
            $this->addSql("ALTER TABLE agenda_event_invitee DROP FOREIGN KEY FK_4F5757FEA76ED395");
31
            $this->addSql("DROP TABLE agenda_event_invitee");
32
        }
33
    }
34
}
35