id(); $table->string('type', 20); $table->unsignedBigInteger('entity_id'); $table->decimal('score', 14, 2)->default(0); $table->string('period', 20); $table->timestamps(); $table->unique(['type', 'period', 'entity_id']); $table->index(['type', 'period', 'score']); }); } public function down(): void { Schema::dropIfExists('leaderboards'); } };