mirror of
https://github.com/nihonbuzz/nihonbuzz-academy.git
synced 2026-01-27 02:41:58 +07:00
feat: implement Learning Tracer (heartbeat duration tracking) for LPK Audit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('user_progress', function (Blueprint $table) {
|
||||
$table->timestamp('started_at')->nullable()->after('lesson_id');
|
||||
$table->unsignedInteger('time_spent_seconds')->default(0)->after('completed_at');
|
||||
$table->timestamp('last_heartbeat_at')->nullable()->after('time_spent_seconds');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('user_progress', function (Blueprint $table) {
|
||||
$table->dropColumn(['started_at', 'time_spent_seconds', 'last_heartbeat_at']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user