Skip to content

Conversation

shoucandanghehe
Copy link
Member

@shoucandanghehe shoucandanghehe commented Jun 3, 2025

close #482

@shoucandanghehe shoucandanghehe added the bug Something isn't working label Jun 3, 2025
Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
nonebot_plugin_tetris_stats/db/models.py 66.10% <100.00%> (+1.18%) ⬆️
...bot_plugin_tetris_stats/games/tetrio/api/models.py 100.00% <100.00%> (ø)
nonebot_plugin_tetris_stats/games/tetrio/models.py 100.00% <100.00%> (ø)
...onebot_plugin_tetris_stats/games/top/api/models.py 100.00% <100.00%> (ø)
...onebot_plugin_tetris_stats/games/tos/api/models.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shoucandanghehe shoucandanghehe requested a review from Copilot June 3, 2025 18:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

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('如果确认可以迁移, 请按回车键继续!')

@shoucandanghehe shoucandanghehe marked this pull request as draft June 7, 2025 11:32
@shoucandanghehe shoucandanghehe requested a review from Copilot July 17, 2025 21:03
@shoucandanghehe shoucandanghehe marked this pull request as ready for review July 17, 2025 21:03
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@shoucandanghehe shoucandanghehe merged commit 9916902 into main Jul 17, 2025
15 checks passed
@shoucandanghehe shoucandanghehe deleted the fix/pgsql branch July 17, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 使用postgresql时,会出现标识符大于63字符的错误
1 participant