44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Content.Server.Database.Migrations.Sqlite
|
|
{
|
|
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("Sqlite:Autoincrement", true),
|
|
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");
|
|
}
|
|
}
|
|
}
|