Add initial migration with initial server data.
This commit is contained in:
parent
0d661c09e4
commit
0e6a1e4c86
139
ServerManagement/Migrations/20250415212250_InitialMigration.Designer.cs
generated
Normal file
139
ServerManagement/Migrations/20250415212250_InitialMigration.Designer.cs
generated
Normal file
@ -0,0 +1,139 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ServerManagement.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ServerManagement.Migrations
|
||||
{
|
||||
[DbContext(typeof(ServerManagementContext))]
|
||||
[Migration("20250415212250_InitialMigration")]
|
||||
partial class InitialMigration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
|
||||
|
||||
modelBuilder.Entity("ServerManagement.Models.Server", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("City")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsOnline")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Servers");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
City = "Eindhoven",
|
||||
IsOnline = true,
|
||||
Name = "Server1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
City = "Eindhoven",
|
||||
IsOnline = true,
|
||||
Name = "Server2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
City = "Eindhoven",
|
||||
IsOnline = false,
|
||||
Name = "Server3"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
City = "Eindhoven",
|
||||
IsOnline = true,
|
||||
Name = "Server4"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
City = "Helmond",
|
||||
IsOnline = true,
|
||||
Name = "Server5"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
City = "Helmond",
|
||||
IsOnline = false,
|
||||
Name = "Server6"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
City = "Helmond",
|
||||
IsOnline = true,
|
||||
Name = "Server7"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 8,
|
||||
City = "Oosterhout",
|
||||
IsOnline = true,
|
||||
Name = "Server8"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 9,
|
||||
City = "Oosterhout",
|
||||
IsOnline = true,
|
||||
Name = "Server9"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 10,
|
||||
City = "Roosendaal",
|
||||
IsOnline = false,
|
||||
Name = "Server10"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 11,
|
||||
City = "Roosendaal",
|
||||
IsOnline = false,
|
||||
Name = "Server11"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 12,
|
||||
City = "Deurne",
|
||||
IsOnline = false,
|
||||
Name = "Server12"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 13,
|
||||
City = "Deurne",
|
||||
IsOnline = true,
|
||||
Name = "Server13"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace ServerManagement.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialMigration : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Servers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "INTEGER", nullable: false)
|
||||
.Annotation("Sqlite:Autoincrement", true),
|
||||
IsOnline = table.Column<bool>(type: "INTEGER", nullable: false),
|
||||
Name = table.Column<string>(type: "TEXT", nullable: false),
|
||||
City = table.Column<string>(type: "TEXT", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Servers", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Servers",
|
||||
columns: new[] { "Id", "City", "IsOnline", "Name" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, "Eindhoven", true, "Server1" },
|
||||
{ 2, "Eindhoven", true, "Server2" },
|
||||
{ 3, "Eindhoven", false, "Server3" },
|
||||
{ 4, "Eindhoven", true, "Server4" },
|
||||
{ 5, "Helmond", true, "Server5" },
|
||||
{ 6, "Helmond", false, "Server6" },
|
||||
{ 7, "Helmond", true, "Server7" },
|
||||
{ 8, "Oosterhout", true, "Server8" },
|
||||
{ 9, "Oosterhout", true, "Server9" },
|
||||
{ 10, "Roosendaal", false, "Server10" },
|
||||
{ 11, "Roosendaal", false, "Server11" },
|
||||
{ 12, "Deurne", false, "Server12" },
|
||||
{ 13, "Deurne", true, "Server13" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Servers");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ServerManagement.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace ServerManagement.Migrations
|
||||
{
|
||||
[DbContext(typeof(ServerManagementContext))]
|
||||
partial class ServerManagementContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "9.0.4");
|
||||
|
||||
modelBuilder.Entity("ServerManagement.Models.Server", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("City")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<bool>("IsOnline")
|
||||
.HasColumnType("INTEGER");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Servers");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
City = "Eindhoven",
|
||||
IsOnline = true,
|
||||
Name = "Server1"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
City = "Eindhoven",
|
||||
IsOnline = true,
|
||||
Name = "Server2"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
City = "Eindhoven",
|
||||
IsOnline = false,
|
||||
Name = "Server3"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
City = "Eindhoven",
|
||||
IsOnline = true,
|
||||
Name = "Server4"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
City = "Helmond",
|
||||
IsOnline = true,
|
||||
Name = "Server5"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
City = "Helmond",
|
||||
IsOnline = false,
|
||||
Name = "Server6"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
City = "Helmond",
|
||||
IsOnline = true,
|
||||
Name = "Server7"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 8,
|
||||
City = "Oosterhout",
|
||||
IsOnline = true,
|
||||
Name = "Server8"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 9,
|
||||
City = "Oosterhout",
|
||||
IsOnline = true,
|
||||
Name = "Server9"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 10,
|
||||
City = "Roosendaal",
|
||||
IsOnline = false,
|
||||
Name = "Server10"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 11,
|
||||
City = "Roosendaal",
|
||||
IsOnline = false,
|
||||
Name = "Server11"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 12,
|
||||
City = "Deurne",
|
||||
IsOnline = false,
|
||||
Name = "Server12"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 13,
|
||||
City = "Deurne",
|
||||
IsOnline = true,
|
||||
Name = "Server13"
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user