Update Lihat Jumlah Kunjungan
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
// Satu baris = satu pengguna yang membuka aplikasi pada satu hari
|
||||
Schema::create('kunjungan_pengguna', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->date('tanggal');
|
||||
$table->foreignId('user_id')->constrained('users')->cascadeOnDelete();
|
||||
$table->timestamp('created_at')->nullable();
|
||||
|
||||
$table->unique(['tanggal', 'user_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('kunjungan_pengguna');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user