Skip to content

RE1-T121 Migrations fix#400

Merged
ucswift merged 1 commit into
masterfrom
develop
Jun 5, 2026
Merged

RE1-T121 Migrations fix#400
ucswift merged 1 commit into
masterfrom
develop

Conversation

@ucswift

@ucswift ucswift commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores
    • Database schema updates completed to support enhanced weather alert source tracking and management capabilities.

@request-info

request-info Bot commented Jun 5, 2026

Copy link
Copy Markdown

Thanks for opening this, but we'd appreciate a little more information. Could you update it with more details?

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Too many files changed? Review this PR in Change Stack to see how the pieces fit before you dive in.

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request renumbers two database migrations from ID 68 to 74. Both the SQL Server and PostgreSQL implementations of the AddIsPermanentFailure migration for WeatherAlertSources are updated: class names change from M0068_... to M0074_... and the [Migration] attribute values change accordingly. The migration logic remains unchanged.

Changes

Migration ID Update

Layer / File(s) Summary
Renumber weather alert sources migrations from 68 to 74
Providers/Resgrid.Providers.Migrations/Migrations/M0074_AddIsPermanentFailureToWeatherAlertSources.cs, Providers/Resgrid.Providers.MigrationsPg/Migrations/M0074_AddIsPermanentFailureToWeatherAlertSourcesPg.cs
Both SQL Server and PostgreSQL migration classes are renamed from M0068_AddIsPermanentFailureToWeatherAlertSources(Pg) to M0074_AddIsPermanentFailureToWeatherAlertSources(Pg) with corresponding [Migration(68)][Migration(74)] attribute updates. The Up and Down migration logic remains unchanged.

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'RE1-T121 Migrations fix' is related to the changeset but lacks specificity about what was actually fixed in the migrations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@Providers/Resgrid.Providers.Migrations/Migrations/M0074_AddIsPermanentFailureToWeatherAlertSources.cs`:
- Around line 5-6: The migration ID was changed to [Migration(74)] in class
M0074_AddIsPermanentFailureToWeatherAlertSources but M0068_ChatbotTables already
uses 68, so you must reconcile VersionInfo history: check the VersionInfo
table/records in both SQL Server and Postgres for entries 68 and 74, and either
update any existing VersionInfo rows that incorrectly point to 68 to 74 or
apply/run the missing migration(s) so both the
WeatherAlertSources.IsPermanentFailure change (the column added/removed by
M0074_AddIsPermanentFailureToWeatherAlertSources) and the chatbot tables
migration (M0068_ChatbotTables) are present; ensure the final VersionInfo
contains the correct sequence numbers, and if you choose to update VersionInfo
rows perform the update atomically with a backup and document the change so
FluentMigrator’s history matches the actual schema.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c4d4db67-ef1c-479a-af14-5a3f6f6ca9fd

📥 Commits

Reviewing files that changed from the base of the PR and between 410095d and abcfac1.

📒 Files selected for processing (2)
  • Providers/Resgrid.Providers.Migrations/Migrations/M0074_AddIsPermanentFailureToWeatherAlertSources.cs
  • Providers/Resgrid.Providers.MigrationsPg/Migrations/M0074_AddIsPermanentFailureToWeatherAlertSourcesPg.cs

Comment on lines +5 to +6
[Migration(74)]
public class M0074_AddIsPermanentFailureToWeatherAlertSources : Migration

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check for migration ID conflicts and verify the numbering sequence

echo "=== Checking for migration ID 68 in both migration providers ==="
rg -n "Migration\(68\)" --type cs

echo ""
echo "=== Checking for migrations 69-73 to understand the numbering gap ==="
for id in 69 70 71 72 73; do
  echo "--- Migration $id ---"
  rg -n "Migration\($id\)" --type cs
done

echo ""
echo "=== Listing all migration files to verify sequence ==="
fd -e cs -p "M[0-9]{4}_.*\.cs" Providers/Resgrid.Providers.Migrations/ Providers/Resgrid.Providers.MigrationsPg/ | sort

Repository: Resgrid/Core

Length of output: 14165


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Find where IsPermanentFailure is introduced/removed ==="
rg -n "IsPermanentFailure" --type cs Providers/Resgrid.Providers.Migrations/ Providers/Resgrid.Providers.MigrationsPg/ || true

echo
echo "=== Check Up/Down content for the reviewed migration ==="
sed -n '1,220p' Providers/Resgrid.Providers.Migrations/Migrations/M0074_AddIsPermanentFailureToWeatherAlertSources.cs

Repository: Resgrid/Core

Length of output: 1358


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Migrations touching WeatherAlertSources ==="
rg -n "WeatherAlertSources" --type cs Providers/Resgrid.Providers.Migrations/ Providers/Resgrid.Providers.MigrationsPg/ || true

echo
echo "=== Migrations touching IsPermanentFailure (sanity check) ==="
rg -n "IsPermanentFailure" --type cs Providers/Resgrid.Providers.Migrations/ Providers/Resgrid.Providers.MigrationsPg/ || true

Repository: Resgrid/Core

Length of output: 3110


Handle FluentMigrator VersionInfo history when changing this migration ID (68 → 74).

This migration now uses [Migration(74)] and is the only place that adds/removes WeatherAlertSources.IsPermanentFailure. However, [Migration(68)] is already used in the codebase by M0068_ChatbotTables(.cs/.Pg.cs).

If any environment already has VersionInfo showing 68 for the old version of this migration, it will not execute the new 74, and it may also skip the current migration logic for 68 (chatbot tables), leaving schema/history inconsistent.

Please verify (for both SQL Server and Postgres DBs) what VersionInfo records for versions 68 and 74, and apply a consistent repair plan (e.g., update VersionInfo from 68 → 74 where appropriate, or run missing migrations) so both the IsPermanentFailure change and the chatbot tables change are applied correctly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@Providers/Resgrid.Providers.Migrations/Migrations/M0074_AddIsPermanentFailureToWeatherAlertSources.cs`
around lines 5 - 6, The migration ID was changed to [Migration(74)] in class
M0074_AddIsPermanentFailureToWeatherAlertSources but M0068_ChatbotTables already
uses 68, so you must reconcile VersionInfo history: check the VersionInfo
table/records in both SQL Server and Postgres for entries 68 and 74, and either
update any existing VersionInfo rows that incorrectly point to 68 to 74 or
apply/run the missing migration(s) so both the
WeatherAlertSources.IsPermanentFailure change (the column added/removed by
M0074_AddIsPermanentFailureToWeatherAlertSources) and the chatbot tables
migration (M0068_ChatbotTables) are present; ensure the final VersionInfo
contains the correct sequence numbers, and if you choose to update VersionInfo
rows perform the update atomically with a backup and document the change so
FluentMigrator’s history matches the actual schema.

@ucswift

ucswift commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

Approve

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is approved.

@ucswift ucswift merged commit d7a7e6b into master Jun 5, 2026
18 of 19 checks passed
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