Fix timetaken columns too small (#15042)

This commit is contained in:
Tony Murray
2023-05-16 07:04:09 -05:00
committed by GitHub
parent ad1b2f96f5
commit b19c783f04
2 changed files with 40 additions and 3 deletions

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('devices', function (Blueprint $table) {
$table->unsignedFloat('last_polled_timetaken')->nullable()->change();
$table->unsignedFloat('last_discovered_timetaken')->nullable()->change();
$table->unsignedFloat('last_ping_timetaken')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
// can't undo the places change
Schema::table('devices', function (Blueprint $table) {
$table->float('last_polled_timetaken')->nullable()->change();
$table->float('last_discovered_timetaken')->nullable()->change();
$table->float('last_ping_timetaken')->nullable()->change();
});
}
};

View File

@@ -530,11 +530,11 @@ devices:
- { Field: agent_uptime, Type: 'int unsigned', 'Null': false, Extra: '', Default: '0' }
- { Field: last_polled, Type: timestamp, 'Null': true, Extra: '' }
- { Field: last_poll_attempted, Type: timestamp, 'Null': true, Extra: '' }
- { Field: last_polled_timetaken, Type: 'double(5,2)', 'Null': true, Extra: '' }
- { Field: last_discovered_timetaken, Type: 'double(5,2)', 'Null': true, Extra: '' }
- { Field: last_polled_timetaken, Type: 'double unsigned', 'Null': true, Extra: '' }
- { Field: last_discovered_timetaken, Type: 'double unsigned', 'Null': true, Extra: '' }
- { Field: last_discovered, Type: timestamp, 'Null': true, Extra: '' }
- { Field: last_ping, Type: timestamp, 'Null': true, Extra: '' }
- { Field: last_ping_timetaken, Type: 'double(8,2)', 'Null': true, Extra: '' }
- { Field: last_ping_timetaken, Type: 'double unsigned', 'Null': true, Extra: '' }
- { Field: purpose, Type: text, 'Null': true, Extra: '' }
- { Field: type, Type: varchar(20), 'Null': false, Extra: '', Default: '' }
- { Field: serial, Type: text, 'Null': true, Extra: '' }