Files
ss14-wl/Content.Server.Database/Migrations/Postgres/20240510085043_JobSubname.cs
2024-05-13 17:21:21 +05:00

50 lines
1.9 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Content.Server.Database.Migrations.Postgres
{
/// <inheritdoc />
public partial class JobSubname : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "job_subname",
columns: table => new
{
job_subname_id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
profile_id = table.Column<int>(type: "integer", nullable: false),
job_name = table.Column<string>(type: "text", nullable: false),
subname = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_job_subname", x => x.job_subname_id);
table.ForeignKey(
name: "FK_job_subname_profile_profile_id",
column: x => x.profile_id,
principalTable: "profile",
principalColumn: "profile_id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateIndex(
name: "IX_job_subname_profile_id_job_name",
table: "job_subname",
columns: new[] { "profile_id", "job_name" },
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "job_subname");
}
}
}