using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace VigilCareClinicalAPI.Migrations
{
///
public partial class AddPatientNameSearchToken : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "date_of_birth",
table: "patients",
type: "text",
nullable: false,
oldClrType: typeof(DateOnly),
oldType: "date");
migrationBuilder.AddColumn(
name: "name_search_token",
table: "patients",
type: "character varying(64)",
maxLength: 64,
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_patients_name_search_token",
table: "patients",
column: "name_search_token");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_patients_name_search_token",
table: "patients");
migrationBuilder.DropColumn(
name: "name_search_token",
table: "patients");
migrationBuilder.Sql(
"ALTER TABLE patients ALTER COLUMN date_of_birth TYPE date USING date_of_birth::date;");
}
}
}