1 | <?php |
||
7 | class CreatePolarNotificationsTable extends Migration |
||
8 | { |
||
9 | public function up() |
||
10 | { |
||
11 | Schema::create('polar_notifications', function (Blueprint $table) { |
||
12 | $table->bigIncrements('id'); |
||
13 | |||
14 | $table->integer('user_id', false, true); |
||
15 | $table->string('from')->default('system'); |
||
16 | $table->string('status', 10)->defaul('info'); |
||
17 | $table->text('body'); |
||
18 | $table->string('url')->nullable(); |
||
19 | $table->json('extra'); |
||
20 | $table->tinyInteger('read')->default(0); |
||
21 | |||
22 | $table->timestamps(); |
||
23 | $table->index(['user_id', 'created_at']); |
||
24 | }); |
||
25 | } |
||
26 | |||
27 | public function down() |
||
28 | { |
||
29 | Schema::dropIfExists('polar_notifications'); |
||
30 | } |
||
31 | } |
||
32 |