]> BookStack Code Mirror - bookstack/blob - database/migrations/2023_07_31_104430_create_watches_table.php
Perms: Removed entity perm regen on general update
[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     public function up(): void
13     {
14         Schema::create('watches', function (Blueprint $table) {
15             $table->increments('id');
16             $table->integer('user_id')->index();
17             $table->integer('watchable_id');
18             $table->string('watchable_type', 100);
19             $table->tinyInteger('level', false, true)->index();
20             $table->timestamps();
21
22             $table->index(['watchable_id', 'watchable_type'], 'watchable_index');
23         });
24     }
25
26     /**
27      * Reverse the migrations.
28      */
29     public function down(): void
30     {
31         Schema::dropIfExists('watches');
32     }
33 };