2021-04-19 07:11:51 +00:00
< ? php
use Illuminate\Database\Migrations\Migration ;
use Illuminate\Database\Schema\Blueprint ;
use Illuminate\Support\Facades\Schema ;
class RemoveEvent extends Migration
{
/**
* Run the migrations .
*
* @ return void
*/
2021-04-19 12:42:03 +00:00
/*
2021-04-19 07:11:51 +00:00
public function up ()
{
\Illuminate\Support\Facades\DB :: unprepared ( " CREATE OR REPLACE EVENT `remove_event` ON SCHEDULE EVERY 1 HOUR STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO
DELETE FROM events WHERE HOUR ( TIMEDIFF ( NOW (), events . date )) >= 24 AND date ( events . date ) < CURDATE () " );
}
2021-04-19 12:42:03 +00:00
*/
2021-04-19 07:11:51 +00:00
/**
* Reverse the migrations .
*
* @ return void
*/
public function down ()
{
//
}
}