]> BookStack Code Mirror - bookstack/blob - database/migrations/2016_10_09_142037_create_files_table.php
Started work on attachments
[bookstack] / database / migrations / 2016_10_09_142037_create_files_table.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 CreateFilesTable extends Migration
8 {
9     /**
10      * Run the migrations.
11      *
12      * @return void
13      */
14     public function up()
15     {
16         Schema::create('files', function (Blueprint $table) {
17             $table->increments('id');
18             $table->string('name');
19             $table->string('path');
20             $table->integer('uploaded_to');
21
22             $table->boolean('external');
23             $table->integer('order');
24
25             $table->integer('created_by');
26             $table->integer('updated_by');
27
28             $table->index('uploaded_to');
29             $table->timestamps();
30         });
31     }
32
33     /**
34      * Reverse the migrations.
35      *
36      * @return void
37      */
38     public function down()
39     {
40         Schema::dropIfExists('files');
41     }
42 }