36 lines
747 B
PHP
36 lines
747 B
PHP
|
<?php
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Sakura\DB;
|
||
|
|
||
|
class SoftDeleting extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
$schema = DB::getSchemaBuilder();
|
||
|
|
||
|
$schema->table('posts', function (Blueprint $table) {
|
||
|
$table->tinyInteger('post_deleted')
|
||
|
->nullable()
|
||
|
->default(0);
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
$schema = DB::getSchemaBuilder();
|
||
|
|
||
|
$schema->table('posts', function (Blueprint $table) {
|
||
|
$table->dropColumn('post_deleted');
|
||
|
});
|
||
|
}
|
||
|
}
|