v1.5.11 - Event, News & Reservation deletion in sql db - And deletion of files in uploads when you go onto home pages and they're not used in DB

This commit is contained in:
Anders
2021-04-19 09:11:51 +02:00
parent b024d6e821
commit 40d082291f
7 changed files with 113 additions and 11 deletions
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class RemoveNews extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
\Illuminate\Support\Facades\DB::unprepared("CREATE OR REPLACE EVENT `remove_news` ON SCHEDULE EVERY 1 HOUR STARTS '2000-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO
DELETE FROM news WHERE news_expiration_date < NOW();");
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}