Schedules should be soft deletable

This commit is contained in:
James Brooks 2018-06-14 21:16:05 +01:00
parent ccb0a0c390
commit 43fefec37a
2 changed files with 43 additions and 1 deletions

View File

@ -18,6 +18,7 @@ use CachetHQ\Cachet\Presenters\SchedulePresenter;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use McCool\LaravelAutoPresenter\HasPresenter;
/**
@ -27,7 +28,7 @@ use McCool\LaravelAutoPresenter\HasPresenter;
*/
class Schedule extends Model implements HasPresenter
{
use SearchableTrait, SortableTrait, ValidatingTrait;
use SearchableTrait, SoftDeletes, SortableTrait, ValidatingTrait;
/**
* The upcoming status.

View File

@ -0,0 +1,41 @@
<?php
/*
* This file is part of Cachet.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterSchedulesSoftDeletes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('schedules', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('schedules', function (Blueprint $table) {
$table->dropSoftDeletes();
});
}
}