unfuck database

This commit is contained in:
rhailrake
2024-01-28 18:23:33 +06:00
parent 69c63b3573
commit 6e198dc038
6 changed files with 3658 additions and 30 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class UnFuck : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "user_id",
table: "server_role_ban");
migrationBuilder.DropColumn(
name: "user_id",
table: "server_ban");
migrationBuilder.DropColumn(
name: "body_type",
table: "profile");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "user_id",
table: "server_role_ban",
type: "uuid",
nullable: true);
migrationBuilder.AddColumn<Guid>(
name: "user_id",
table: "server_ban",
type: "uuid",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "body_type",
table: "profile",
type: "text",
nullable: false,
defaultValue: "");
}
}
}

View File

@@ -7,6 +7,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using NpgsqlTypes;
#nullable disable #nullable disable
@@ -19,7 +20,7 @@ namespace Content.Server.Database.Migrations.Postgres
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "7.0.4") .HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63); .HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@@ -759,11 +760,6 @@ namespace Content.Server.Database.Migrations.Postgres
.HasColumnType("text") .HasColumnType("text")
.HasColumnName("backpack"); .HasColumnName("backpack");
b.Property<string>("BodyType")
.IsRequired()
.HasColumnType("text")
.HasColumnName("body_type");
b.Property<string>("BorgName") b.Property<string>("BorgName")
.IsRequired() .IsRequired()
.HasColumnType("text") .HasColumnType("text")
@@ -931,7 +927,7 @@ namespace Content.Server.Database.Migrations.Postgres
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<ValueTuple<IPAddress, int>?>("Address") b.Property<NpgsqlInet?>("Address")
.HasColumnType("inet") .HasColumnType("inet")
.HasColumnName("address"); .HasColumnName("address");
@@ -996,10 +992,6 @@ namespace Content.Server.Database.Migrations.Postgres
.HasColumnType("integer") .HasColumnType("integer")
.HasColumnName("severity"); .HasColumnName("severity");
b.Property<Guid?>("UserId")
.HasColumnType("uuid")
.HasColumnName("user_id");
b.HasKey("Id") b.HasKey("Id")
.HasName("PK_server_ban"); .HasName("PK_server_ban");
@@ -1081,7 +1073,7 @@ namespace Content.Server.Database.Migrations.Postgres
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id")); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<ValueTuple<IPAddress, int>?>("Address") b.Property<NpgsqlInet?>("Address")
.HasColumnType("inet") .HasColumnType("inet")
.HasColumnName("address"); .HasColumnName("address");
@@ -1143,10 +1135,6 @@ namespace Content.Server.Database.Migrations.Postgres
.HasColumnType("integer") .HasColumnType("integer")
.HasColumnName("severity"); .HasColumnName("severity");
b.Property<Guid?>("UserId")
.HasColumnType("uuid")
.HasColumnName("user_id");
b.HasKey("Id") b.HasKey("Id")
.HasName("PK_server_role_ban"); .HasName("PK_server_role_ban");

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -15,7 +15,7 @@ namespace Content.Server.Database.Migrations.Sqlite
protected override void BuildModel(ModelBuilder modelBuilder) protected override void BuildModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "7.0.4"); modelBuilder.HasAnnotation("ProductVersion", "8.0.0");
modelBuilder.Entity("Content.Server.Database.Admin", b => modelBuilder.Entity("Content.Server.Database.Admin", b =>
{ {
@@ -711,11 +711,6 @@ namespace Content.Server.Database.Migrations.Sqlite
.HasColumnType("TEXT") .HasColumnType("TEXT")
.HasColumnName("backpack"); .HasColumnName("backpack");
b.Property<string>("BodyType")
.IsRequired()
.HasColumnType("TEXT")
.HasColumnName("body_type");
b.Property<string>("BorgName") b.Property<string>("BorgName")
.IsRequired() .IsRequired()
.HasColumnType("TEXT") .HasColumnType("TEXT")
@@ -942,10 +937,6 @@ namespace Content.Server.Database.Migrations.Sqlite
.HasColumnType("INTEGER") .HasColumnType("INTEGER")
.HasColumnName("severity"); .HasColumnName("severity");
b.Property<Guid?>("UserId")
.HasColumnType("TEXT")
.HasColumnName("user_id");
b.HasKey("Id") b.HasKey("Id")
.HasName("PK_server_ban"); .HasName("PK_server_ban");
@@ -1083,10 +1074,6 @@ namespace Content.Server.Database.Migrations.Sqlite
.HasColumnType("INTEGER") .HasColumnType("INTEGER")
.HasColumnName("severity"); .HasColumnName("severity");
b.Property<Guid?>("UserId")
.HasColumnType("TEXT")
.HasColumnName("user_id");
b.HasKey("Id") b.HasKey("Id")
.HasName("PK_server_role_ban"); .HasName("PK_server_role_ban");