initial round of changes from Claude

This commit is contained in:
2026-01-09 15:01:27 -07:00
parent 4dbbef643b
commit a086d749d1
11 changed files with 876 additions and 71 deletions

View File

@@ -0,0 +1,60 @@
<?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::create('weather_reports', function (Blueprint $table) {
$table->id();
$table->enum('type', ['hourly', 'weekly']);
$table->dateTime('reported_at');
$table->dateTime('generated_at');
$table->decimal('latitude', 10, 7);
$table->decimal('longitude', 11, 7);
$table->decimal('elevation_meters', 8, 4)->nullable();
$table->timestamps();
$table->index(['type', 'reported_at']);
$table->unique(['type', 'reported_at']);
});
Schema::create('weather_periods', function (Blueprint $table) {
$table->id();
$table->foreignId('weather_report_id')->constrained()->cascadeOnDelete();
$table->unsignedSmallInteger('period_number');
$table->string('name')->nullable();
$table->dateTime('start_time');
$table->dateTime('end_time');
$table->boolean('is_daytime');
$table->smallInteger('temperature');
$table->char('temperature_unit', 1)->default('F');
$table->unsignedTinyInteger('precipitation_probability')->nullable();
$table->decimal('dewpoint_celsius', 5, 2)->nullable();
$table->unsignedTinyInteger('relative_humidity')->nullable();
$table->string('wind_speed', 20)->nullable();
$table->string('wind_direction', 10)->nullable();
$table->string('icon_url')->nullable();
$table->string('short_forecast')->nullable();
$table->text('detailed_forecast')->nullable();
$table->timestamps();
$table->index(['weather_report_id', 'start_time']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('weather_periods');
Schema::dropIfExists('weather_reports');
}
};