Skip to content

Commit 7e37019

Browse files
committed
Internal: Fix Version20251002110001 migration
1 parent 1417f09 commit 7e37019

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/CoreBundle/Migrations/Schema/V200/Version20251002110001.php

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ public function up(Schema $schema): void
2323
{
2424
$lineItem = $schema->getTable('lti_lineitem');
2525

26-
if ($lineItem->hasIndex('IDX_5C76B75D8F7B22CC')) {
27-
$this->addSql("DROP INDEX IDX_5C76B75D8F7B22CC ON lti_lineitem");
28-
}
29-
3026
if ($lineItem->hasForeignKey('FK_5C76B75D8F7B22CC')) {
3127
$this->addSql("ALTER TABLE lti_lineitem DROP FOREIGN KEY FK_5C76B75D8F7B22CC");
3228
}
3329

30+
if ($lineItem->hasIndex('IDX_5C76B75D8F7B22CC')) {
31+
$this->addSql("DROP INDEX IDX_5C76B75D8F7B22CC ON lti_lineitem");
32+
}
33+
3434
if ($lineItem->hasColumn('tool_id')) {
3535
$this->addSql('ALTER TABLE lti_lineitem DROP COLUMN tool_id');
3636
}
@@ -39,14 +39,14 @@ public function up(Schema $schema): void
3939
$this->addSql("ALTER TABLE lti_lineitem ADD CONSTRAINT FK_5C76B75D8F7B22CC FOREIGN KEY (tool_id) REFERENCES lti_external_tool (id) ON DELETE CASCADE");
4040
$this->addSql("CREATE INDEX IDX_5C76B75D8F7B22CC ON lti_lineitem (tool_id)");
4141

42-
if ($lineItem->hasIndex('UNIQ_5C76B75D1323A575')) {
43-
$this->addSql("DROP INDEX UNIQ_5C76B75D1323A575 ON lti_lineitem");
44-
}
45-
4642
if ($lineItem->hasForeignKey('FK_5C76B75D1323A575')) {
4743
$this->addSql("ALTER TABLE lti_lineitem DROP FOREIGN KEY FK_5C76B75D1323A575");
4844
}
4945

46+
if ($lineItem->hasIndex('UNIQ_5C76B75D1323A575')) {
47+
$this->addSql("DROP INDEX UNIQ_5C76B75D1323A575 ON lti_lineitem");
48+
}
49+
5050
if ($lineItem->hasColumn('evaluation')) {
5151
$this->addSql("ALTER TABLE lti_lineitem DROP COLUMN evaluation");
5252
}
@@ -56,39 +56,39 @@ public function up(Schema $schema): void
5656
$this->addSql("CREATE UNIQUE INDEX UNIQ_5C76B75D1323A575 ON lti_lineitem (evaluation)");
5757

5858
if ($lineItem->hasColumn('resource_id')) {
59-
$this->addSql("ALTER TABLE DROP COLUMN resource_id");
59+
$this->addSql("ALTER TABLE lti_lineitem DROP COLUMN resource_id");
6060
}
6161

6262
$this->addSql("ALTER TABLE lti_lineitem ADD resource_id VARCHAR(255) DEFAULT NULL");
6363

6464
if ($lineItem->hasColumn('tag')) {
65-
$this->addSql("ALTER TABLE DROP COLUMN tag");
65+
$this->addSql("ALTER TABLE lti_lineitem DROP COLUMN tag");
6666
}
6767

6868
$this->addSql("ALTER TABLE lti_lineitem ADD tag VARCHAR(255) DEFAULT NULL");
6969

7070
if ($lineItem->hasColumn('start_date')) {
71-
$this->addSql("ALTER TABLE DROP COLUMN start_date");
71+
$this->addSql("ALTER TABLE lti_lineitem DROP COLUMN start_date");
7272
}
7373

7474
$this->addSql("ALTER TABLE lti_lineitem ADD start_date DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)'");
7575

7676
if ($lineItem->hasColumn('end_date')) {
77-
$this->addSql("ALTER TABLE DROP COLUMN end_date");
77+
$this->addSql("ALTER TABLE lti_lineitem DROP COLUMN end_date");
7878
}
7979

8080
$this->addSql("ALTER TABLE lti_lineitem ADD end_date DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)'");
8181

8282
$externalTool = $schema->getTable('lti_external_tool');
8383

84-
if ($externalTool->hasIndex('UNIQ_DB0E04E41BAD783F')) {
85-
$this->addSql("DROP INDEX UNIQ_DB0E04E41BAD783F ON lti_external_tool");
86-
}
87-
8884
if ($externalTool->hasForeignKey('FK_DB0E04E41BAD783F')) {
8985
$this->addSql("ALTER TABLE lti_external_tool DROP FOREIGN KEY FK_DB0E04E41BAD783F");
9086
}
9187

88+
if ($externalTool->hasIndex('UNIQ_DB0E04E41BAD783F')) {
89+
$this->addSql("DROP INDEX UNIQ_DB0E04E41BAD783F ON lti_external_tool");
90+
}
91+
9292
if ($externalTool->hasColumn('resource_node_id')) {
9393
$this->addSql("ALTER TABLE lti_external_tool DROP COLUMN resource_node_id");
9494
}
@@ -97,14 +97,14 @@ public function up(Schema $schema): void
9797
$this->addSql('ALTER TABLE lti_external_tool ADD CONSTRAINT FK_DB0E04E41BAD783F FOREIGN KEY (resource_node_id) REFERENCES resource_node (id) ON DELETE CASCADE');
9898
$this->addSql("CREATE UNIQUE INDEX UNIQ_DB0E04E41BAD783F ON lti_external_tool (resource_node_id)");
9999

100-
if ($externalTool->hasIndex('IDX_DB0E04E482F80D8B')) {
101-
$this->addSql("DROP INDEX IDX_DB0E04E482F80D8B ON lti_external_tool");
102-
}
103-
104100
if ($externalTool->hasForeignKey('FK_DB0E04E482F80D8B')) {
105101
$this->addSql("ALTER TABLE lti_external_tool DROP FOREIGN KEY FK_DB0E04E482F80D8B");
106102
}
107103

104+
if ($externalTool->hasIndex('IDX_DB0E04E482F80D8B')) {
105+
$this->addSql("DROP INDEX IDX_DB0E04E482F80D8B ON lti_external_tool");
106+
}
107+
108108
if ($externalTool->hasColumn('gradebook_eval_id')) {
109109
$this->addSql("ALTER TABLE lti_external_tool DROP COLUMN gradebook_eval_id");
110110
}
@@ -217,14 +217,14 @@ public function up(Schema $schema): void
217217

218218
$token = $schema->getTable('lti_token');
219219

220-
if ($token->hasIndex('IDX_EA71C468F7B22CC')) {
221-
$this->addSql("DROP INDEX IDX_EA71C468F7B22CC ON lti_token");
222-
}
223-
224220
if ($token->hasForeignKey('FK_EA71C468F7B22CC')) {
225221
$this->addSql("ALTER TABLE lti_token DROP FOREIGN KEY FK_EA71C468F7B22CC");
226222
}
227223

224+
if ($token->hasIndex('IDX_EA71C468F7B22CC')) {
225+
$this->addSql("DROP INDEX IDX_EA71C468F7B22CC ON lti_token");
226+
}
227+
228228
if ($token->hasColumn('tool_id')) {
229229
$this->addSql("ALTER TABLE lti_token DROP COLUMN tool_id");
230230
}
@@ -259,19 +259,19 @@ public function up(Schema $schema): void
259259

260260
$platform = $schema->getTable('lti_platform');
261261

262-
if ($token->hasColumn('public_key')) {
262+
if ($platform->hasColumn('public_key')) {
263263
$this->addSql("ALTER TABLE lti_platform DROP COLUMN public_key");
264264
}
265265

266266
$this->addSql("ALTER TABLE lti_platform ADD public_key LONGTEXT NOT NULL");
267267

268-
if ($token->hasColumn('kid')) {
268+
if ($platform->hasColumn('kid')) {
269269
$this->addSql("ALTER TABLE lti_platform DROP COLUMN kid");
270270
}
271271

272272
$this->addSql("ALTER TABLE lti_platform ADD kid VARCHAR(255) NOT NULL");
273273

274-
if ($token->hasColumn('private_key')) {
274+
if ($platform->hasColumn('private_key')) {
275275
$this->addSql("ALTER TABLE lti_platform DROP COLUMN private_key");
276276
}
277277

0 commit comments

Comments
 (0)