chore: add migration for inventory data

This commit is contained in:
Timothy Schenk 2023-11-08 15:39:25 +01:00
parent 90846c04b8
commit 5b143c1ef3
2 changed files with 6 additions and 146 deletions

View file

@ -63,12 +63,6 @@ namespace Server.DB.Migrations
b.Property<byte>("Gender") b.Property<byte>("Gender")
.HasColumnType("smallint"); .HasColumnType("smallint");
b.Property<Guid>("GuildId")
.HasColumnType("uuid");
b.Property<int>("Health")
.HasColumnType("integer");
b.Property<short>("LastXCoordinate") b.Property<short>("LastXCoordinate")
.HasColumnType("smallint"); .HasColumnType("smallint");
@ -78,9 +72,6 @@ namespace Server.DB.Migrations
b.Property<byte>("Level") b.Property<byte>("Level")
.HasColumnType("smallint"); .HasColumnType("smallint");
b.Property<int>("Mana")
.HasColumnType("integer");
b.Property<int>("MapId") b.Property<int>("MapId")
.HasColumnType("integer"); .HasColumnType("integer");
@ -97,52 +88,9 @@ namespace Server.DB.Migrations
b.HasIndex("AccountId"); b.HasIndex("AccountId");
b.HasIndex("GuildId");
b.ToTable("Characters"); b.ToTable("Characters");
}); });
modelBuilder.Entity("Server.DB.Documents.Guild", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Name")
.HasColumnType("text");
b.Property<string>("Notice")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Guild");
});
modelBuilder.Entity("Server.DB.Documents.GuildMember", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<Guid>("CharacterId")
.HasColumnType("uuid");
b.Property<Guid>("GuildId")
.HasColumnType("uuid");
b.Property<byte>("Rank")
.HasColumnType("smallint");
b.HasKey("Id");
b.HasIndex("CharacterId");
b.HasIndex("GuildId");
b.ToTable("GuildMember");
});
modelBuilder.Entity("Server.DB.Documents.InventoryItem", b => modelBuilder.Entity("Server.DB.Documents.InventoryItem", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -164,8 +112,8 @@ namespace Server.DB.Migrations
b.Property<int>("Count") b.Property<int>("Count")
.HasColumnType("integer"); .HasColumnType("integer");
b.Property<int>("ItemId") b.Property<short>("ItemId")
.HasColumnType("integer"); .HasColumnType("smallint");
b.Property<byte>("ItemType") b.Property<byte>("ItemType")
.HasColumnType("smallint"); .HasColumnType("smallint");
@ -203,94 +151,7 @@ namespace Server.DB.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.HasOne("Server.DB.Documents.Guild", "Guild")
.WithMany()
.HasForeignKey("GuildId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("Wonderking.Packets.Outgoing.BaseStats", "BaseStats", b1 =>
{
b1.Property<Guid>("CharacterId")
.HasColumnType("uuid");
b1.Property<short>("Dexterity")
.HasColumnType("smallint");
b1.Property<short>("Intelligence")
.HasColumnType("smallint");
b1.Property<short>("Luck")
.HasColumnType("smallint");
b1.Property<short>("Strength")
.HasColumnType("smallint");
b1.Property<short>("Vitality")
.HasColumnType("smallint");
b1.Property<short>("Wisdom")
.HasColumnType("smallint");
b1.HasKey("CharacterId");
b1.ToTable("Characters");
b1.WithOwner()
.HasForeignKey("CharacterId");
});
b.OwnsOne("Wonderking.Packets.Outgoing.JobData", "JobData", b1 =>
{
b1.Property<Guid>("CharacterId")
.HasColumnType("uuid");
b1.Property<byte>("FirstJob")
.HasColumnType("smallint");
b1.Property<byte>("FourthJob")
.HasColumnType("smallint");
b1.Property<byte>("SecondJob")
.HasColumnType("smallint");
b1.Property<byte>("ThirdJob")
.HasColumnType("smallint");
b1.HasKey("CharacterId");
b1.ToTable("Characters");
b1.WithOwner()
.HasForeignKey("CharacterId");
});
b.Navigation("Account"); b.Navigation("Account");
b.Navigation("BaseStats");
b.Navigation("Guild");
b.Navigation("JobData");
});
modelBuilder.Entity("Server.DB.Documents.GuildMember", b =>
{
b.HasOne("Server.DB.Documents.Character", "Character")
.WithMany()
.HasForeignKey("CharacterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Server.DB.Documents.Guild", "Guild")
.WithMany("GuildMembers")
.HasForeignKey("GuildId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Character");
b.Navigation("Guild");
}); });
modelBuilder.Entity("Server.DB.Documents.InventoryItem", b => modelBuilder.Entity("Server.DB.Documents.InventoryItem", b =>
@ -313,11 +174,6 @@ namespace Server.DB.Migrations
{ {
b.Navigation("InventoryItems"); b.Navigation("InventoryItems");
}); });
modelBuilder.Entity("Server.DB.Documents.Guild", b =>
{
b.Navigation("GuildMembers");
});
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }

View file

@ -66,6 +66,10 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.14"/> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.14"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.14"/> <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="7.0.14"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.14"/> <PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.14"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.14">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0"/> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0"/>