-
-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: correct migrations for user sessions columns
- Loading branch information
Showing
3 changed files
with
21 additions
and
2 deletions.
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
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
20 changes: 20 additions & 0 deletions
20
core/migrations/20240714105154_rename_device_name_column_users_session_table.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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
final class RenameDeviceNameColumnUsersSessionTable extends AbstractMigration | ||
{ | ||
public function up(): void | ||
{ | ||
$table = $this->table('nl2_users_session'); | ||
$table->renameColumn('device_name', 'user_agent')->save(); | ||
} | ||
|
||
public function down(): void | ||
{ | ||
$table = $this->table('nl2_users_session'); | ||
$table->renameColumn('user_agent', 'device_name')->save(); | ||
} | ||
} |