Kavita/API/Data/Migrations/20251003110154_SocialAnnotations.cs
Fesaa b40734265b
Social interactions with annotations (#4068)
Co-authored-by: Joe Milazzo <josephmajora@gmail.com>
2025-10-04 13:11:06 -07:00

62 lines
2.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace API.Data.Migrations
{
/// <inheritdoc />
public partial class SocialAnnotations : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "SocialPreferences",
table: "AppUserPreferences",
type: "TEXT",
nullable: true,
defaultValue: "{\"ShareReviews\":false,\"ShareAnnotations\":false,\"ViewOtherAnnotations\":false,\"SocialLibraries\":[],\"SocialMaxAgeRating\":-1,\"SocialIncludeUnknowns\":true}");
migrationBuilder.AddColumn<string>(
name: "Likes",
table: "AppUserAnnotation",
type: "TEXT",
nullable: true,
defaultValue: "[]");
migrationBuilder.CreateIndex(
name: "IX_AppUserAnnotation_LibraryId",
table: "AppUserAnnotation",
column: "LibraryId");
migrationBuilder.AddForeignKey(
name: "FK_AppUserAnnotation_Library_LibraryId",
table: "AppUserAnnotation",
column: "LibraryId",
principalTable: "Library",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AppUserAnnotation_Library_LibraryId",
table: "AppUserAnnotation");
migrationBuilder.DropIndex(
name: "IX_AppUserAnnotation_LibraryId",
table: "AppUserAnnotation");
migrationBuilder.DropColumn(
name: "SocialPreferences",
table: "AppUserPreferences");
migrationBuilder.DropColumn(
name: "Likes",
table: "AppUserAnnotation");
}
}
}