chore: update document approval workflow and bug fixes
This commit is contained in:
0
Modules/MasterData/database/factories/.gitkeep
Normal file
0
Modules/MasterData/database/factories/.gitkeep
Normal file
0
Modules/MasterData/database/migrations/.gitkeep
Normal file
0
Modules/MasterData/database/migrations/.gitkeep
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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
|
||||
{
|
||||
Schema::table('materials', function (Blueprint $table) {
|
||||
$table->enum('type', ['single', 'kit', 'assembly'])->default('single')->after('description');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('materials', function (Blueprint $table) {
|
||||
$table->dropColumn('type');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
<?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
|
||||
{
|
||||
Schema::create('material_components', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('parent_id')->constrained('materials')->cascadeOnDelete();
|
||||
$table->foreignId('component_id')->constrained('materials')->cascadeOnDelete();
|
||||
$table->decimal('quantity', 12, 4);
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['parent_id', 'component_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('material_components');
|
||||
}
|
||||
};
|
||||
0
Modules/MasterData/database/seeders/.gitkeep
Normal file
0
Modules/MasterData/database/seeders/.gitkeep
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\MasterData\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class MasterDataDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user