feat(guild): add Guild aggregate schema + migration
This commit is contained in:
@@ -85,6 +85,165 @@ namespace SVSim.Database.Migrations
|
||||
b.ToTable("MyPageBackgroundEntryViewer");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.Guild", b =>
|
||||
{
|
||||
b.Property<int>("GuildId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Activity")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime?>("BreakupAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasMaxLength(512)
|
||||
.HasColumnType("character varying(512)");
|
||||
|
||||
b.Property<long>("EmblemId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("JoinCondition")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<long>("LeaderViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("character varying(64)");
|
||||
|
||||
b.HasKey("GuildId");
|
||||
|
||||
b.HasIndex("Name");
|
||||
|
||||
b.ToTable("Guilds");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildChatMessage", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<long>("AuthorViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("Body")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("DeckPayload")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<int>("GuildId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("MessageId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("MessageType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("ReplayPayload")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.Property<string>("RoomPayload")
|
||||
.HasColumnType("jsonb");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuildId", "MessageId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("GuildChatMessages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildInvite", b =>
|
||||
{
|
||||
b.Property<int>("GuildId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<long>("InviteeViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<long>("InviterViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime?>("RespondedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("GuildId", "InviteeViewerId");
|
||||
|
||||
b.HasIndex("InviteeViewerId", "Status");
|
||||
|
||||
b.ToTable("GuildInvites");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildJoinRequest", b =>
|
||||
{
|
||||
b.Property<int>("GuildId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<long>("ViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<DateTime?>("RespondedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("GuildId", "ViewerId");
|
||||
|
||||
b.HasIndex("GuildId", "Status");
|
||||
|
||||
b.HasIndex("ViewerId", "Status");
|
||||
|
||||
b.ToTable("GuildJoinRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildMember", b =>
|
||||
{
|
||||
b.Property<int>("GuildId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<long>("ViewerId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("JoinedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<int>("Role")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("GuildId", "ViewerId");
|
||||
|
||||
b.HasIndex("ViewerId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("GuildMembers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Story.SpecialBattleSetting", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -2685,6 +2844,9 @@ namespace SVSim.Database.Migrations
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("GuildId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("LastLogin")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
@@ -2712,6 +2874,8 @@ namespace SVSim.Database.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GuildId");
|
||||
|
||||
b.HasIndex("ShortUdid");
|
||||
|
||||
b.HasIndex("Udid")
|
||||
@@ -3479,6 +3643,50 @@ namespace SVSim.Database.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildChatMessage", b =>
|
||||
{
|
||||
b.HasOne("SVSim.Database.Entities.Guild.Guild", "Guild")
|
||||
.WithMany()
|
||||
.HasForeignKey("GuildId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guild");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildInvite", b =>
|
||||
{
|
||||
b.HasOne("SVSim.Database.Entities.Guild.Guild", "Guild")
|
||||
.WithMany()
|
||||
.HasForeignKey("GuildId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guild");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildJoinRequest", b =>
|
||||
{
|
||||
b.HasOne("SVSim.Database.Entities.Guild.Guild", "Guild")
|
||||
.WithMany()
|
||||
.HasForeignKey("GuildId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guild");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.GuildMember", b =>
|
||||
{
|
||||
b.HasOne("SVSim.Database.Entities.Guild.Guild", "Guild")
|
||||
.WithMany("Members")
|
||||
.HasForeignKey("GuildId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("Guild");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Story.StoryChapter", b =>
|
||||
{
|
||||
b.HasOne("SVSim.Database.Entities.Story.StorySection", "Section")
|
||||
@@ -4112,6 +4320,11 @@ namespace SVSim.Database.Migrations
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.Viewer", b =>
|
||||
{
|
||||
b.HasOne("SVSim.Database.Entities.Guild.Guild", "Guild")
|
||||
.WithMany()
|
||||
.HasForeignKey("GuildId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.OwnsMany("SVSim.Database.Models.MyPageBgRotationEntry", "MyPageBgRotation", b1 =>
|
||||
{
|
||||
b1.Property<long>("ViewerId")
|
||||
@@ -4588,6 +4801,8 @@ namespace SVSim.Database.Migrations
|
||||
|
||||
b.Navigation("GachaPointReceived");
|
||||
|
||||
b.Navigation("Guild");
|
||||
|
||||
b.Navigation("Info")
|
||||
.IsRequired();
|
||||
|
||||
@@ -4719,6 +4934,11 @@ namespace SVSim.Database.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Entities.Guild.Guild", b =>
|
||||
{
|
||||
b.Navigation("Members");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("SVSim.Database.Models.BattlePassSeasonEntry", b =>
|
||||
{
|
||||
b.Navigation("Rewards");
|
||||
|
||||
Reference in New Issue
Block a user