librenms-librenms/database/migrations/2019_08_28_105051_fix-template-linefeeds.php
Tony Murray 7482422614 When sending email alerts use CRLF for windows clients (#10563)
* When sending email alerts use CRLF for windows clients

* Convert hard \r\n into line return in templates

* there is no down really
2019-10-02 14:08:10 +00:00

29 lines
636 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class FixTemplateLinefeeds extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
DB::table('alert_templates')->update(['template' => DB::raw('REPLACE(`template`, \'\\\\r\\\\n\', char(10))')]);
DB::table('alert_templates')->update(['template' => DB::raw('REPLACE(`template`, \'\\\\n\', \'\')')]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}