]> BookStack Code Mirror - bookstack/blob - database/migrations/2020_09_27_210059_add_entity_soft_deletes.php
d2b63e8d0f9e4ef574d9f60d189594a947b3837b
[bookstack] / database / migrations / 2020_09_27_210059_add_entity_soft_deletes.php
1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 class AddEntitySoftDeletes extends Migration
8 {
9     /**
10      * Run the migrations.
11      *
12      * @return void
13      */
14     public function up()
15     {
16         Schema::table('bookshelves', function(Blueprint  $table) {
17             $table->softDeletes();
18         });
19         Schema::table('books', function(Blueprint  $table) {
20             $table->softDeletes();
21         });
22         Schema::table('chapters', function(Blueprint  $table) {
23             $table->softDeletes();
24         });
25         Schema::table('pages', function(Blueprint  $table) {
26             $table->softDeletes();
27         });
28     }
29
30     /**
31      * Reverse the migrations.
32      *
33      * @return void
34      */
35     public function down()
36     {
37         Schema::table('bookshelves', function(Blueprint  $table) {
38             $table->dropSoftDeletes();
39         });
40         Schema::table('books', function(Blueprint  $table) {
41             $table->dropSoftDeletes();
42         });
43         Schema::table('chapters', function(Blueprint  $table) {
44             $table->dropSoftDeletes();
45         });
46         Schema::table('pages', function(Blueprint  $table) {
47             $table->dropSoftDeletes();
48         });
49     }
50 }