generated from KomoriDev/python-pdm-template
-
Notifications
You must be signed in to change notification settings - Fork 3
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
5 changed files
with
65 additions
and
22 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
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
43 changes: 43 additions & 0 deletions
43
nonebot_plugin_wakatime/migrations/263d60026863_adapt_user_plugin.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,43 @@ | ||
"""adapt user plugin | ||
迁移 ID: 263d60026863 | ||
父迁移: | ||
创建时间: 2024-08-01 22:42:18.427022 | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from collections.abc import Sequence | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
revision: str = "263d60026863" | ||
down_revision: str | Sequence[str] | None = None | ||
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("wakatime", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("id", sa.Integer(), nullable=False)) | ||
batch_op.drop_column("platform") | ||
batch_op.drop_column("user_id") | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(name: str = "") -> None: | ||
if name: | ||
return | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
with op.batch_alter_table("wakatime", schema=None) as batch_op: | ||
batch_op.add_column(sa.Column("user_id", sa.VARCHAR(), nullable=False)) | ||
batch_op.add_column(sa.Column("platform", sa.VARCHAR(), nullable=False)) | ||
batch_op.drop_column("id") | ||
|
||
# ### end Alembic commands ### |
Empty file.
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