]> BookStack Code Mirror - bookstack/blob - database/migrations/2017_08_29_102650_add_cover_image_display.php
a8bba51c8c7ee35cc87116f55c7695410d1b4545
[bookstack] / database / migrations / 2017_08_29_102650_add_cover_image_display.php
1 <?php
2
3 use Illuminate\Support\Facades\Schema;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Database\Migrations\Migration;
6
7 class AddCoverImageDisplay extends Migration
8 {
9     /**
10      * Run the migrations.
11      *
12      * @return void
13      */
14     public function up()
15     {
16         Schema::table('users', function (Blueprint $table) {
17             $table->string('books_view_type',10)->default('grid');
18         });
19
20         Schema::table('books', function (Blueprint $table) {
21             $table->integer('image_id');
22         });
23     }
24
25     /**
26      * Reverse the migrations.
27      *
28      * @return void
29      */
30     public function down()
31     {
32         Schema::table('users', function (Blueprint $table) {
33             $table->dropColumn('books_view_type');
34         });
35
36         Schema::table('books', function (Blueprint $table) {
37             $table->dropColumn('image_id');
38         });
39     }
40 }