Store empty user_func as null (#14900)

This commit is contained in:
Jellyfrog 2023-03-14 18:42:45 +01:00 committed by GitHub
parent 68e0b3df28
commit ca8b780494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
<?php
use Illuminate\Database\Migrations\Migration;
class MigrateEmptyUserFuncsToNull extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
\App\Models\Sensor::where('user_func', '')->update(['user_func' => null]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}