[backend/database] Recreate Pronouns column in UserProfile with jsonb
This commit is contained in:
parent
664fb73ebb
commit
98611179ea
3 changed files with 39 additions and 0 deletions
|
@ -4656,6 +4656,10 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
.HasColumnType("character varying(32)")
|
.HasColumnType("character varying(32)")
|
||||||
.HasColumnName("pinnedPageId");
|
.HasColumnName("pinnedPageId");
|
||||||
|
|
||||||
|
b.Property<Dictionary<string, string>>("Pronouns")
|
||||||
|
.HasColumnType("jsonb")
|
||||||
|
.HasColumnName("pronouns");
|
||||||
|
|
||||||
b.Property<string>("Url")
|
b.Property<string>("Url")
|
||||||
.HasMaxLength(512)
|
.HasMaxLength(512)
|
||||||
.HasColumnType("character varying(512)")
|
.HasColumnType("character varying(512)")
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
[DbContext(typeof(DatabaseContext))]
|
||||||
|
[Migration("20250127070810_Pronouns")]
|
||||||
|
public partial class Pronouns : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<Dictionary<string, string>>(
|
||||||
|
name: "pronouns",
|
||||||
|
table: "user_profile",
|
||||||
|
type: "jsonb",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "pronouns",
|
||||||
|
table: "user_profile");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -71,6 +71,9 @@ public class UserProfile
|
||||||
[Column("mentions", TypeName = "jsonb")]
|
[Column("mentions", TypeName = "jsonb")]
|
||||||
public List<Note.MentionedUser> Mentions { get; set; } = null!;
|
public List<Note.MentionedUser> Mentions { get; set; } = null!;
|
||||||
|
|
||||||
|
[Column("pronouns", TypeName = "jsonb")]
|
||||||
|
public Dictionary<string, string>? Pronouns { get; set; }
|
||||||
|
|
||||||
[ForeignKey(nameof(PinnedPageId))]
|
[ForeignKey(nameof(PinnedPageId))]
|
||||||
[InverseProperty(nameof(Page.UserProfile))]
|
[InverseProperty(nameof(Page.UserProfile))]
|
||||||
public virtual Page? PinnedPage { get; set; }
|
public virtual Page? PinnedPage { get; set; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue