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