diff --git a/migrations/default/2022_04_05_000015_update_activity_log_morph_size.php b/migrations/default/2022_04_05_000015_update_activity_log_morph_size.php new file mode 100644 index 000000000..cb34cb898 --- /dev/null +++ b/migrations/default/2022_04_05_000015_update_activity_log_morph_size.php @@ -0,0 +1,60 @@ +hasTable($tableName)) { + $connection->table( + $tableName, + function (Blueprint $table) use ($connection, $tableName) { + if ($connection->hasColumn($tableName, 'subject_id')) { + $table->bigInteger('subject_id')->change(); + } + + if ($connection->hasColumn($tableName, 'causer_id')) { + $table->bigInteger('causer_id')->change(); + } + } + ); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $connection = Schema::connection(config('activitylog.database_connection')); + $tableName = config('activitylog.table_name'); + + if ($connection->hasTable($tableName)) { + $connection->table( + $tableName, + function (Blueprint $table) use ($connection, $tableName) { + if ($connection->hasColumn($tableName, 'subject_id')) { + $table->integer('subject_id')->change(); + } + + if ($connection->hasColumn($tableName, 'causer_id')) { + $table->integer('causer_id')->change(); + } + } + ); + } + } +}