Implement traits system (#10693)

This commit is contained in:
Visne
2022-09-10 17:40:06 +02:00
committed by GitHub
parent e1782ec22b
commit 4cc5fa239e
17 changed files with 3006 additions and 29 deletions

View File

@@ -0,0 +1,44 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
public partial class Traits : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "trait",
columns: table => new
{
trait_id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
profile_id = table.Column<int>(type: "integer", nullable: false),
trait_name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_trait", x => x.trait_id);
table.ForeignKey(
name: "FK_trait_profile_profile_id",
column: x => x.profile_id,
principalTable: "profile",
principalColumn: "profile_id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_trait_profile_id",
table: "trait",
column: "profile_id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "trait");
}
}
}