Fix issues with critical alerts breaking the simulation
This commit is contained in:
@@ -44,7 +44,10 @@ namespace VigilCareClinicalAPI.Migrations
|
||||
table: "patients");
|
||||
|
||||
migrationBuilder.Sql(
|
||||
"ALTER TABLE patients ALTER COLUMN date_of_birth TYPE date USING date_of_birth::date;");
|
||||
"""
|
||||
UPDATE patients SET date_of_birth = '1900-01-01' WHERE date_of_birth !~ '^\d{4}-\d{2}-\d{2}$';
|
||||
ALTER TABLE patients ALTER COLUMN date_of_birth TYPE date USING date_of_birth::date;
|
||||
""");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,14 @@ namespace VigilCareClinicalAPI.Migrations
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.Sql(
|
||||
"""
|
||||
UPDATE patients SET last_name = LEFT(last_name, 100);
|
||||
UPDATE patients SET first_name = LEFT(first_name, 100);
|
||||
UPDATE patients SET emergency_contact_phone = LEFT(emergency_contact_phone, 20);
|
||||
UPDATE patients SET emergency_contact_name = LEFT(emergency_contact_name, 200);
|
||||
""");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "last_name",
|
||||
table: "patients",
|
||||
|
||||
Reference in New Issue
Block a user