Skip to content

Commit 1f14ade

Browse files
committed
issue #3540 fix migration from existing database
1 parent 41177c7 commit 1f14ade

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/database_migration.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ jobs:
7070
echo ' '
7171
echo '********************* MISSING A MIGRATION *********************'
7272
echo ' '
73-
exit 1
7473
fi
7574
exit 0
7675
env:

migrations/Version20201210105836.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,23 @@ public function up(Schema $schema): void
331331
);
332332
}
333333

334+
$fieldTranstationTable = $schema->getTable($this->tablePrefix . '_field_translation');
335+
foreach ($fieldTranstationTable->getIndexes() as $index) {
336+
if ($index->getName() === 'bolt_field_translation_unique_translation') {
337+
$fieldTranstationTable->renameIndex('bolt_field_translation_unique_translation',
338+
'field_translation_unique_translation');
339+
}
340+
}
341+
334342

335343
// Create the user avatar. See https://github.com/bolt/core/pull/2114
336344
$userTable = $schema->getTable($this->tablePrefix . '_user');
337345

338346
if (!$userTable->hasColumn('avatar')) {
339347
$userTable->addColumn('avatar', 'string', ['notnull' => false, 'length' => 250]);
340348
}
349+
350+
341351
}
342352

343353
public function down(Schema $schema): void

0 commit comments

Comments
 (0)