diff --git a/Migrations/20241126211247_working state naming.Designer.cs b/Migrations/20241126211247_working state naming.Designer.cs new file mode 100644 index 0000000..df021f8 --- /dev/null +++ b/Migrations/20241126211247_working state naming.Designer.cs @@ -0,0 +1,92 @@ +// +using BHServer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace BHServer.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20241126211247_working state naming")] + partial class workingstatenaming + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.0") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("BHServer.Models.AssaultTroop", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("id")); + + b.Property("faction") + .HasColumnType("integer"); + + b.Property("name") + .IsRequired() + .HasColumnType("text"); + + b.Property("orders") + .IsRequired() + .HasColumnType("text"); + + b.Property("owner") + .HasColumnType("integer"); + + b.Property("province") + .HasColumnType("integer"); + + b.Property("type") + .HasColumnType("integer"); + + b.HasKey("id"); + + b.ToTable("assault_troop"); + }); + + modelBuilder.Entity("BHServer.Models.Province", b => + { + b.Property("id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("id")); + + b.Property("ats") + .IsRequired() + .HasColumnType("text"); + + b.Property("faction") + .HasColumnType("integer"); + + b.Property("multiplier") + .HasColumnType("integer"); + + b.Property("name") + .IsRequired() + .HasColumnType("text"); + + b.Property("state") + .HasColumnType("integer"); + + b.HasKey("id"); + + b.ToTable("province"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Migrations/20241126211247_working state naming.cs b/Migrations/20241126211247_working state naming.cs new file mode 100644 index 0000000..5c860d7 --- /dev/null +++ b/Migrations/20241126211247_working state naming.cs @@ -0,0 +1,222 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace BHServer.Migrations +{ + /// + public partial class workingstatenaming : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_Province", + table: "Province"); + + migrationBuilder.DropPrimaryKey( + name: "PK_AssaultTroop", + table: "AssaultTroop"); + + migrationBuilder.DropColumn( + name: "ProvinceId", + table: "Province"); + + migrationBuilder.DropColumn( + name: "ATId", + table: "AssaultTroop"); + + migrationBuilder.RenameTable( + name: "Province", + newName: "province"); + + migrationBuilder.RenameTable( + name: "AssaultTroop", + newName: "assault_troop"); + + migrationBuilder.RenameColumn( + name: "State", + table: "province", + newName: "state"); + + migrationBuilder.RenameColumn( + name: "Name", + table: "province", + newName: "name"); + + migrationBuilder.RenameColumn( + name: "Multiplier", + table: "province", + newName: "multiplier"); + + migrationBuilder.RenameColumn( + name: "Faction", + table: "province", + newName: "faction"); + + migrationBuilder.RenameColumn( + name: "ATs", + table: "province", + newName: "ats"); + + migrationBuilder.RenameColumn( + name: "Id", + table: "province", + newName: "id"); + + migrationBuilder.RenameColumn( + name: "Type", + table: "assault_troop", + newName: "type"); + + migrationBuilder.RenameColumn( + name: "Province", + table: "assault_troop", + newName: "province"); + + migrationBuilder.RenameColumn( + name: "Owner", + table: "assault_troop", + newName: "owner"); + + migrationBuilder.RenameColumn( + name: "Orders", + table: "assault_troop", + newName: "orders"); + + migrationBuilder.RenameColumn( + name: "Name", + table: "assault_troop", + newName: "name"); + + migrationBuilder.RenameColumn( + name: "Faction", + table: "assault_troop", + newName: "faction"); + + migrationBuilder.RenameColumn( + name: "Id", + table: "assault_troop", + newName: "id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_province", + table: "province", + column: "id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_assault_troop", + table: "assault_troop", + column: "id"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropPrimaryKey( + name: "PK_province", + table: "province"); + + migrationBuilder.DropPrimaryKey( + name: "PK_assault_troop", + table: "assault_troop"); + + migrationBuilder.RenameTable( + name: "province", + newName: "Province"); + + migrationBuilder.RenameTable( + name: "assault_troop", + newName: "AssaultTroop"); + + migrationBuilder.RenameColumn( + name: "state", + table: "Province", + newName: "State"); + + migrationBuilder.RenameColumn( + name: "name", + table: "Province", + newName: "Name"); + + migrationBuilder.RenameColumn( + name: "multiplier", + table: "Province", + newName: "Multiplier"); + + migrationBuilder.RenameColumn( + name: "faction", + table: "Province", + newName: "Faction"); + + migrationBuilder.RenameColumn( + name: "ats", + table: "Province", + newName: "ATs"); + + migrationBuilder.RenameColumn( + name: "id", + table: "Province", + newName: "Id"); + + migrationBuilder.RenameColumn( + name: "type", + table: "AssaultTroop", + newName: "Type"); + + migrationBuilder.RenameColumn( + name: "province", + table: "AssaultTroop", + newName: "Province"); + + migrationBuilder.RenameColumn( + name: "owner", + table: "AssaultTroop", + newName: "Owner"); + + migrationBuilder.RenameColumn( + name: "orders", + table: "AssaultTroop", + newName: "Orders"); + + migrationBuilder.RenameColumn( + name: "name", + table: "AssaultTroop", + newName: "Name"); + + migrationBuilder.RenameColumn( + name: "faction", + table: "AssaultTroop", + newName: "Faction"); + + migrationBuilder.RenameColumn( + name: "id", + table: "AssaultTroop", + newName: "Id"); + + migrationBuilder.AddColumn( + name: "ProvinceId", + table: "Province", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "ATId", + table: "AssaultTroop", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddPrimaryKey( + name: "PK_Province", + table: "Province", + column: "Id"); + + migrationBuilder.AddPrimaryKey( + name: "PK_AssaultTroop", + table: "AssaultTroop", + column: "Id"); + } + } +} diff --git a/Migrations/ApplicationDbContextModelSnapshot.cs b/Migrations/ApplicationDbContextModelSnapshot.cs index 915809c..dc36776 100644 --- a/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Migrations/ApplicationDbContextModelSnapshot.cs @@ -23,71 +23,65 @@ namespace BHServer.Migrations modelBuilder.Entity("BHServer.Models.AssaultTroop", b => { - b.Property("Id") + b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("integer"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("id")); - b.Property("ATId") + b.Property("faction") .HasColumnType("integer"); - b.Property("Faction") - .HasColumnType("integer"); - - b.Property("Name") + b.Property("name") .IsRequired() .HasColumnType("text"); - b.Property("Orders") + b.Property("orders") .IsRequired() .HasColumnType("text"); - b.Property("Owner") + b.Property("owner") .HasColumnType("integer"); - b.Property("Province") + b.Property("province") .HasColumnType("integer"); - b.Property("Type") + b.Property("type") .HasColumnType("integer"); - b.HasKey("Id"); + b.HasKey("id"); - b.ToTable("AssaultTroop"); + b.ToTable("assault_troop"); }); modelBuilder.Entity("BHServer.Models.Province", b => { - b.Property("Id") + b.Property("id") .ValueGeneratedOnAdd() .HasColumnType("integer"); - NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("id")); - b.Property("ATs") + b.Property("ats") .IsRequired() .HasColumnType("text"); - b.Property("Faction") + b.Property("faction") .HasColumnType("integer"); - b.Property("Multiplier") + b.Property("multiplier") .HasColumnType("integer"); - b.Property("Name") + b.Property("name") .IsRequired() .HasColumnType("text"); - b.Property("ProvinceId") + b.Property("state") .HasColumnType("integer"); - b.Property("State") - .HasColumnType("integer"); + b.HasKey("id"); - b.HasKey("Id"); - - b.ToTable("Province"); + b.ToTable("province"); }); #pragma warning restore 612, 618 }