diff --git a/database/migrations/2022_08_13_083649_create_tasks_table.php b/database/migrations/2022_08_13_083649_create_tasks_table.php index 6269e8f..fc00cc1 100644 --- a/database/migrations/2022_08_13_083649_create_tasks_table.php +++ b/database/migrations/2022_08_13_083649_create_tasks_table.php @@ -1,8 +1,10 @@ id(); + + $table->string('title'); + + // progress (max 100) + $table->integer('progress')->default(0); + + // status + $table->enum('status', ['pending', 'done', 'success', 'failed', 'error', 'cancelled', 'processing'])->index(); + + // user id + $table->foreignIdFor(User::class)->index(); + + // provider module id + $table->foreignIdFor(ProviderModule::class)->index(); + $table->timestamps(); }); } diff --git a/database/migrations/2022_08_13_083643_create_messages_table.php b/database/migrations/2022_08_13_083908_create_notifications_table.php similarity index 57% rename from database/migrations/2022_08_13_083643_create_messages_table.php rename to database/migrations/2022_08_13_083908_create_notifications_table.php index 6485e15..4357c9e 100644 --- a/database/migrations/2022_08_13_083643_create_messages_table.php +++ b/database/migrations/2022_08_13_083908_create_notifications_table.php @@ -13,8 +13,12 @@ */ public function up() { - Schema::create('messages', function (Blueprint $table) { - $table->id(); + Schema::create('notifications', function (Blueprint $table) { + $table->uuid('id')->primary(); + $table->string('type'); + $table->morphs('notifiable'); + $table->text('data'); + $table->timestamp('read_at')->nullable(); $table->timestamps(); }); } @@ -26,6 +30,6 @@ public function up() */ public function down() { - Schema::dropIfExists('messages'); + Schema::dropIfExists('notifications'); } };