Фикс миграций (#3545)

This commit is contained in:
ThereDrD 2025-12-29 20:10:16 +03:00 committed by GitHub
parent 7823c0b24f
commit 6c513a229d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 5065 additions and 46 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,113 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class GradientUpdate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "hair_extended_color",
table: "profile",
newName: "hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "hair_color_type",
table: "profile",
newName: "hair_gradient_direction");
migrationBuilder.RenameColumn(
name: "facial_hair_extended_color",
table: "profile",
newName: "facial_hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "facial_hair_color_type",
table: "profile",
newName: "facial_hair_gradient_direction");
migrationBuilder.AddColumn<int>(
name: "all_markings_gradient_direction",
table: "profile",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "all_markings_gradient_enabled",
table: "profile",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "all_markings_gradient_secondary_color",
table: "profile",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "facial_hair_gradient_enabled",
table: "profile",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "hair_gradient_enabled",
table: "profile",
type: "boolean",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "all_markings_gradient_direction",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_enabled",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_secondary_color",
table: "profile");
migrationBuilder.DropColumn(
name: "facial_hair_gradient_enabled",
table: "profile");
migrationBuilder.DropColumn(
name: "hair_gradient_enabled",
table: "profile");
migrationBuilder.RenameColumn(
name: "hair_gradient_secondary_color",
table: "profile",
newName: "hair_extended_color");
migrationBuilder.RenameColumn(
name: "hair_gradient_direction",
table: "profile",
newName: "hair_color_type");
migrationBuilder.RenameColumn(
name: "facial_hair_gradient_secondary_color",
table: "profile",
newName: "facial_hair_extended_color");
migrationBuilder.RenameColumn(
name: "facial_hair_gradient_direction",
table: "profile",
newName: "facial_hair_color_type");
}
}
}

View file

@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class OldGradients : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View file

@ -16,7 +16,7 @@ using NpgsqlTypes;
namespace Content.Server.Database.Migrations.Postgres
{
[DbContext(typeof(PostgresServerDbContext))]
[Migration("20251228200202_OldGradients")]
[Migration("20251229165316_OldGradients")]
partial class OldGradients
{
/// <inheritdoc />

View file

@ -0,0 +1,113 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class OldGradients : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "all_markings_gradient_direction",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_enabled",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_secondary_color",
table: "profile");
migrationBuilder.DropColumn(
name: "facial_hair_gradient_enabled",
table: "profile");
migrationBuilder.DropColumn(
name: "hair_gradient_enabled",
table: "profile");
migrationBuilder.RenameColumn(
name: "hair_gradient_secondary_color",
table: "profile",
newName: "hair_extended_color");
migrationBuilder.RenameColumn(
name: "hair_gradient_direction",
table: "profile",
newName: "hair_color_type");
migrationBuilder.RenameColumn(
name: "facial_hair_gradient_secondary_color",
table: "profile",
newName: "facial_hair_extended_color");
migrationBuilder.RenameColumn(
name: "facial_hair_gradient_direction",
table: "profile",
newName: "facial_hair_color_type");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "hair_extended_color",
table: "profile",
newName: "hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "hair_color_type",
table: "profile",
newName: "hair_gradient_direction");
migrationBuilder.RenameColumn(
name: "facial_hair_extended_color",
table: "profile",
newName: "facial_hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "facial_hair_color_type",
table: "profile",
newName: "facial_hair_gradient_direction");
migrationBuilder.AddColumn<int>(
name: "all_markings_gradient_direction",
table: "profile",
type: "integer",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "all_markings_gradient_enabled",
table: "profile",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "all_markings_gradient_secondary_color",
table: "profile",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "facial_hair_gradient_enabled",
table: "profile",
type: "boolean",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "hair_gradient_enabled",
table: "profile",
type: "boolean",
nullable: false,
defaultValue: false);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,113 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Sqlite
{
/// <inheritdoc />
public partial class GradientUpdate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "hair_extended_color",
table: "profile",
newName: "hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "hair_color_type",
table: "profile",
newName: "hair_gradient_enabled");
migrationBuilder.RenameColumn(
name: "facial_hair_extended_color",
table: "profile",
newName: "facial_hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "facial_hair_color_type",
table: "profile",
newName: "hair_gradient_direction");
migrationBuilder.AddColumn<int>(
name: "all_markings_gradient_direction",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "all_markings_gradient_enabled",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "all_markings_gradient_secondary_color",
table: "profile",
type: "TEXT",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<int>(
name: "facial_hair_gradient_direction",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "facial_hair_gradient_enabled",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "all_markings_gradient_direction",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_enabled",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_secondary_color",
table: "profile");
migrationBuilder.DropColumn(
name: "facial_hair_gradient_direction",
table: "profile");
migrationBuilder.DropColumn(
name: "facial_hair_gradient_enabled",
table: "profile");
migrationBuilder.RenameColumn(
name: "hair_gradient_secondary_color",
table: "profile",
newName: "hair_extended_color");
migrationBuilder.RenameColumn(
name: "hair_gradient_enabled",
table: "profile",
newName: "hair_color_type");
migrationBuilder.RenameColumn(
name: "hair_gradient_direction",
table: "profile",
newName: "facial_hair_color_type");
migrationBuilder.RenameColumn(
name: "facial_hair_gradient_secondary_color",
table: "profile",
newName: "facial_hair_extended_color");
}
}
}

View file

@ -1,22 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Sqlite
{
/// <inheritdoc />
public partial class OldGradients : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

View file

@ -11,7 +11,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Content.Server.Database.Migrations.Sqlite
{
[DbContext(typeof(SqliteServerDbContext))]
[Migration("20251228200141_OldGradients")]
[Migration("20251229165249_OldGradients")]
partial class OldGradients
{
/// <inheritdoc />

View file

@ -0,0 +1,113 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Sqlite
{
/// <inheritdoc />
public partial class OldGradients : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "all_markings_gradient_direction",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_enabled",
table: "profile");
migrationBuilder.DropColumn(
name: "all_markings_gradient_secondary_color",
table: "profile");
migrationBuilder.DropColumn(
name: "facial_hair_gradient_direction",
table: "profile");
migrationBuilder.DropColumn(
name: "facial_hair_gradient_enabled",
table: "profile");
migrationBuilder.RenameColumn(
name: "hair_gradient_secondary_color",
table: "profile",
newName: "hair_extended_color");
migrationBuilder.RenameColumn(
name: "hair_gradient_enabled",
table: "profile",
newName: "hair_color_type");
migrationBuilder.RenameColumn(
name: "hair_gradient_direction",
table: "profile",
newName: "facial_hair_color_type");
migrationBuilder.RenameColumn(
name: "facial_hair_gradient_secondary_color",
table: "profile",
newName: "facial_hair_extended_color");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "hair_extended_color",
table: "profile",
newName: "hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "hair_color_type",
table: "profile",
newName: "hair_gradient_enabled");
migrationBuilder.RenameColumn(
name: "facial_hair_extended_color",
table: "profile",
newName: "facial_hair_gradient_secondary_color");
migrationBuilder.RenameColumn(
name: "facial_hair_color_type",
table: "profile",
newName: "hair_gradient_direction");
migrationBuilder.AddColumn<int>(
name: "all_markings_gradient_direction",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "all_markings_gradient_enabled",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<string>(
name: "all_markings_gradient_secondary_color",
table: "profile",
type: "TEXT",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<int>(
name: "facial_hair_gradient_direction",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<bool>(
name: "facial_hair_gradient_enabled",
table: "profile",
type: "INTEGER",
nullable: false,
defaultValue: false);
}
}
}