Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 0 additions & 106 deletions app/Actions/MigrateBadJsonResults.php

This file was deleted.

20 changes: 0 additions & 20 deletions app/Filament/Resources/ResultResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@

namespace App\Filament\Resources;

use App\Actions\MigrateBadJsonResults;
use App\Enums\ResultStatus;
use App\Filament\Exports\ResultExporter;
use App\Filament\Resources\ResultResource\Pages;
use App\Helpers\Number;
use App\Jobs\TruncateResults;
use App\Models\Result;
use App\Settings\DataMigrationSettings;
use Carbon\Carbon;
use Filament\Forms;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Form;
use Filament\Notifications\Notification;
use Filament\Resources\Resource;
use Filament\Support\Enums\Alignment;
use Filament\Tables;
Expand Down Expand Up @@ -156,8 +153,6 @@ public static function form(Form $form): Form

public static function table(Table $table): Table
{
$dataSettings = new DataMigrationSettings;

return $table
->columns([
Tables\Columns\TextColumn::make('id')
Expand Down Expand Up @@ -407,21 +402,6 @@ public static function table(Table $table): Table
Tables\Actions\ExportAction::make()
->exporter(ResultExporter::class)
->fileName(fn (): string => 'results-'.now()->timestamp),
Tables\Actions\Action::make('migrate')
->action(function (): void {
Notification::make()
->title('Starting data migration...')
->body('This can take a little bit depending how much data you have.')
->warning()
->sendToDatabase(Auth::user());

MigrateBadJsonResults::dispatch(Auth::user());
})
->hidden($dataSettings->bad_json_migrated)
->requiresConfirmation()
->modalHeading('Migrate History')
->modalDescription(new HtmlString('<p>v0.16.0 archived the old <code>"results"</code> table, to migrate your history click the button below.</p><p>For more information read the <a href="#" target="_blank" rel="nofollow" class="underline">docs</a>.</p>'))
->modalSubmitActionLabel('Yes, migrate it'),
Tables\Actions\ActionGroup::make([
Tables\Actions\Action::make('truncate')
->action(fn () => TruncateResults::dispatch(Auth::user()))
Expand Down
15 changes: 0 additions & 15 deletions app/Settings/DataMigrationSettings.php

This file was deleted.

12 changes: 12 additions & 0 deletions database/migrations/2014_10_12_000000_create_users_table.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

use App\Enums\UserRole;
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
Expand All @@ -18,8 +21,17 @@ public function up(): void
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->string('role')->default('user');
$table->timestamps();
});

User::create([
'name' => 'Admin',
'email' => '[email protected]',
'email_verified_at' => now(),
'password' => Hash::make('password'),
'role' => UserRole::Admin,
]);
}

/**
Expand Down
18 changes: 8 additions & 10 deletions database/migrations/2022_08_31_202106_create_results_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ public function up(): void
{
Schema::create('results', function (Blueprint $table) {
$table->id();
$table->float('ping', 8, 3);
$table->unsignedBigInteger('download'); // will be stored in bytes
$table->unsignedBigInteger('upload'); // will be stored in bytes
$table->integer('server_id')->nullable();
$table->string('server_host')->nullable();
$table->string('server_name')->nullable();
$table->string('url')->nullable();
$table->string('service')->default('ookla');
$table->float('ping', 8, 3)->nullable();
$table->unsignedBigInteger('download')->nullable();
$table->unsignedBigInteger('upload')->nullable();
$table->text('comments')->nullable();
$table->json('data')->nullable();
$table->string('status');
$table->boolean('scheduled')->default(false);
$table->json('data'); // is a dump of the cli output in case we want more fields later
$table->timestamp('created_at')
->useCurrent();
$table->timestamps();
});
}

Expand Down
29 changes: 0 additions & 29 deletions database/migrations/2022_09_27_212959_create_admin_user.php

This file was deleted.

31 changes: 0 additions & 31 deletions database/migrations/2023_01_12_135235_update_results_table.php

This file was deleted.

This file was deleted.

This file was deleted.

Loading