migration update CorvaxTTS

This commit is contained in:
Dmitry 2026-07-02 15:22:49 +07:00
parent 9ca71ff554
commit cdefb5d363
9 changed files with 4508 additions and 11 deletions

View file

@ -10,19 +10,32 @@ namespace Content.Server.Database.Migrations.Postgres
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
migrationBuilder.AlterColumn<string>(
name: "voice",
table: "profile",
type: "text",
nullable: true);
nullable: true,
oldClrType: typeof(string),
oldType: "text",
oldNullable: false);
migrationBuilder.Sql("UPDATE profile SET voice = NULL"); // Corvax-TTS Это было неприятно, да я мог сделать это наоборот но слишком поздно узнал.
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
migrationBuilder.Sql("UPDATE profile SET voice = '' WHERE voice IS NULL");
migrationBuilder.AlterColumn<string>(
name: "voice",
table: "profile");
table: "profile",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class TTSrename : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ttsvoice",
table: "profile",
type: "text",
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ttsvoice",
table: "profile");
}
}
}

View file

@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using System.Collections.Generic;
using System.Net;
@ -1191,6 +1191,11 @@ namespace Content.Server.Database.Migrations.Postgres
.HasColumnType("text")
.HasColumnName("species");
b.Property<string>("TTSVoice")
.IsRequired()
.HasColumnType("text")
.HasColumnName("ttsvoice");
b.Property<string>("Voice")
.HasColumnType("text")
.HasColumnName("voice");

View file

@ -10,19 +10,30 @@ namespace Content.Server.Database.Migrations.Sqlite
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
migrationBuilder.AlterColumn<string>(
name: "voice",
table: "profile",
type: "TEXT",
nullable: true);
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
migrationBuilder.Sql("UPDATE profile SET voice = '' WHERE voice IS NULL");
migrationBuilder.AlterColumn<string>(
name: "voice",
table: "profile");
table: "profile",
type: "TEXT",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Sqlite
{
/// <inheritdoc />
public partial class TTSrename : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ttsvoice",
table: "profile",
type: "TEXT",
nullable: false,
defaultValue: "");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ttsvoice",
table: "profile");
}
}
}

View file

@ -1,4 +1,4 @@
// <auto-generated />
// <auto-generated />
using System;
using Content.Server.Database;
using Microsoft.EntityFrameworkCore;
@ -1126,6 +1126,11 @@ namespace Content.Server.Database.Migrations.Sqlite
.HasColumnType("TEXT")
.HasColumnName("species");
b.Property<string>("TTSVoice")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("ttsvoice");
b.Property<string>("Voice")
.HasColumnType("TEXT")
.HasColumnName("voice");

View file

@ -335,7 +335,7 @@ namespace Content.Server.Database
public string? Voice { get; set; } = null!; // If null, the voice gets defaulted to the sex associated value
public string Gender { get; set; } = null!;
public string Species { get; set; } = null!;
public string TTSVoice { get; set; } = null!; // Corvax-TTS
[Column("ttsvoice")] public string TTSVoice { get; set; } = null!; // Corvax-TTS
[Column(TypeName = "jsonb")] public JsonDocument? OrganMarkings { get; set; } = null!;
[Column(TypeName = "jsonb")] public JsonDocument? Markings { get; set; } = null!;
public string HairName { get; set; } = null!;