Files
Radicade/Server/Migrations/20260508154418_InventionsV2.cs
T
2026-10-16 23:33:13 -07:00

109 lines
3.9 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RadicadeServer.Migrations
{
public partial class InventionsV2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<long>(
name: "CreatorPlayerId",
table: "Inventions",
type: "bigint",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AddColumn<int>(
name: "AICost",
table: "Inventions",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "ChipsCost",
table: "Inventions",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "CloudVariablesCost",
table: "Inventions",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "InventionPersonalDetails",
columns: table => new
{
DetailId = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
PlayerId = table.Column<long>(type: "bigint", nullable: false),
InventionId = table.Column<long>(type: "bigint", nullable: false),
IsCheering = table.Column<bool>(type: "bit", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InventionPersonalDetails", x => x.DetailId);
});
migrationBuilder.CreateTable(
name: "InventionVersions",
columns: table => new
{
VersionId = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
InventionId = table.Column<long>(type: "bigint", nullable: false),
ReplicationId = table.Column<string>(type: "nvarchar(max)", nullable: false),
VersionNumber = table.Column<int>(type: "int", nullable: false),
InstantiationCost = table.Column<int>(type: "int", nullable: false),
CloudVariablesCost = table.Column<int>(type: "int", nullable: false),
ChipsCost = table.Column<int>(type: "int", nullable: false),
LightsCost = table.Column<int>(type: "int", nullable: false),
BlobName = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InventionVersions", x => x.VersionId);
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "InventionPersonalDetails");
migrationBuilder.DropTable(
name: "InventionVersions");
migrationBuilder.DropColumn(
name: "AICost",
table: "Inventions");
migrationBuilder.DropColumn(
name: "ChipsCost",
table: "Inventions");
migrationBuilder.DropColumn(
name: "CloudVariablesCost",
table: "Inventions");
migrationBuilder.AlterColumn<int>(
name: "CreatorPlayerId",
table: "Inventions",
type: "int",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
}
}
}