diff --git a/database/migrations/2025_10_29_000000_create_user_activity_stats_hourly_table.php b/database/migrations/2025_10_29_000000_create_user_activity_stats_hourly_table.php new file mode 100644 index 000000000..102f097bd --- /dev/null +++ b/database/migrations/2025_10_29_000000_create_user_activity_stats_hourly_table.php @@ -0,0 +1,33 @@ +id(); + $table->dateTime('stat_hour')->index(); + $table->integer('downloads_count')->default(0); + $table->integer('api_hits_count')->default(0); + $table->timestamps(); + + // Ensure one record per hour + $table->unique('stat_hour'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('user_activity_stats_hourly'); + } +};