first commit
This commit is contained in:
46
database/seeders/TestLpuDataSeeder.php
Normal file
46
database/seeders/TestLpuDataSeeder.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class TestLpuDataSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
Schema::create('oms_lpu', function (Blueprint $table) {
|
||||
$table->id('lpuid');
|
||||
$table->string('mname_s');
|
||||
$table->foreignId('mainlpuid')->nullable()->constrained('oms_lpu', 'lpuid');
|
||||
});
|
||||
Schema::create('oms_department', function (Blueprint $table) {
|
||||
$table->id('depatmentid');
|
||||
$table->string('departmentname');
|
||||
$table->foreignId('rf_lpuid')->constrained('oms_lpu', 'lpuid');
|
||||
});
|
||||
|
||||
\DB::table('oms_lpu')->insert([
|
||||
'lpuid' => 1,
|
||||
'mname_s' => 'ГАУЗ АО АОКБ',
|
||||
'mainlpuid' => null
|
||||
]);
|
||||
\DB::table('oms_lpu')->insert([
|
||||
'lpuid' => 2,
|
||||
'mname_s' => 'Приемное отделение',
|
||||
'mainlpuid' => 1
|
||||
]);
|
||||
|
||||
|
||||
\DB::table('oms_department')->insert([
|
||||
'departmentname' => 'Тест',
|
||||
'rf_lpuid' => 2,
|
||||
'depatmentid' => 1
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user