diff --git a/database/migrations/2024_12_27_060234_create_studies_table.php b/database/migrations/2024_12_27_060234_create_studies_table.php index 1240d18..8a93af3 100644 --- a/database/migrations/2024_12_27_060234_create_studies_table.php +++ b/database/migrations/2024_12_27_060234_create_studies_table.php @@ -36,8 +36,10 @@ public function up(): void $table->dateTime('study_date'); $table->dateTime('received_at'); - $table->dateTime('reported_at')->nullable(); $table->dateTime('assigned_at')->nullable(); + $table->dateTime('reported_at')->nullable(); + $table->dateTime('authorized_at')->nullable(); + $table->foreignIdFor(Institute::class)->constrained()->onDelete('cascade'); $table->unsignedTinyInteger('study_status')->default(StudyLevelStatus::Pending->value); $table->unsignedTinyInteger('report_status')->default(ReportStatus::Pending->value); @@ -46,10 +48,9 @@ public function up(): void $table->unsignedSmallInteger('series_count')->nullable(); $table->unsignedInteger('disk_size')->nullable(); - $table->foreignIdFor(User::class, 'assigned_physician_id')->nullable()->constrained()->onDelete('set null'); - $table->foreignIdFor(User::class, 'interpreting_physician_id')->nullable()->constrained()->onDelete('set null'); - $table->foreignIdFor(User::class, 'referring_physician_id')->nullable()->constrained()->onDelete('set null'); - $table->foreignIdFor(User::class, 'reading_physician_id')->nullable()->constrained()->onDelete('set null'); + $table->foreignIdFor(User::class, 'assigned_physician_id')->nullable()->constrained()->nullOnDelete(); + $table->foreignIdFor(User::class, 'reading_physician_id')->nullable()->constrained()->nullOnDelete(); + $table->foreignIdFor(User::class, 'referring_provider_id')->nullable()->constrained()->nullOnDelete(); $table->timestamps(); }); diff --git a/database/migrations/2024_12_28_051451_create_study_reports_table.php b/database/migrations/2024_12_28_051451_create_study_reports_table.php index e3857c3..8dfc12b 100644 --- a/database/migrations/2024_12_28_051451_create_study_reports_table.php +++ b/database/migrations/2024_12_28_051451_create_study_reports_table.php @@ -17,8 +17,8 @@ public function up(): void $table->foreignIdFor(Study::class)->index()->constrained()->cascadeOnDelete(); $table->foreignIdFor(User::class, 'radiologist_id')->index()->constrained()->cascadeOnDelete(); $table->string('report_title')->nullable(); - $table->string('file_path'); - $table->string('pdf_path')->nullable(); + $table->binary('content')->nullable(); + $table->string('remarks')->nullable(); $table->timestamps(); }); }