using Microsoft.EntityFrameworkCore.Migrations; using NpgsqlTypes; #nullable disable namespace InboxIntel.Infrastructure.Migrations { /// public partial class WeightSearchVectorSubjectBody : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "SearchVector", table: "emails", type: "tsvector", nullable: true, computedColumnSql: "setweight(to_tsvector('english', coalesce(\"Subject\",'')), 'A') || setweight(to_tsvector('english', coalesce(\"BodyText\",'')), 'B')", stored: true, oldClrType: typeof(NpgsqlTsVector), oldType: "tsvector", oldNullable: true, oldComputedColumnSql: "to_tsvector('english', coalesce(\"Subject\",'') || ' ' || coalesce(\"BodyText\",''))", oldStored: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "SearchVector", table: "emails", type: "tsvector", nullable: true, computedColumnSql: "to_tsvector('english', coalesce(\"Subject\",'') || ' ' || coalesce(\"BodyText\",''))", stored: true, oldClrType: typeof(NpgsqlTsVector), oldType: "tsvector", oldNullable: true, oldComputedColumnSql: "setweight(to_tsvector('english', coalesce(\"Subject\",'')), 'A') || setweight(to_tsvector('english', coalesce(\"BodyText\",'')), 'B')", oldStored: true); } } }