librenms-librenms/database/migrations/2019_08_28_105051_fix-template-linefeeds.php

29 lines
636 B
PHP
Raw Normal View History

<?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()
{
}
}