Update bug waiting laravel
This commit is contained in:
@@ -11,13 +11,15 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('samples', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('patient_name', 250)->nullable();
|
||||
$table->string('test_details', 255)->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
});
|
||||
if (!Schema::hasTable('samples')) {
|
||||
Schema::create('samples', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('patient_name', 250)->nullable();
|
||||
$table->string('test_details', 255)->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,16 +11,18 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('test_results', function (Blueprint $table) {
|
||||
$table->id(); // ID primary key
|
||||
$table->unsignedBigInteger('sample_id'); // Kolom referensi
|
||||
$table->text('result'); // Kolom result
|
||||
$table->string('status', 50); // Kolom status
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
// Foreign key
|
||||
$table->foreign('sample_id')->references('id')->on('samples')->onDelete('cascade');
|
||||
});
|
||||
if (!Schema::hasTable('test_results')) {
|
||||
Schema::create('test_results', function (Blueprint $table) {
|
||||
$table->id(); // ID primary key
|
||||
$table->unsignedBigInteger('sample_id'); // Kolom referensi
|
||||
$table->text('result'); // Kolom result
|
||||
$table->string('status', 50); // Kolom status
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->useCurrent();
|
||||
// Foreign key
|
||||
$table->foreign('sample_id')->references('id')->on('samples')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,7 @@ class DatabaseSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
User::factory(10)->create();
|
||||
User::factory()->create([
|
||||
User::create([
|
||||
'nama' => 'Administrator',
|
||||
'username' => 'admin',
|
||||
'password' => bcrypt('semangat'),
|
||||
|
||||
Reference in New Issue
Block a user