Skip to content

fix: add SearchCacheDbContext EF migrations#273

Merged
ModerRAS merged 1 commit intomasterfrom
fix/search-cache-migrations
Apr 21, 2026
Merged

fix: add SearchCacheDbContext EF migrations#273
ModerRAS merged 1 commit intomasterfrom
fix/search-cache-migrations

Conversation

@ModerRAS
Copy link
Copy Markdown
Owner

Summary

  • add a design-time factory for SearchCacheDbContext`n- generate dedicated EF Core migration files for the separate SearchCache.sqlite database
  • switch startup initialization from EnsureCreatedAsync to MigrateAsync for the search cache database

Why

SearchCacheDbContext was merged without EF Core migration files, so the new cache database was being created outside the repository's normal migration workflow. This PR makes the separate cache database consistent with the rest of the project and keeps its schema under version control.

Validation

  • dotnet build TelegramSearchBot.sln -c Release
  • dotnet test TelegramSearchBot.sln -c Release --no-build
  • dotnet ef migrations list --context SearchCacheDbContext --project TelegramSearchBot.Database --startup-project TelegramSearchBot

Add design-time factory and generated EF Core migrations for SearchCacheDbContext, and switch startup initialization from EnsureCreatedAsync to MigrateAsync so SearchCache.sqlite follows the project's standard migration workflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 21, 2026

Warning

Rate limit exceeded

@ModerRAS has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 34 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 34 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 346613d7-95ec-4aed-a907-987ce109c340

📥 Commits

Reviewing files that changed from the base of the PR and between 72eecc5 and a1d1e5d.

📒 Files selected for processing (5)
  • TelegramSearchBot.Database/Migrations/SearchCache/20260421120404_InitSearchCacheDatabase.Designer.cs
  • TelegramSearchBot.Database/Migrations/SearchCache/20260421120404_InitSearchCacheDatabase.cs
  • TelegramSearchBot.Database/Migrations/SearchCache/SearchCacheDbContextModelSnapshot.cs
  • TelegramSearchBot.Database/Model/SearchCacheDbContextFactory.cs
  • TelegramSearchBot/AppBootstrap/GeneralBootstrap.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/search-cache-migrations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 PR检查报告

📋 检查概览

🧪 测试结果

平台 状态 详情
Ubuntu 🔴 失败 测试结果不可用
Windows 🔴 失败 测试结果不可用

📊 代码质量

  • ✅ 代码格式化检查
  • ✅ 安全漏洞扫描
  • ✅ 依赖包分析
  • ✅ 代码覆盖率收集

📁 测试产物

  • 测试结果文件已上传为artifacts
  • 代码覆盖率已上传到Codecov

🔗 相关链接


此报告由GitHub Actions自动生成

@ModerRAS ModerRAS merged commit 4659075 into master Apr 21, 2026
5 checks passed
@ModerRAS ModerRAS deleted the fix/search-cache-migrations branch April 21, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant