text-matcher/src/Nocr.TextMatcher.Migrator
ruberoid 78d1099bfc Add message deduplication and versioning for text match notifications
This update implements a comprehensive solution to prevent duplicate notifications
when Telegram messages are edited, while maintaining a full history of changes.

Features:
- New TextMatch entity to store match history with versioning
- Database migration for TextMatches table with proper indexes
- TextMatchRepository for managing match records
- TextSubscriptionUpdated event for message update notifications
- Enhanced MessageReceivedHandler with deduplication logic:
  * First match creates version 1 and publishes TextSubscriptionMatched
  * Subsequent updates create new versions and publish TextSubscriptionUpdated
  * Skips notifications if message text hasn't changed

Technical details:
- MessageId changed from int to long to match Telegram API types
- Proper indexes on (MessageId, SubscriptionId) and UserId
- Full audit trail of message edits in database

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 13:22:58 +04:00
..
Migrations Add message deduplication and versioning for text match notifications 2025-10-14 13:22:58 +04:00
AddMigration.sh Fix scripts 2024-03-30 11:39:58 +03:00
appsettings.json Fixed config usages. 2025-07-18 17:11:55 +03:00
DesignTimeTextMatcherContextFactory.cs fixed migrator optional secret protected file appsettings. 2025-07-19 15:16:07 +03:00
Dockerfile removed nuget priority restore warnings. 2025-07-21 17:46:31 +03:00
Nocr.TextMatcher.Migrator.csproj added healthcheks. 2025-07-21 13:48:47 +03:00
Program.cs Add Nocr.TextMatcher.Migrator 2024-03-30 11:31:23 +03:00
Readme.md Add Nocr.TextMatcher.Migrator 2024-03-30 11:31:23 +03:00

Nocr.TextMatcher.Migrator

Проект содержит консольное приложение для применения миграций к БД.
Для выбора строки подключения при запуске необходимо передать переменную окружения DOTNET_ENVIRONMENT. Для локальной разработки следует использовать DOTNET_ENVIRONMENT=Development.

Добавление миграций

В приложении реализована логика выбора строки подключения, а dotnet ef не позволяет передать переменную окружения. Поэтому был создан скрипт AddMigration, который устанавливает значение DOTNET_ENVIRONMENT=Development.

Пример использования: ./AddMigration MyMigration