]> BookStack Code Mirror - bookstack/blob - database/migrations/2023_07_31_104430_create_watches_table.php
CSS: Removed redundant calc
[bookstack] / database / migrations / 2023_07_31_104430_create_watches_table.php
1 <?php
2
3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
6
7 return new class extends Migration
8 {
9     /**
10      * Run the migrations.
11      *
12      * @return void
13      */
14     public function up()
15     {
16         Schema::create('watches', function (Blueprint $table) {
17             $table->increments('id');
18             $table->integer('user_id')->index();
19             $table->integer('watchable_id');
20             $table->string('watchable_type', 100);
21             $table->tinyInteger('level', false, true)->index();
22             $table->timestamps();
23
24             $table->index(['watchable_id', 'watchable_type'], 'watchable_index');
25         });
26     }
27
28     /**
29      * Reverse the migrations.
30      *
31      * @return void
32      */
33     public function down()
34     {
35         Schema::dropIfExists('watches');
36     }
37 };