Skip to content

Commit

Permalink
feat: Менеджер для привязки игрового профиля к дискорду (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
SantaGitHub authored May 13, 2023
1 parent ad74165 commit 3578a90
Show file tree
Hide file tree
Showing 13 changed files with 3,129 additions and 6 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class DiscordLink : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "discord_players",
columns: table => new
{
discord_players_id = table.Column<Guid>(type: "uuid", nullable: false),
ss14_id = table.Column<Guid>(type: "uuid", nullable: false),
hash_key = table.Column<string>(type: "text", nullable: false),
ckey = table.Column<string>(type: "text", nullable: false),
discord_id = table.Column<string>(type: "text", nullable: true),
discord_name = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_discord_players", x => x.discord_players_id);
table.UniqueConstraint("ak_discord_players_ss14_id", x => x.ss14_id);
});

migrationBuilder.CreateIndex(
name: "IX_discord_players_ckey_discord_id",
table: "discord_players",
columns: new[] { "ckey", "discord_id" });

migrationBuilder.CreateIndex(
name: "IX_discord_players_discord_players_id",
table: "discord_players",
column: "discord_players_id",
unique: true);
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "discord_players");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,50 @@ protected override void BuildModel(ModelBuilder modelBuilder)
});
});

modelBuilder.Entity("Content.Server.Database.DiscordPlayer", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("discord_players_id");

b.Property<string>("CKey")
.IsRequired()
.HasColumnType("text")
.HasColumnName("ckey");

b.Property<string>("DiscordId")
.HasColumnType("text")
.HasColumnName("discord_id");

b.Property<string>("DiscordName")
.HasColumnType("text")
.HasColumnName("discord_name");

b.Property<string>("HashKey")
.IsRequired()
.HasColumnType("text")
.HasColumnName("hash_key");

b.Property<Guid>("SS14Id")
.IsUnicode(true)
.HasColumnType("uuid")
.HasColumnName("ss14_id");

b.HasKey("Id")
.HasName("PK_discord_players");

b.HasAlternateKey("SS14Id")
.HasName("ak_discord_players_ss14_id");

b.HasIndex("Id")
.IsUnique();

b.HasIndex("CKey", "DiscordId");

b.ToTable("discord_players", (string)null);
});

modelBuilder.Entity("Content.Server.Database.Job", b =>
{
b.Property<int>("Id")
Expand Down Expand Up @@ -662,12 +706,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("text")
.HasColumnName("species");

// Corvax-TTS-Start
b.Property<string>("Voice")
.IsRequired()
.HasColumnType("text")
.HasColumnName("voice");
// Corvax-TTS-End

b.HasKey("Id")
.HasName("PK_profile");
Expand Down
Loading

0 comments on commit 3578a90

Please sign in to comment.