using Microsoft.EntityFrameworkCore.Migrations; namespace Content.Server.Database.Migrations { public partial class initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Preferences", columns: table => new { PrefsId = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Username = table.Column(nullable: false), SelectedCharacterSlot = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Preferences", x => x.PrefsId); }); migrationBuilder.CreateTable( name: "HumanoidProfile", columns: table => new { HumanoidProfileId = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Slot = table.Column(nullable: false), SlotName = table.Column(nullable: false), CharacterName = table.Column(nullable: false), Age = table.Column(nullable: false), Sex = table.Column(nullable: false), HairName = table.Column(nullable: false), HairColor = table.Column(nullable: false), FacialHairName = table.Column(nullable: false), FacialHairColor = table.Column(nullable: false), EyeColor = table.Column(nullable: false), SkinColor = table.Column(nullable: false), PrefsId = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_HumanoidProfile", x => x.HumanoidProfileId); table.ForeignKey( name: "FK_HumanoidProfile_Preferences_PrefsId", column: x => x.PrefsId, principalTable: "Preferences", principalColumn: "PrefsId", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_HumanoidProfile_PrefsId", table: "HumanoidProfile", column: "PrefsId"); migrationBuilder.CreateIndex( name: "IX_Preferences_Username", table: "Preferences", column: "Username", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "HumanoidProfile"); migrationBuilder.DropTable( name: "Preferences"); } } }