3333e19452
CI / backend (push) Successful in 54s
CI / frontend (push) Successful in 12s
CI / format (push) Failing after 51s
CI / db-tests (push) Successful in 57s
Deploy Staging / deploy (push) Successful in 25s
Security / secrets (push) Successful in 4s
Security / dependencies (push) Successful in 59s
Security / sast (push) Successful in 40s
CI / backend (pull_request) Successful in 55s
CI / frontend (pull_request) Successful in 15s
CI / format (pull_request) Failing after 54s
CI / db-tests (pull_request) Successful in 52s
Security / secrets (pull_request) Successful in 4s
Security / dependencies (pull_request) Successful in 56s
Security / sast (pull_request) Successful in 37s
46 lines
1.8 KiB
C#
46 lines
1.8 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using NpgsqlTypes;
|
|
|
|
#nullable disable
|
|
|
|
namespace InboxIntel.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class WeightSearchVectorSubjectBody : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<NpgsqlTsVector>(
|
|
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);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<NpgsqlTsVector>(
|
|
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);
|
|
}
|
|
}
|
|
}
|