From c33dc217bf7d87b8a3d928c592519354fbfee05b Mon Sep 17 00:00:00 2001 From: Sergey Nazarov <51015808+krenky@users.noreply.github.com> Date: Thu, 13 Nov 2025 16:50:43 +0300 Subject: [PATCH 1/5] sync fork (#148) * Bump Telegram.Bot from 22.4.3 to 22.4.4 Bumps [Telegram.Bot](https://github.com/TelegramBots/telegram.bot) from 22.4.3 to 22.4.4. - [Release notes](https://github.com/TelegramBots/telegram.bot/releases) - [Changelog](https://github.com/TelegramBots/Telegram.Bot/blob/master/CHANGELOG.md) - [Commits](https://github.com/TelegramBots/telegram.bot/compare/v22.4.3...v22.4.4) --- updated-dependencies: - dependency-name: Telegram.Bot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump Npgsql.EntityFrameworkCore.PostgreSQL from 9.0.3 to 9.0.4 Bumps [Npgsql.EntityFrameworkCore.PostgreSQL](https://github.com/npgsql/efcore.pg) from 9.0.3 to 9.0.4. - [Release notes](https://github.com/npgsql/efcore.pg/releases) - [Commits](https://github.com/npgsql/efcore.pg/compare/v9.0.3...v9.0.4) --- updated-dependencies: - dependency-name: Npgsql.EntityFrameworkCore.PostgreSQL dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump Swashbuckle.AspNetCore from 7.2.0 to 7.3.1 Bumps [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) from 7.2.0 to 7.3.1. - [Release notes](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/releases) - [Commits](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/compare/v7.2.0...v7.3.1) --- updated-dependencies: - dependency-name: Swashbuckle.AspNetCore dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * up-nuget * merge --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sergey Nazarov From 473b879edcf5c1172209f3076ea45776ee314fae Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Mon, 22 Dec 2025 13:16:14 +0300 Subject: [PATCH 2/5] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=81=D0=B8=D0=B8=20postgresql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20251222095824_fixMigration.Designer.cs | 209 ++++++++++++++++++ .../Migrations/20251222095824_fixMigration.cs | 22 ++ .../Migrations/AppContextModelSnapshot.cs | 2 +- 3 files changed, 232 insertions(+), 1 deletion(-) create mode 100644 NotificationBot/Migrations/20251222095824_fixMigration.Designer.cs create mode 100644 NotificationBot/Migrations/20251222095824_fixMigration.cs diff --git a/NotificationBot/Migrations/20251222095824_fixMigration.Designer.cs b/NotificationBot/Migrations/20251222095824_fixMigration.Designer.cs new file mode 100644 index 0000000..4a5f418 --- /dev/null +++ b/NotificationBot/Migrations/20251222095824_fixMigration.Designer.cs @@ -0,0 +1,209 @@ +// +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace NotificationsBot.Migrations +{ + [DbContext(typeof(AppContext))] + [Migration("20251222095824_fixMigration")] + partial class fixMigration + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("NotificationTypesProjects", b => + { + b.Property("NotificationTypesId") + .HasColumnType("integer"); + + b.Property("ProjectsId") + .HasColumnType("integer"); + + b.HasKey("NotificationTypesId", "ProjectsId"); + + b.HasIndex("ProjectsId"); + + b.ToTable("NotificationTypesProjects"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.NotificationTypes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("EventDescription") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventType") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("NotificationTypes"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.NotificationsOnProjectChat", b => + { + b.Property("UserId") + .HasColumnType("bigint") + .HasColumnName("ChatId"); + + b.Property("ProjectId") + .HasColumnType("integer"); + + b.Property("NotificationTypesId") + .HasColumnType("integer"); + + b.HasKey("UserId", "ProjectId", "NotificationTypesId"); + + b.HasIndex("NotificationTypesId"); + + b.HasIndex("ProjectId"); + + b.ToTable("NotificationsOnProjectChat"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.Projects", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Projects"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.Topic", b => + { + b.Property("Id") + .HasColumnType("integer"); + + b.Property("ChatId") + .HasColumnType("bigint"); + + b.Property("ProjectsId") + .HasColumnType("integer"); + + b.HasKey("Id", "ChatId"); + + b.HasIndex("ChatId"); + + b.HasIndex("ProjectsId"); + + b.ToTable("Topics"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.User", b => + { + b.Property("ChatId") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("ChatId")); + + b.Property("Login") + .HasColumnType("text"); + + b.Property("State") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("ChatId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("NotificationTypesProjects", b => + { + b.HasOne("NotificationsBot.Models.Database.NotificationTypes", null) + .WithMany() + .HasForeignKey("NotificationTypesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NotificationsBot.Models.Database.Projects", null) + .WithMany() + .HasForeignKey("ProjectsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.NotificationsOnProjectChat", b => + { + b.HasOne("NotificationsBot.Models.Database.NotificationTypes", "NotificationTypes") + .WithMany() + .HasForeignKey("NotificationTypesId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NotificationsBot.Models.Database.Projects", "Project") + .WithMany() + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NotificationsBot.Models.Database.User", "Users") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("NotificationTypes"); + + b.Navigation("Project"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.Topic", b => + { + b.HasOne("NotificationsBot.Models.Database.User", null) + .WithMany("Topics") + .HasForeignKey("ChatId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("NotificationsBot.Models.Database.Projects", null) + .WithMany("Topics") + .HasForeignKey("ProjectsId"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.Projects", b => + { + b.Navigation("Topics"); + }); + + modelBuilder.Entity("NotificationsBot.Models.Database.User", b => + { + b.Navigation("Topics"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/NotificationBot/Migrations/20251222095824_fixMigration.cs b/NotificationBot/Migrations/20251222095824_fixMigration.cs new file mode 100644 index 0000000..d603f8c --- /dev/null +++ b/NotificationBot/Migrations/20251222095824_fixMigration.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace NotificationsBot.Migrations +{ + /// + public partial class fixMigration : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("ALTER DATABASE \"BotDb\" REFRESH COLLATION VERSION"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/NotificationBot/Migrations/AppContextModelSnapshot.cs b/NotificationBot/Migrations/AppContextModelSnapshot.cs index 0b25e44..6b1a63c 100644 --- a/NotificationBot/Migrations/AppContextModelSnapshot.cs +++ b/NotificationBot/Migrations/AppContextModelSnapshot.cs @@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "9.0.1") + .HasAnnotation("ProductVersion", "9.0.11") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); From b857173b4ca4d18cb9fb9db00c36c6ca6db62616 Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Mon, 22 Dec 2025 14:45:28 +0300 Subject: [PATCH 3/5] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=BC=D0=B8?= =?UTF-8?q?=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NotificationBot/Migrations/20251222095824_fixMigration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NotificationBot/Migrations/20251222095824_fixMigration.cs b/NotificationBot/Migrations/20251222095824_fixMigration.cs index d603f8c..371e929 100644 --- a/NotificationBot/Migrations/20251222095824_fixMigration.cs +++ b/NotificationBot/Migrations/20251222095824_fixMigration.cs @@ -10,7 +10,7 @@ public partial class fixMigration : Migration /// protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.Sql("ALTER DATABASE \"BotDb\" REFRESH COLLATION VERSION"); + migrationBuilder.Sql(" DO $$\r\nDECLARE\r\n db_name text;\r\nBEGIN\r\n SELECT current_database() INTO db_name;\r\n EXECUTE format('ALTER DATABASE %I REFRESH COLLATION version', db_name);\r\nEND $$;"); } /// From 2205526b58d0784f6e816c2e2fc9a3e66dfbdccc Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Mon, 22 Dec 2025 15:00:30 +0300 Subject: [PATCH 4/5] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB?= =?UTF-8?q?=20unless-stopped?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose_cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose_cd.yml b/docker-compose_cd.yml index 36ad078..b704167 100644 --- a/docker-compose_cd.yml +++ b/docker-compose_cd.yml @@ -2,6 +2,7 @@ postgresql: container_name: notificationbot-postgres image: postgres:16 + restart: unless-stopped expose: - ${POSTGRES_EXPOSE_PORT} ports: From df1706bcc452ccab8e665bd051af2145ca4b0cd2 Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Mon, 22 Dec 2025 15:04:25 +0300 Subject: [PATCH 5/5] fix pipe --- docker-compose_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose_cd.yml b/docker-compose_cd.yml index b704167..0a40eaa 100644 --- a/docker-compose_cd.yml +++ b/docker-compose_cd.yml @@ -1,7 +1,7 @@ services: postgresql: container_name: notificationbot-postgres - image: postgres:16 + image: postgres:16.11 restart: unless-stopped expose: - ${POSTGRES_EXPOSE_PORT}