Added columns in production plan and lines and items and production quantities migration file #347
@@ -0,0 +1,49 @@
|
|||||||
|
<?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'
|
||||||
|
ALTER TABLE production_plans
|
||||||
|
ADD COLUMN item_id BIGINT DEFAULT NULL,
|
||||||
|
ADD CONSTRAINT production_plans_item_id_fkey
|
||||||
|
FOREIGN KEY (item_id) REFERENCES items(id);
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql);
|
||||||
|
|
||||||
|
$sql1 = <<<'SQL'
|
||||||
|
ALTER TABLE production_plans
|
||||||
|
ADD COLUMN working_days TEXT DEFAULT NULL
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql1);
|
||||||
|
|
||||||
|
$sql2 = <<<'SQL'
|
||||||
|
ALTER TABLE production_plans
|
||||||
|
ADD COLUMN leave_dates TEXT DEFAULT NULL
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql2);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// Schema::table('production_plans', function (Blueprint $table) {
|
||||||
|
// //
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?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'
|
||||||
|
ALTER TABLE lines
|
||||||
|
ADD COLUMN block_id BIGINT DEFAULT NULL,
|
||||||
|
ADD CONSTRAINT lines_block_id_fkey
|
||||||
|
FOREIGN KEY (block_id) REFERENCES blocks(id);
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql);
|
||||||
|
|
||||||
|
$sql1 = <<<'SQL'
|
||||||
|
ALTER TABLE lines
|
||||||
|
ADD COLUMN line_capacity TEXT DEFAULT NULL
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// Schema::table('lines', function (Blueprint $table) {
|
||||||
|
// //
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?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
|
||||||
|
{
|
||||||
|
$sql1 = <<<'SQL'
|
||||||
|
ALTER TABLE items
|
||||||
|
ADD COLUMN line_id BIGINT DEFAULT NULL,
|
||||||
|
ADD CONSTRAINT items_line_id_fkey
|
||||||
|
FOREIGN KEY (line_id) REFERENCES lines(id);
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// Schema::table('items', function (Blueprint $table) {
|
||||||
|
// //
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?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'
|
||||||
|
ALTER TABLE production_quantities
|
||||||
|
ADD COLUMN machine_id BIGINT DEFAULT NULL,
|
||||||
|
ADD CONSTRAINT production_quantities_machine_id_fkey
|
||||||
|
FOREIGN KEY (machine_id) REFERENCES machines(id);
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
// Schema::table('production_quantities', function (Blueprint $table) {
|
||||||
|
// //
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user