Fix error spam in logs due to missing cron month

This commit is contained in:
Dane Everitt 2021-03-21 10:49:23 -07:00
parent 8c7d785c9e
commit aa0b7977bb
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 33 additions and 1 deletions

View file

@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class ForceCronMonthFieldToHaveValueIfMissing extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('schedules', function (Blueprint $table) {
DB::update("UPDATE `schedules` SET `cron_month` = '*' WHERE `cron_month` = ''");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// No down function.
}
}