-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed: activity log table name issue (#505)
- Loading branch information
1 parent
fa1665d
commit 4b9bfd6
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/migrations/m240610_142319_update_translation_activitylogs.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace acclaro\translations\migrations; | ||
|
||
use acclaro\translations\Constants; | ||
use craft\db\Migration; | ||
|
||
/** | ||
* Migration to update translations_activitylogs table | ||
*/ | ||
class m240610_142319_update_translation_activitylogs extends Migration | ||
{ | ||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeUp(): bool | ||
{ | ||
// Check if the table exists | ||
if ($this->db->tableExists(Constants::TABLE_ACTIVITY_LOG)) { | ||
if ($this->db->getTableSchema(Constants::TABLE_ACTIVITY_LOG)->getColumn('targetclass') !== null) { | ||
$this->renameColumn(Constants::TABLE_ACTIVITY_LOG, 'targetclass', 'targetClass'); | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function safeDown(): bool | ||
{ | ||
echo "m240610_142319_update_translation_activitylogs cannot be reverted.\n"; | ||
return false; | ||
} | ||
} |