-
-
Notifications
You must be signed in to change notification settings - Fork 775
fix: god account type 5->6 in schema.sql and add migration #3806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds a migration and updates seed data: Changes
Sequence Diagram(s)sequenceDiagram
participant Migrator
participant Logger
participant Database
Migrator->>Logger: log("Starting DB update: 54")
Migrator->>Database: execute("UPDATE accounts SET type=6 WHERE type=5")
Database-->>Migrator: result (success / affected rows / error)
Migrator->>Logger: if error -> log("Migration 54 failed: ...")
Migrator->>Logger: else -> log("Migration 54 completed")
Migrator-->>Migrator: return boolean success
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@data-otservbr-global/migrations/54.lua`:
- Around line 1-12: The migration's UPDATE in onUpdateDatabase is targeting type
= 5 (ACCOUNT_TYPE_COMMUNITYMANAGER) but the intent was to change god accounts —
inspect src/enums/account_type.hpp to confirm the numeric value for
ACCOUNT_TYPE_GOD and either (a) change the WHERE clause in the UPDATE accounts
SET type = 6 WHERE type = 5; to use the correct source value for god (e.g. WHERE
type = <ACCOUNT_TYPE_GOD>) or (b) if the intent was to upgrade community
managers to god then update the migration comment to reflect that and leave the
query, or better yet change the target value to the correct enum constant;
update the SQL query in onUpdateDatabase (and the logger message) to match the
chosen correct mapping and add a safety check/backup step before running
destructive changes.
|
LGTM |



Description
god account has wrong account type in schema, this PR fixes that
Type of change
How Has This Been Tested
Checklist
Summary by CodeRabbit
Note: No user-facing changes in this release.
✏️ Tip: You can customize this high-level summary in your review settings.