Files
monica/database/migrations/2018_05_24_160546_fix-inconsistant-reminder-time.php
Régis FreydandGitHub 29197090a7 Restructure where models are stored (#1476)
The idea is to clean the repository a little bit by moving models into their respective folders.
2018-06-14 20:49:12 -04:00

25 lines
631 B
PHP

<?php
use App\Models\Account\Account;
use Illuminate\Database\Migrations\Migration;
class FixInconsistantReminderTime extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Account::chunk(200, function ($accounts) {
foreach ($accounts as $account) {
if (strlen($account->default_time_reminder_is_sent) == 4) {
$account->default_time_reminder_is_sent = date('H:i', strtotime($account->default_time_reminder_is_sent));
$account->save();
}
}
});
}
}