-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
53 changes: 53 additions & 0 deletions
53
nonebot_plugin_chatrecorder/migrations/0f0a7bc40f3c_message_id_length.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
"""message_id_length | ||
迁移 ID: 0f0a7bc40f3c | ||
父迁移: 46327b837dd8 | ||
创建时间: 2024-10-11 23:36:23.677012 | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from collections.abc import Sequence | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
revision: str = "0f0a7bc40f3c" | ||
down_revision: str | Sequence[str] | None = "46327b837dd8" | ||
branch_labels: str | Sequence[str] | None = None | ||
depends_on: str | Sequence[str] | None = None | ||
|
||
|
||
def upgrade(name: str = "") -> None: | ||
if name: | ||
return | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table( | ||
"nonebot_plugin_chatrecorder_messagerecord", schema=None | ||
) as batch_op: | ||
batch_op.alter_column( | ||
"message_id", | ||
existing_type=sa.String(length=64), | ||
type_=sa.String(length=255), | ||
existing_nullable=False, | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(name: str = "") -> None: | ||
if name: | ||
return | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table( | ||
"nonebot_plugin_chatrecorder_messagerecord", schema=None | ||
) as batch_op: | ||
batch_op.alter_column( | ||
"message_id", | ||
existing_type=sa.String(length=255), | ||
type_=sa.String(length=64), | ||
existing_nullable=False, | ||
) | ||
|
||
# ### end Alembic commands ### |
This file contains 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