feat(theme): resolve database migration blocker and apply ThemePreference column
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Pgvector;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace NexusReader.Data.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddThemePreference : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Vector",
|
||||
table: "SemanticKnowledgeCache");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Vector",
|
||||
table: "KnowledgeUnits");
|
||||
|
||||
migrationBuilder.AlterDatabase()
|
||||
.OldAnnotation("Npgsql:PostgresExtension:vector", ",,");
|
||||
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "ThemePreference",
|
||||
table: "AspNetUsers",
|
||||
type: "integer",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ThemePreference",
|
||||
table: "AspNetUsers");
|
||||
|
||||
migrationBuilder.AlterDatabase()
|
||||
.Annotation("Npgsql:PostgresExtension:vector", ",,");
|
||||
|
||||
migrationBuilder.AddColumn<Vector>(
|
||||
name: "Vector",
|
||||
table: "SemanticKnowledgeCache",
|
||||
type: "vector(1536)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Vector>(
|
||||
name: "Vector",
|
||||
table: "KnowledgeUnits",
|
||||
type: "vector(768)",
|
||||
nullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user