811b6ef51a
Backend CI / build-and-test (push) Successful in 52s
Frontend CI / build-and-check (push) Failing after 5m15s
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 16s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 1m0s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 32s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 13s
59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
|
|
|
namespace UniVerse.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class LevelThresholds : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "level_thresholds",
|
|
columns: table => new
|
|
{
|
|
level = table.Column<int>(type: "integer", nullable: false),
|
|
required_xp = table.Column<int>(type: "integer", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_level_thresholds", x => x.level);
|
|
table.CheckConstraint("CK_level_thresholds_level_positive", "level > 0");
|
|
table.CheckConstraint("CK_level_thresholds_required_xp_non_negative", "required_xp >= 0");
|
|
});
|
|
|
|
migrationBuilder.InsertData(
|
|
table: "level_thresholds",
|
|
columns: new[] { "level", "required_xp" },
|
|
values: new object[,]
|
|
{
|
|
{ 1, 0 },
|
|
{ 2, 100 },
|
|
{ 3, 300 },
|
|
{ 4, 600 },
|
|
{ 5, 1000 },
|
|
{ 6, 1500 },
|
|
{ 7, 2500 },
|
|
{ 8, 4000 }
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_level_thresholds_required_xp",
|
|
table: "level_thresholds",
|
|
column: "required_xp",
|
|
unique: true);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "level_thresholds");
|
|
}
|
|
}
|
|
}
|