50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using NpgsqlTypes;
|
|
|
|
#nullable disable
|
|
|
|
namespace OpenArchival.DataAccess.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AddedFileTextContentsSearchVectorFixModelBuilder : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<NpgsqlTsVector>(
|
|
name: "FileContentSearchVector",
|
|
table: "ArtifactGroupings",
|
|
type: "tsvector",
|
|
nullable: false,
|
|
oldClrType: typeof(NpgsqlTsVector),
|
|
oldType: "tsvector")
|
|
.Annotation("Npgsql:TsVectorConfig", "english")
|
|
.Annotation("Npgsql:TsVectorProperties", new[] { "FileContentSearchString" });
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_ArtifactGroupings_FileContentSearchVector",
|
|
table: "ArtifactGroupings",
|
|
column: "FileContentSearchVector")
|
|
.Annotation("Npgsql:IndexMethod", "GIN");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_ArtifactGroupings_FileContentSearchVector",
|
|
table: "ArtifactGroupings");
|
|
|
|
migrationBuilder.AlterColumn<NpgsqlTsVector>(
|
|
name: "FileContentSearchVector",
|
|
table: "ArtifactGroupings",
|
|
type: "tsvector",
|
|
nullable: false,
|
|
oldClrType: typeof(NpgsqlTsVector),
|
|
oldType: "tsvector")
|
|
.OldAnnotation("Npgsql:TsVectorConfig", "english")
|
|
.OldAnnotation("Npgsql:TsVectorProperties", new[] { "FileContentSearchString" });
|
|
}
|
|
}
|
|
}
|