Skip to content

Commit

Permalink
🚸 fix(alembic): better check diff output
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgramRipper committed Jun 28, 2024
1 parent f0c8864 commit 07f6eb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions nonebot_plugin_orm/exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from alembic import util
from click import ClickException


class CommandError(ClickException, util.CommandError):
pass


class AutogenerateDiffsDetected(CommandError, util.AutogenerateDiffsDetected):
pass
2 changes: 1 addition & 1 deletion nonebot_plugin_orm/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from sqlalchemy import MetaData, Connection
from alembic.util.editor import open_in_editor
from alembic.script import Script, ScriptDirectory
from alembic.util import AutogenerateDiffsDetected
from alembic.util.langhelpers import rev_id as _rev_id
from alembic.operations.ops import UpgradeOps, DowngradeOps
from alembic.migration import StampStep, RevisionStep, MigrationContext
Expand All @@ -34,6 +33,7 @@
render_python_code,
)

from .exception import AutogenerateDiffsDetected
from .utils import is_editable, get_parent_plugins, return_progressbar

if sys.version_info >= (3, 11):
Expand Down

0 comments on commit 07f6eb4

Please sign in to comment.