Skip to content

Commit da3912f

Browse files
refactor(migrations): change text columns to json for medical records, entries, prescriptions, and articles
1 parent 645d6f0 commit da3912f

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

database/migrations/2025_09_23_175523_create_medical_records_table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*/
@@ -17,7 +18,7 @@ public function up(): void
1718
->cascadeOnDelete();
1819

1920
$table->text('medical_notes_html');
20-
$table->text('medical_notes_json')->nullable();
21+
$table->json('medical_notes_json')->nullable();
2122

2223
$table->timestamps();
2324

database/migrations/2025_09_23_195050_create_medical_record_entries_table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*/
@@ -19,7 +20,7 @@ public function up(): void
1920

2021
$table->string('title');
2122
$table->text('content_html');
22-
$table->text('content_json')->nullable();
23+
$table->json('content_json')->nullable();
2324

2425
$table->enum('entry_type', ['allergy', 'diagnosis', 'observation', 'note', 'vitals', 'immunization', 'lab_result', 'treatment', 'procedure', 'other'])->default('note');
2526
$table->boolean('is_visible_to_patient')->default(true);

database/migrations/2025_09_23_230801_create_prescriptions_table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*/
@@ -17,7 +18,7 @@ public function up(): void
1718
$table->foreignId('employee_info_id')->constrained('employee_info')->cascadeOnUpdate()->cascadeOnDelete();
1819

1920
$table->text('prescription_details_html');
20-
$table->text('prescription_details_json')->nullable();
21+
$table->json('prescription_details_json')->nullable();
2122

2223
$table->date('date_issued');
2324
$table->date('date_expires')->nullable();

database/migrations/2025_09_29_160844_create_articles_table.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
return new class extends Migration {
7+
return new class extends Migration
8+
{
89
/**
910
* Run the migrations.
1011
*/
@@ -21,7 +22,7 @@ public function up(): void
2122
$table->string('excerpt', 500);
2223

2324
$table->text('content_html');
24-
$table->text('content_json')->nullable();
25+
$table->json('content_json')->nullable();
2526
$table->string('thumbnail')->nullable();
2627
$table->boolean('is_published')->default(false);
2728

0 commit comments

Comments
 (0)