🐛 修复 postgresql 标识符大于63字符的错误#545
Merged
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues with PostgreSQL identifiers exceeding 63 characters by updating dependency versions and refactoring migration scripts to use shorter, consistent naming and SQLAlchemy types. Key changes include:
- Adding the nonebot-plugin-orm dependency with PostgreSQL support.
- Refactoring migration scripts to replace sa.VARCHAR/INTEGER/DATETIME with their sa.String/Integer/DateTime counterparts and handling potential IdentifierError exceptions.
- Updating index names and column types (including switching from BLOB to PickleType for certain columns) to conform to identifier length limitations.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Add dependency for nonebot-plugin-orm with PostgreSQL support. |
| .../f5b4a6d1325b_tetr_io_new_season.py | Introduce IdentifierError handling for dropping indexes in tetriohistoricaldata. |
| .../cfeab6961dce_extend_api_type_field_length.py | Update SQLAlchemy type usage and include an interactive prompt in the downgrade. |
| .../b7fbdafc339a_add_user_unique_identifier_field_to_.py | Update SQLAlchemy type from VARCHAR to String for user_unique_identifier. |
| .../b15844837693_migrate_to_nonobot_plugin_user.py | Update SQLAlchemy types for consistency in the bind table migration. |
| .../9f6582279ce2_recreate_historical_data.py | Migrate column types and switch from BLOB to PickleType for storing pickled data. |
| .../3c25a5a8c050_refactor_historical.py | Refactor historical data migration with IdentifierError exception handling and updated types. |
Comments suppressed due to low confidence (1)
nonebot_plugin_tetris_stats/config/migrations/cfeab6961dce_extend_api_type_field_length.py:44
- Using an interactive input prompt in a migration downgrade can cause issues in automated deployment environments. Consider removing the prompt or using a non-interactive confirmation mechanism.
input('如果确认可以迁移, 请按回车键继续!')
c1a567f to
3e15f42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #482