Skip to content

🐛 修复 postgresql 标识符大于63字符的错误 #545

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

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 ✅

🚀 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
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