From 9689e027f31c68a6439105546c0c3795c2ad6738 Mon Sep 17 00:00:00 2001 From: Jabak <163307958+Jabaks@users.noreply.github.com> Date: Wed, 17 Jul 2024 21:32:40 +0300 Subject: [PATCH] =?UTF-8?q?fix=20db....=20=D0=AF=20=D0=B1=D0=BB=D1=8F?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B2=D0=B0=D1=85=D1=83=D0=B5=20=D1=81=20=D1=8D?= =?UTF-8?q?=D1=82=D0=BE=D0=B3=D0=BE=20=D0=B3=D0=BE=D0=B2=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...r.cs => 20240717182707_Height.Designer.cs} | 153 ++++++++++++++++-- ...ghtPrikoli.cs => 20240717182707_Height.cs} | 2 +- ...r.cs => 20240717182625_Height.Designer.cs} | 147 +++++++++++++++-- ...ghtPrikoli.cs => 20240717182625_Height.cs} | 2 +- 4 files changed, 270 insertions(+), 34 deletions(-) rename Content.Server.Database/Migrations/Postgres/{20240310093942_HeightPrikoli.Designer.cs => 20240717182707_Height.Designer.cs} (93%) rename Content.Server.Database/Migrations/Postgres/{20240310093942_HeightPrikoli.cs => 20240717182707_Height.cs} (93%) rename Content.Server.Database/Migrations/Sqlite/{20240310093818_HeightPrikoli.Designer.cs => 20240717182625_Height.Designer.cs} (93%) rename Content.Server.Database/Migrations/Sqlite/{20240310093818_HeightPrikoli.cs => 20240717182625_Height.cs} (93%) diff --git a/Content.Server.Database/Migrations/Postgres/20240310093942_HeightPrikoli.Designer.cs b/Content.Server.Database/Migrations/Postgres/20240717182707_Height.Designer.cs similarity index 93% rename from Content.Server.Database/Migrations/Postgres/20240310093942_HeightPrikoli.Designer.cs rename to Content.Server.Database/Migrations/Postgres/20240717182707_Height.Designer.cs index 6cb6f22f91..35253afff6 100644 --- a/Content.Server.Database/Migrations/Postgres/20240310093942_HeightPrikoli.Designer.cs +++ b/Content.Server.Database/Migrations/Postgres/20240717182707_Height.Designer.cs @@ -15,8 +15,8 @@ using NpgsqlTypes; namespace Content.Server.Database.Migrations.Postgres { [DbContext(typeof(PostgresServerDbContext))] - [Migration("20240310093942_HeightPrikoli")] - partial class HeightPrikoli + [Migration("20240717182707_Height")] + partial class Height { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -190,6 +190,10 @@ namespace Content.Server.Database.Migrations.Postgres .HasColumnType("uuid") .HasColumnName("deleted_by_id"); + b.Property("Dismissed") + .HasColumnType("boolean") + .HasColumnName("dismissed"); + b.Property("ExpirationTime") .HasColumnType("timestamp with time zone") .HasColumnName("expiration_time"); @@ -239,7 +243,10 @@ namespace Content.Server.Database.Migrations.Postgres b.HasIndex("RoundId") .HasDatabaseName("IX_admin_messages_round_id"); - b.ToTable("admin_messages", (string)null); + b.ToTable("admin_messages", null, t => + { + t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); + }); }); modelBuilder.Entity("Content.Server.Database.AdminNote", b => @@ -790,11 +797,6 @@ namespace Content.Server.Database.Migrations.Postgres .HasColumnType("integer") .HasColumnName("age"); - b.Property("Backpack") - .IsRequired() - .HasColumnType("text") - .HasColumnName("backpack"); - b.Property("BodyType") .IsRequired() .HasColumnType("text") @@ -810,11 +812,6 @@ namespace Content.Server.Database.Migrations.Postgres .HasColumnType("text") .HasColumnName("char_name"); - b.Property("Clothing") - .IsRequired() - .HasColumnType("text") - .HasColumnName("clothing"); - b.Property("ClownName") .IsRequired() .HasColumnType("text") @@ -916,6 +913,84 @@ namespace Content.Server.Database.Migrations.Postgres b.ToTable("profile", (string)null); }); + modelBuilder.Entity("Content.Server.Database.ProfileLoadout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("profile_loadout_id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("LoadoutName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("loadout_name"); + + b.Property("ProfileLoadoutGroupId") + .HasColumnType("integer") + .HasColumnName("profile_loadout_group_id"); + + b.HasKey("Id") + .HasName("PK_profile_loadout"); + + b.HasIndex("ProfileLoadoutGroupId"); + + b.ToTable("profile_loadout", (string)null); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("profile_loadout_group_id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("GroupName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("group_name"); + + b.Property("ProfileRoleLoadoutId") + .HasColumnType("integer") + .HasColumnName("profile_role_loadout_id"); + + b.HasKey("Id") + .HasName("PK_profile_loadout_group"); + + b.HasIndex("ProfileRoleLoadoutId"); + + b.ToTable("profile_loadout_group", (string)null); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer") + .HasColumnName("profile_role_loadout_id"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ProfileId") + .HasColumnType("integer") + .HasColumnName("profile_id"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("text") + .HasColumnName("role_name"); + + b.HasKey("Id") + .HasName("PK_profile_role_loadout"); + + b.HasIndex("ProfileId"); + + b.ToTable("profile_role_loadout", (string)null); + }); + modelBuilder.Entity("Content.Server.Database.RoleplayInfo", b => { b.Property("Id") @@ -960,10 +1035,8 @@ namespace Content.Server.Database.Migrations.Postgres .HasColumnType("integer") .HasColumnName("server_id"); - b.Property("StartDate") - .ValueGeneratedOnAdd() + b.Property("StartDate") .HasColumnType("timestamp with time zone") - .HasDefaultValue(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)) .HasColumnName("start_date"); b.HasKey("Id") @@ -1656,6 +1729,42 @@ namespace Content.Server.Database.Migrations.Postgres b.Navigation("Preference"); }); + modelBuilder.Entity("Content.Server.Database.ProfileLoadout", b => + { + b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") + .WithMany("Loadouts") + .HasForeignKey("ProfileLoadoutGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group~"); + + b.Navigation("ProfileLoadoutGroup"); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => + { + b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") + .WithMany("Groups") + .HasForeignKey("ProfileRoleLoadoutId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loa~"); + + b.Navigation("ProfileRoleLoadout"); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => + { + b.HasOne("Content.Server.Database.Profile", "Profile") + .WithMany("Loadouts") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); + + b.Navigation("Profile"); + }); + modelBuilder.Entity("Content.Server.Database.RoleplayInfo", b => { b.HasOne("Content.Server.Database.Profile", "Profile") @@ -1882,11 +1991,23 @@ namespace Content.Server.Database.Migrations.Postgres b.Navigation("Jobs"); + b.Navigation("Loadouts"); + b.Navigation("RoleplayInfo"); b.Navigation("Traits"); }); + modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => + { + b.Navigation("Loadouts"); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => + { + b.Navigation("Groups"); + }); + modelBuilder.Entity("Content.Server.Database.Round", b => { b.Navigation("AdminLogs"); diff --git a/Content.Server.Database/Migrations/Postgres/20240310093942_HeightPrikoli.cs b/Content.Server.Database/Migrations/Postgres/20240717182707_Height.cs similarity index 93% rename from Content.Server.Database/Migrations/Postgres/20240310093942_HeightPrikoli.cs rename to Content.Server.Database/Migrations/Postgres/20240717182707_Height.cs index ea69df6dba..f7ecab2b15 100644 --- a/Content.Server.Database/Migrations/Postgres/20240310093942_HeightPrikoli.cs +++ b/Content.Server.Database/Migrations/Postgres/20240717182707_Height.cs @@ -5,7 +5,7 @@ namespace Content.Server.Database.Migrations.Postgres { /// - public partial class HeightPrikoli : Migration + public partial class Height : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) diff --git a/Content.Server.Database/Migrations/Sqlite/20240310093818_HeightPrikoli.Designer.cs b/Content.Server.Database/Migrations/Sqlite/20240717182625_Height.Designer.cs similarity index 93% rename from Content.Server.Database/Migrations/Sqlite/20240310093818_HeightPrikoli.Designer.cs rename to Content.Server.Database/Migrations/Sqlite/20240717182625_Height.Designer.cs index 6bdf161736..9c79bc6335 100644 --- a/Content.Server.Database/Migrations/Sqlite/20240310093818_HeightPrikoli.Designer.cs +++ b/Content.Server.Database/Migrations/Sqlite/20240717182625_Height.Designer.cs @@ -11,8 +11,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Content.Server.Database.Migrations.Sqlite { [DbContext(typeof(SqliteServerDbContext))] - [Migration("20240310093818_HeightPrikoli")] - partial class HeightPrikoli + [Migration("20240717182625_Height")] + partial class Height { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -173,6 +173,10 @@ namespace Content.Server.Database.Migrations.Sqlite .HasColumnType("TEXT") .HasColumnName("deleted_by_id"); + b.Property("Dismissed") + .HasColumnType("INTEGER") + .HasColumnName("dismissed"); + b.Property("ExpirationTime") .HasColumnType("TEXT") .HasColumnName("expiration_time"); @@ -222,7 +226,10 @@ namespace Content.Server.Database.Migrations.Sqlite b.HasIndex("RoundId") .HasDatabaseName("IX_admin_messages_round_id"); - b.ToTable("admin_messages", (string)null); + b.ToTable("admin_messages", null, t => + { + t.HasCheckConstraint("NotDismissedAndSeen", "NOT dismissed OR seen"); + }); }); modelBuilder.Entity("Content.Server.Database.AdminNote", b => @@ -739,11 +746,6 @@ namespace Content.Server.Database.Migrations.Sqlite .HasColumnType("INTEGER") .HasColumnName("age"); - b.Property("Backpack") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("backpack"); - b.Property("BodyType") .IsRequired() .HasColumnType("TEXT") @@ -759,11 +761,6 @@ namespace Content.Server.Database.Migrations.Sqlite .HasColumnType("TEXT") .HasColumnName("char_name"); - b.Property("Clothing") - .IsRequired() - .HasColumnType("TEXT") - .HasColumnName("clothing"); - b.Property("ClownName") .IsRequired() .HasColumnType("TEXT") @@ -865,6 +862,78 @@ namespace Content.Server.Database.Migrations.Sqlite b.ToTable("profile", (string)null); }); + modelBuilder.Entity("Content.Server.Database.ProfileLoadout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasColumnName("profile_loadout_id"); + + b.Property("LoadoutName") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("loadout_name"); + + b.Property("ProfileLoadoutGroupId") + .HasColumnType("INTEGER") + .HasColumnName("profile_loadout_group_id"); + + b.HasKey("Id") + .HasName("PK_profile_loadout"); + + b.HasIndex("ProfileLoadoutGroupId"); + + b.ToTable("profile_loadout", (string)null); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasColumnName("profile_loadout_group_id"); + + b.Property("GroupName") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("group_name"); + + b.Property("ProfileRoleLoadoutId") + .HasColumnType("INTEGER") + .HasColumnName("profile_role_loadout_id"); + + b.HasKey("Id") + .HasName("PK_profile_loadout_group"); + + b.HasIndex("ProfileRoleLoadoutId"); + + b.ToTable("profile_loadout_group", (string)null); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER") + .HasColumnName("profile_role_loadout_id"); + + b.Property("ProfileId") + .HasColumnType("INTEGER") + .HasColumnName("profile_id"); + + b.Property("RoleName") + .IsRequired() + .HasColumnType("TEXT") + .HasColumnName("role_name"); + + b.HasKey("Id") + .HasName("PK_profile_role_loadout"); + + b.HasIndex("ProfileId"); + + b.ToTable("profile_role_loadout", (string)null); + }); + modelBuilder.Entity("Content.Server.Database.RoleplayInfo", b => { b.Property("Id") @@ -905,10 +974,8 @@ namespace Content.Server.Database.Migrations.Sqlite .HasColumnType("INTEGER") .HasColumnName("server_id"); - b.Property("StartDate") - .ValueGeneratedOnAdd() + b.Property("StartDate") .HasColumnType("TEXT") - .HasDefaultValue(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)) .HasColumnName("start_date"); b.HasKey("Id") @@ -1581,6 +1648,42 @@ namespace Content.Server.Database.Migrations.Sqlite b.Navigation("Preference"); }); + modelBuilder.Entity("Content.Server.Database.ProfileLoadout", b => + { + b.HasOne("Content.Server.Database.ProfileLoadoutGroup", "ProfileLoadoutGroup") + .WithMany("Loadouts") + .HasForeignKey("ProfileLoadoutGroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_profile_loadout_profile_loadout_group_profile_loadout_group_id"); + + b.Navigation("ProfileLoadoutGroup"); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => + { + b.HasOne("Content.Server.Database.ProfileRoleLoadout", "ProfileRoleLoadout") + .WithMany("Groups") + .HasForeignKey("ProfileRoleLoadoutId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_profile_loadout_group_profile_role_loadout_profile_role_loadout_id"); + + b.Navigation("ProfileRoleLoadout"); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => + { + b.HasOne("Content.Server.Database.Profile", "Profile") + .WithMany("Loadouts") + .HasForeignKey("ProfileId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("FK_profile_role_loadout_profile_profile_id"); + + b.Navigation("Profile"); + }); + modelBuilder.Entity("Content.Server.Database.RoleplayInfo", b => { b.HasOne("Content.Server.Database.Profile", "Profile") @@ -1807,11 +1910,23 @@ namespace Content.Server.Database.Migrations.Sqlite b.Navigation("Jobs"); + b.Navigation("Loadouts"); + b.Navigation("RoleplayInfo"); b.Navigation("Traits"); }); + modelBuilder.Entity("Content.Server.Database.ProfileLoadoutGroup", b => + { + b.Navigation("Loadouts"); + }); + + modelBuilder.Entity("Content.Server.Database.ProfileRoleLoadout", b => + { + b.Navigation("Groups"); + }); + modelBuilder.Entity("Content.Server.Database.Round", b => { b.Navigation("AdminLogs"); diff --git a/Content.Server.Database/Migrations/Sqlite/20240310093818_HeightPrikoli.cs b/Content.Server.Database/Migrations/Sqlite/20240717182625_Height.cs similarity index 93% rename from Content.Server.Database/Migrations/Sqlite/20240310093818_HeightPrikoli.cs rename to Content.Server.Database/Migrations/Sqlite/20240717182625_Height.cs index 1e09c8a625..2809c0a2f0 100644 --- a/Content.Server.Database/Migrations/Sqlite/20240310093818_HeightPrikoli.cs +++ b/Content.Server.Database/Migrations/Sqlite/20240717182625_Height.cs @@ -5,7 +5,7 @@ namespace Content.Server.Database.Migrations.Sqlite { /// - public partial class HeightPrikoli : Migration + public partial class Height : Migration { /// protected override void Up(MigrationBuilder migrationBuilder)