Version0_17_0::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace App\Migration;
4
5
use Doctrine\DBAL\Schema\Schema;
0 ignored issues
show
Bug introduced by
The type Doctrine\DBAL\Schema\Schema was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Doctrine\Migrations\AbstractMigration;
0 ignored issues
show
Bug introduced by
The type Doctrine\Migrations\AbstractMigration was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Doctrine\DBAL\Migrations\Version;
0 ignored issues
show
Bug introduced by
The type Doctrine\DBAL\Migrations\Version was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Ds\Component\Acl\Migration\Version0_17_0 as Acl;
0 ignored issues
show
Bug introduced by
The type Ds\Component\Acl\Migration\Version0_17_0 was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
9
10
/**
11
 * Class Version0_17_0
12
 */
13
final class Version0_17_0 extends AbstractMigration
14
{
15
    /**
16
     * @var \Ds\Component\Acl\Migration\Version0_17_0
17
     */
18
    private $acl;
19
20
    /**
21
     * Constructor
22
     *
23
     * @param \Doctrine\DBAL\Migrations\Version  $version
24
     */
25
    public function __construct(Version $version)
26
    {
27
        parent::__construct($version);
28
        $this->acl = new Acl($version);
29
    }
30
31
    /**
32
     * Up migration
33
     *
34
     * @param \Doctrine\DBAL\Schema\Schema $schema
35
     */
36
    public function up(Schema $schema)
37
    {
38
        $this->acl->up($schema);
39
40
        $this->addSql('ALTER TABLE app_anonymous_role DROP CONSTRAINT app_anonymous_role_pkey');
41
        $this->addSql('ALTER TABLE app_anonymous_role RENAME TO app_anonymous_role_prev');
42
        $this->addSql('DROP INDEX IDX_E2D1EAF6FA93803');
43
        $this->addSql('DROP INDEX IDX_E2D1EAF6D60322AC');
44
        $this->addSql('ALTER TABLE app_individual_role DROP CONSTRAINT app_individual_role_pkey');
45
        $this->addSql('ALTER TABLE app_individual_role RENAME TO app_individual_role_prev');
46
        $this->addSql('DROP INDEX IDX_C5713550AE271C0D');
47
        $this->addSql('DROP INDEX IDX_C5713550D60322AC');
48
        $this->addSql('ALTER TABLE app_organization_role DROP CONSTRAINT app_organization_role_pkey');
49
        $this->addSql('ALTER TABLE app_organization_role RENAME TO app_organization_role_prev');
50
        $this->addSql('DROP INDEX IDX_CF25196832C8A3DE');
51
        $this->addSql('DROP INDEX IDX_CF251968D60322AC');
52
        $this->addSql('ALTER TABLE app_staff_role DROP CONSTRAINT app_staff_role_pkey');
53
        $this->addSql('ALTER TABLE app_staff_role RENAME TO app_staff_role_prev');
54
        $this->addSql('DROP INDEX IDX_E3445799D4D57CD');
55
        $this->addSql('DROP INDEX IDX_E3445799D60322AC');
56
        $this->addSql('ALTER TABLE app_system_role DROP CONSTRAINT app_system_role_pkey');
57
        $this->addSql('ALTER TABLE app_system_role RENAME TO app_system_role_prev');
58
        $this->addSql('DROP INDEX IDX_1F401F20D0952FA5');
59
        $this->addSql('DROP INDEX IDX_1F401F20D60322AC');
60
61
        $this->addSql('CREATE SEQUENCE app_anonymous_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
62
        $this->addSql('CREATE SEQUENCE app_individual_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
63
        $this->addSql('CREATE SEQUENCE app_organization_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
64
        $this->addSql('CREATE SEQUENCE app_staff_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
65
        $this->addSql('CREATE SEQUENCE app_system_role_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
66
        $this->addSql('CREATE TABLE app_anonymous_role (id INT NOT NULL, anonymous_id INT DEFAULT NULL, role_id INT DEFAULT 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, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
67
        $this->addSql('CREATE UNIQUE INDEX UNIQ_E2D1EAF6D17F50A6 ON app_anonymous_role (uuid)');
68
        $this->addSql('CREATE INDEX IDX_E2D1EAF6FA93803 ON app_anonymous_role (anonymous_id)');
69
        $this->addSql('CREATE INDEX IDX_E2D1EAF6D60322AC ON app_anonymous_role (role_id)');
70
        $this->addSql('CREATE TABLE app_anonymous_role_bu (anonymous_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(anonymous_role_id, business_unit_id))');
71
        $this->addSql('CREATE INDEX IDX_B09CAAD23089E0B ON app_anonymous_role_bu (anonymous_role_id)');
72
        $this->addSql('CREATE INDEX IDX_B09CAADA58ECB40 ON app_anonymous_role_bu (business_unit_id)');
73
        $this->addSql('CREATE TABLE app_individual_role (id INT NOT NULL, individual_id INT DEFAULT NULL, role_id INT DEFAULT 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, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
74
        $this->addSql('CREATE UNIQUE INDEX UNIQ_C5713550D17F50A6 ON app_individual_role (uuid)');
75
        $this->addSql('CREATE INDEX IDX_C5713550AE271C0D ON app_individual_role (individual_id)');
76
        $this->addSql('CREATE INDEX IDX_C5713550D60322AC ON app_individual_role (role_id)');
77
        $this->addSql('CREATE TABLE app_individual_role_bu (individual_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(individual_role_id, business_unit_id))');
78
        $this->addSql('CREATE INDEX IDX_68A9160EFDFA321 ON app_individual_role_bu (individual_role_id)');
79
        $this->addSql('CREATE INDEX IDX_68A9160A58ECB40 ON app_individual_role_bu (business_unit_id)');
80
        $this->addSql('CREATE TABLE app_organization_role (id INT NOT NULL, organization_id INT DEFAULT NULL, role_id INT DEFAULT 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, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
81
        $this->addSql('CREATE UNIQUE INDEX UNIQ_CF251968D17F50A6 ON app_organization_role (uuid)');
82
        $this->addSql('CREATE INDEX IDX_CF25196832C8A3DE ON app_organization_role (organization_id)');
83
        $this->addSql('CREATE INDEX IDX_CF251968D60322AC ON app_organization_role (role_id)');
84
        $this->addSql('CREATE TABLE app_organization_role_bu (organization_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(organization_role_id, business_unit_id))');
85
        $this->addSql('CREATE INDEX IDX_79C5DB011BD1AAEF ON app_organization_role_bu (organization_role_id)');
86
        $this->addSql('CREATE INDEX IDX_79C5DB01A58ECB40 ON app_organization_role_bu (business_unit_id)');
87
        $this->addSql('CREATE TABLE app_staff_role (id INT NOT NULL, staff_id INT DEFAULT NULL, role_id INT DEFAULT 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, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
88
        $this->addSql('CREATE UNIQUE INDEX UNIQ_E3445799D17F50A6 ON app_staff_role (uuid)');
89
        $this->addSql('CREATE INDEX IDX_E3445799D4D57CD ON app_staff_role (staff_id)');
90
        $this->addSql('CREATE INDEX IDX_E3445799D60322AC ON app_staff_role (role_id)');
91
        $this->addSql('CREATE TABLE app_staff_role_bu (staff_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(staff_role_id, business_unit_id))');
92
        $this->addSql('CREATE INDEX IDX_998CF18F8AB5351A ON app_staff_role_bu (staff_role_id)');
93
        $this->addSql('CREATE INDEX IDX_998CF18FA58ECB40 ON app_staff_role_bu (business_unit_id)');
94
        $this->addSql('CREATE TABLE app_system_role (id INT NOT NULL, system_id INT DEFAULT NULL, role_id INT DEFAULT 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, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
95
        $this->addSql('CREATE UNIQUE INDEX UNIQ_1F401F20D17F50A6 ON app_system_role (uuid)');
96
        $this->addSql('CREATE INDEX IDX_1F401F20D0952FA5 ON app_system_role (system_id)');
97
        $this->addSql('CREATE INDEX IDX_1F401F20D60322AC ON app_system_role (role_id)');
98
        $this->addSql('CREATE TABLE app_system_role_bu (system_role_id INT NOT NULL, business_unit_id INT NOT NULL, PRIMARY KEY(system_role_id, business_unit_id))');
99
        $this->addSql('CREATE INDEX IDX_6CCE35F83A705E3F ON app_system_role_bu (system_role_id)');
100
        $this->addSql('CREATE INDEX IDX_6CCE35F8A58ECB40 ON app_system_role_bu (business_unit_id)');
101
        $this->addSql('ALTER TABLE app_anonymous_role ADD CONSTRAINT FK_E2D1EAF6FA93803 FOREIGN KEY (anonymous_id) REFERENCES app_anonymous (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
102
        $this->addSql('ALTER TABLE app_anonymous_role ADD CONSTRAINT FK_E2D1EAF6D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
103
        $this->addSql('ALTER TABLE app_anonymous_role_bu ADD CONSTRAINT FK_B09CAAD23089E0B FOREIGN KEY (anonymous_role_id) REFERENCES app_anonymous_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
104
        $this->addSql('ALTER TABLE app_anonymous_role_bu ADD CONSTRAINT FK_B09CAADA58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
105
        $this->addSql('ALTER TABLE app_individual_role ADD CONSTRAINT FK_C5713550AE271C0D FOREIGN KEY (individual_id) REFERENCES app_individual (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
106
        $this->addSql('ALTER TABLE app_individual_role ADD CONSTRAINT FK_C5713550D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
107
        $this->addSql('ALTER TABLE app_individual_role_bu ADD CONSTRAINT FK_68A9160EFDFA321 FOREIGN KEY (individual_role_id) REFERENCES app_individual_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
108
        $this->addSql('ALTER TABLE app_individual_role_bu ADD CONSTRAINT FK_68A9160A58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
109
        $this->addSql('ALTER TABLE app_organization_role ADD CONSTRAINT FK_CF25196832C8A3DE FOREIGN KEY (organization_id) REFERENCES app_organization (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
110
        $this->addSql('ALTER TABLE app_organization_role ADD CONSTRAINT FK_CF251968D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
111
        $this->addSql('ALTER TABLE app_organization_role_bu ADD CONSTRAINT FK_79C5DB011BD1AAEF FOREIGN KEY (organization_role_id) REFERENCES app_organization_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
112
        $this->addSql('ALTER TABLE app_organization_role_bu ADD CONSTRAINT FK_79C5DB01A58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
113
        $this->addSql('ALTER TABLE app_staff_role ADD CONSTRAINT FK_E3445799D4D57CD FOREIGN KEY (staff_id) REFERENCES app_staff (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
114
        $this->addSql('ALTER TABLE app_staff_role ADD CONSTRAINT FK_E3445799D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
115
        $this->addSql('ALTER TABLE app_staff_role_bu ADD CONSTRAINT FK_998CF18F8AB5351A FOREIGN KEY (staff_role_id) REFERENCES app_staff_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
116
        $this->addSql('ALTER TABLE app_staff_role_bu ADD CONSTRAINT FK_998CF18FA58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
117
        $this->addSql('ALTER TABLE app_system_role ADD CONSTRAINT FK_1F401F20D0952FA5 FOREIGN KEY (system_id) REFERENCES app_system (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
118
        $this->addSql('ALTER TABLE app_system_role ADD CONSTRAINT FK_1F401F20D60322AC FOREIGN KEY (role_id) REFERENCES app_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
119
        $this->addSql('ALTER TABLE app_system_role_bu ADD CONSTRAINT FK_6CCE35F83A705E3F FOREIGN KEY (system_role_id) REFERENCES app_system_role (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
120
        $this->addSql('ALTER TABLE app_system_role_bu ADD CONSTRAINT FK_6CCE35F8A58ECB40 FOREIGN KEY (business_unit_id) REFERENCES app_bu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
121
122
        $this->addSql('INSERT INTO app_anonymous_role (id, anonymous_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_anonymous_role_id_seq\'), app_anonymous_role_prev.anonymous_id, app_anonymous_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_anonymous.owner, app_anonymous.owner_uuid, 1, app_anonymous.tenant, \'now()\', \'now()\' FROM app_anonymous_role_prev LEFT JOIN app_anonymous ON app_anonymous.id = app_anonymous_role_prev.anonymous_id');
123
        $this->addSql('DROP TABLE app_anonymous_role_prev');
124
        $this->addSql('INSERT INTO app_individual_role (id, individual_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_individual_role_id_seq\'), app_individual_role_prev.individual_id, app_individual_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_individual.owner, app_individual.owner_uuid, 1, app_individual.tenant, \'now()\', \'now()\' FROM app_individual_role_prev LEFT JOIN app_individual ON app_individual.id = app_individual_role_prev.individual_id');
125
        $this->addSql('DROP TABLE app_individual_role_prev');
126
        $this->addSql('INSERT INTO app_organization_role (id, organization_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_organization_role_id_seq\'), app_organization_role_prev.organization_id, app_organization_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_organization.owner, app_organization.owner_uuid, 1, app_organization.tenant, \'now()\', \'now()\' FROM app_organization_role_prev LEFT JOIN app_organization ON app_organization.id = app_organization_role_prev.organization_id');
127
        $this->addSql('DROP TABLE app_organization_role_prev');
128
        $this->addSql('INSERT INTO app_staff_role (id, staff_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_staff_role_id_seq\'), app_staff_role_prev.staff_id, app_staff_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_staff.owner, app_staff.owner_uuid, 1, app_staff.tenant, \'now()\', \'now()\' FROM app_staff_role_prev LEFT JOIN app_staff ON app_staff.id = app_staff_role_prev.staff_id');
129
        $this->addSql('DROP TABLE app_staff_role_prev');
130
        $this->addSql('INSERT INTO app_system_role (id, system_id, role_id, uuid, owner, owner_uuid, version, tenant, created_at, updated_at) SELECT nextval(\'app_system_role_id_seq\'), app_system_role_prev.system_id, app_system_role_prev.role_id, uuid_in(overlay(overlay(md5(random()::text || \':\' || clock_timestamp()::text) placing \'4\' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring), app_system.owner, app_system.owner_uuid, 1, app_system.tenant, \'now()\', \'now()\' FROM app_system_role_prev LEFT JOIN app_system ON app_system.id = app_system_role_prev.system_id');
131
        $this->addSql('DROP TABLE app_system_role_prev');
132
    }
133
134
    /**
135
     * Down migration
136
     *
137
     * @param \Doctrine\DBAL\Schema\Schema $schema
138
     */
139
    public function down(Schema $schema)
140
    {
141
        $this->acl->down($schema);
142
143
        $this->addSql('DROP INDEX IDX_B09CAAD23089E0B');
144
        $this->addSql('DROP INDEX IDX_B09CAADA58ECB40');
145
        $this->addSql('DROP TABLE app_anonymous_role_bu');
146
        $this->addSql('DROP INDEX UNIQ_E2D1EAF6D17F50A6');
147
        $this->addSql('ALTER TABLE app_anonymous_role DROP CONSTRAINT app_anonymous_role_pkey');
148
        $this->addSql('ALTER TABLE app_anonymous_role ADD CONSTRAINT app_anonymous_role_pkey PRIMARY KEY(anonymous_id, role_id)');
149
        $this->addSql('ALTER TABLE app_anonymous_role DROP COLUMN id, DROP COLUMN uuid, DROP COLUMN owner, DROP COLUMN owner_uuid, DROP COLUMN version, DROP COLUMN tenant, DROP COLUMN created_at, DROP COLUMN updated_at');
150
        $this->addSql('DROP INDEX IDX_68A9160EFDFA321');
151
        $this->addSql('DROP INDEX IDX_68A9160A58ECB40');
152
        $this->addSql('DROP TABLE app_individual_role_bu');
153
        $this->addSql('DROP INDEX UNIQ_C5713550D17F50A6');
154
        $this->addSql('ALTER TABLE app_individual_role DROP CONSTRAINT app_individual_role_pkey');
155
        $this->addSql('ALTER TABLE app_individual_role ADD CONSTRAINT app_individual_role_pkey PRIMARY KEY(individual_id, role_id)');
156
        $this->addSql('ALTER TABLE app_individual_role DROP COLUMN id, DROP COLUMN uuid, DROP COLUMN owner, DROP COLUMN owner_uuid, DROP COLUMN version, DROP COLUMN tenant, DROP COLUMN created_at, DROP COLUMN updated_at');
157
        $this->addSql('DROP INDEX IDX_79C5DB01A58ECB40');
158
        $this->addSql('DROP INDEX IDX_79C5DB011BD1AAEF');
159
        $this->addSql('DROP TABLE app_organization_role_bu');
160
        $this->addSql('DROP INDEX UNIQ_CF251968D17F50A6');
161
        $this->addSql('ALTER TABLE app_organization_role DROP CONSTRAINT app_organization_role_pkey');
162
        $this->addSql('ALTER TABLE app_organization_role ADD CONSTRAINT app_organization_role_pkey PRIMARY KEY(organization_id, role_id)');
163
        $this->addSql('ALTER TABLE app_organization_role DROP COLUMN id, DROP COLUMN uuid, DROP COLUMN owner, DROP COLUMN owner_uuid, DROP COLUMN version, DROP COLUMN tenant, DROP COLUMN created_at, DROP COLUMN updated_at');
164
        $this->addSql('DROP INDEX IDX_998CF18FA58ECB40');
165
        $this->addSql('DROP INDEX IDX_998CF18F8AB5351A');
166
        $this->addSql('DROP TABLE app_staff_role_bu');
167
        $this->addSql('DROP INDEX UNIQ_E3445799D17F50A6');
168
        $this->addSql('ALTER TABLE app_staff_role DROP CONSTRAINT app_staff_role_pkey');
169
        $this->addSql('ALTER TABLE app_staff_role ADD CONSTRAINT app_staff_role_pkey PRIMARY KEY(staff_id, role_id)');
170
        $this->addSql('ALTER TABLE app_staff_role DROP COLUMN id, DROP COLUMN uuid, DROP COLUMN owner, DROP COLUMN owner_uuid, DROP COLUMN version, DROP COLUMN tenant, DROP COLUMN created_at, DROP COLUMN updated_at');
171
        $this->addSql('DROP INDEX IDX_6CCE35F8A58ECB40');
172
        $this->addSql('DROP INDEX IDX_6CCE35F83A705E3F');
173
        $this->addSql('DROP TABLE app_system_role_bu');
174
        $this->addSql('DROP INDEX UNIQ_1F401F20D17F50A6');
175
        $this->addSql('ALTER TABLE app_system_role DROP CONSTRAINT app_system_role_pkey');
176
        $this->addSql('ALTER TABLE app_system_role ADD CONSTRAINT app_system_role_pkey PRIMARY KEY(system_id, role_id)');
177
        $this->addSql('ALTER TABLE app_system_role DROP COLUMN id, DROP COLUMN uuid, DROP COLUMN owner, DROP COLUMN owner_uuid, DROP COLUMN version, DROP COLUMN tenant, DROP COLUMN created_at, DROP COLUMN updated_at');
178
        $this->addSql('DROP SEQUENCE app_anonymous_role_id_seq CASCADE');
179
        $this->addSql('DROP SEQUENCE app_individual_role_id_seq CASCADE');
180
        $this->addSql('DROP SEQUENCE app_organization_role_id_seq CASCADE');
181
        $this->addSql('DROP SEQUENCE app_staff_role_id_seq CASCADE');
182
        $this->addSql('DROP SEQUENCE app_system_role_id_seq CASCADE');
183
    }
184
}
185