cad area
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddRoiFieldsToCadAreaJobsTable extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$table = $this->table('cad_area_jobs');
|
||||
|
||||
if (!$table->hasColumn('roi_x')) {
|
||||
$table->addColumn('roi_x', 'decimal', [
|
||||
'precision' => 12,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
'after' => 'file_size',
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('roi_y')) {
|
||||
$table->addColumn('roi_y', 'decimal', [
|
||||
'precision' => 12,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
'after' => 'roi_x',
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('roi_width')) {
|
||||
$table->addColumn('roi_width', 'decimal', [
|
||||
'precision' => 12,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
'after' => 'roi_y',
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('roi_height')) {
|
||||
$table->addColumn('roi_height', 'decimal', [
|
||||
'precision' => 12,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
'after' => 'roi_width',
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('roi_page')) {
|
||||
$table->addColumn('roi_page', 'integer', [
|
||||
'null' => true,
|
||||
'default' => 1,
|
||||
'after' => 'roi_height',
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('calculation_mode')) {
|
||||
$table->addColumn('calculation_mode', 'string', [
|
||||
'limit' => 50,
|
||||
'null' => true,
|
||||
'default' => 'auto_roi',
|
||||
'after' => 'roi_page',
|
||||
]);
|
||||
}
|
||||
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddResultDetailFieldsToCadAreaJobsTable extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$table = $this->table('cad_area_jobs');
|
||||
|
||||
if (!$table->hasColumn('width_mm')) {
|
||||
$table->addColumn('width_mm', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('height_mm')) {
|
||||
$table->addColumn('height_mm', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('scale_used')) {
|
||||
$table->addColumn('scale_used', 'decimal', [
|
||||
'precision' => 12,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('strategy_used')) {
|
||||
$table->addColumn('strategy_used', 'string', [
|
||||
'limit' => 100,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddManualTracingFieldsToCadAreaJobsTable extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$table = $this->table('cad_area_jobs');
|
||||
|
||||
if (!$table->hasColumn('width_mm')) {
|
||||
$table->addColumn('width_mm', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('height_mm')) {
|
||||
$table->addColumn('height_mm', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('scale_used')) {
|
||||
$table->addColumn('scale_used', 'decimal', [
|
||||
'precision' => 12,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('strategy_used')) {
|
||||
$table->addColumn('strategy_used', 'string', [
|
||||
'limit' => 100,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_calibration_px')) {
|
||||
$table->addColumn('manual_calibration_px', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_calibration_mm')) {
|
||||
$table->addColumn('manual_calibration_mm', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_mm_per_px')) {
|
||||
$table->addColumn('manual_mm_per_px', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 10,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_polygon_json')) {
|
||||
$table->addColumn('manual_polygon_json', 'text', [
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_area_mm2')) {
|
||||
$table->addColumn('manual_area_mm2', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_area_cm2')) {
|
||||
$table->addColumn('manual_area_cm2', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_width_mm')) {
|
||||
$table->addColumn('manual_width_mm', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_height_mm')) {
|
||||
$table->addColumn('manual_height_mm', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_status')) {
|
||||
$table->addColumn('manual_status', 'string', [
|
||||
'limit' => 50,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddManualHoleFieldsToCadAreaJobsTable extends AbstractMigration
|
||||
{
|
||||
public function change(): void
|
||||
{
|
||||
$table = $this->table('cad_area_jobs');
|
||||
|
||||
if (!$table->hasColumn('manual_outer_area_mm2')) {
|
||||
$table->addColumn('manual_outer_area_mm2', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_holes_area_mm2')) {
|
||||
$table->addColumn('manual_holes_area_mm2', 'decimal', [
|
||||
'precision' => 18,
|
||||
'scale' => 6,
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if (!$table->hasColumn('manual_holes_json')) {
|
||||
$table->addColumn('manual_holes_json', 'text', [
|
||||
'null' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$table->update();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user