Added cnc monitor data migration file
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
This commit is contained in:
@@ -0,0 +1,63 @@
|
|||||||
|
<?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
|
||||||
|
{
|
||||||
|
$sql = <<<'SQL'
|
||||||
|
CREATE TABLE cnc_monitor_data (
|
||||||
|
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||||
|
machine_id TEXT DEFAULT NULL,
|
||||||
|
ts TIMESTAMPTZ DEFAULT NULL,
|
||||||
|
state TEXT DEFAULT NULL,
|
||||||
|
mode TEXT DEFAULT NULL,
|
||||||
|
run_status TEXT DEFAULT NULL,
|
||||||
|
state_duration_s TEXT DEFAULT NULL,
|
||||||
|
program TEXT DEFAULT NULL,
|
||||||
|
feed_rate INT DEFAULT NULL,
|
||||||
|
feed_override SMALLINT DEFAULT NULL,
|
||||||
|
spindle_speed INT DEFAULT NULL,
|
||||||
|
spindle_override SMALLINT DEFAULT NULL,
|
||||||
|
spindle_load SMALLINT DEFAULT NULL,
|
||||||
|
axis_load_x SMALLINT DEFAULT NULL,
|
||||||
|
axis_load_z SMALLINT DEFAULT NULL,
|
||||||
|
tool_no SMALLINT DEFAULT NULL,
|
||||||
|
tool_offset_no SMALLINT DEFAULT NULL,
|
||||||
|
wear_x NUMERIC(10,3) DEFAULT NULL,
|
||||||
|
wear_z NUMERIC(10,3) DEFAULT NULL,
|
||||||
|
geom_x NUMERIC(10,3) DEFAULT NULL,
|
||||||
|
geom_z NUMERIC(10,3) DEFAULT NULL,
|
||||||
|
cycle_time_s INT DEFAULT NULL,
|
||||||
|
last_cycle_time_s INT DEFAULT NULL,
|
||||||
|
part_count INT DEFAULT NULL,
|
||||||
|
alarm_no TEXT DEFAULT NULL,
|
||||||
|
alarm_msg TEXT DEFAULT NULL,
|
||||||
|
total_run_s INT DEFAULT NULL,
|
||||||
|
total_idle_s INT DEFAULT NULL,
|
||||||
|
total_alarm_s INT DEFAULT NULL,
|
||||||
|
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||||
|
created_by TEXT DEFAULT NULL,
|
||||||
|
updated_by TEXT DEFAULT NULL,
|
||||||
|
deleted_at TIMESTAMP
|
||||||
|
);
|
||||||
|
SQL;
|
||||||
|
DB::statement($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('cnc_monitor_data');
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user