]> BookStack Code Mirror - bookstack/blob - database/migrations/2024_05_04_154409_rename_activity_relation_columns.php
Merge pull request #5917 from BookStackApp/copy_references
[bookstack] / database / migrations / 2024_05_04_154409_rename_activity_relation_columns.php
1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 return new class extends Migration
8 {
9     /**
10      * Run the migrations.
11      */
12     public function up(): void
13     {
14         Schema::table('activities', function (Blueprint $table) {
15             $table->renameColumn('entity_id', 'loggable_id');
16             $table->renameColumn('entity_type', 'loggable_type');
17         });
18     }
19
20     /**
21      * Reverse the migrations.
22      */
23     public function down(): void
24     {
25         Schema::table('activities', function (Blueprint $table) {
26             $table->renameColumn('loggable_id', 'entity_id');
27             $table->renameColumn('loggable_type', 'entity_type');
28         });
29     }
30 };