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
8 changed files
with
141 additions
and
537 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
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,52 @@ | ||
"""empty message | ||
迁移 ID: 87c3a8ac9bf5 | ||
父迁移: | ||
创建时间: 2024-08-01 09:44:19.285320 | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from collections.abc import Sequence | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
revision: str = "87c3a8ac9bf5" | ||
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.String(), nullable=False)) | ||
batch_op.alter_column( | ||
"access_token", | ||
existing_type=sa.INTEGER(), | ||
type_=sa.String(), | ||
nullable=False, | ||
) | ||
batch_op.drop_column("user_id") | ||
batch_op.drop_column("platform") | ||
|
||
# ### 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("platform", sa.INTEGER(), nullable=True)) | ||
batch_op.add_column(sa.Column("user_id", sa.INTEGER(), nullable=True)) | ||
batch_op.alter_column( | ||
"access_token", existing_type=sa.String(), type_=sa.INTEGER(), nullable=True | ||
) | ||
batch_op.drop_column("id") | ||
|
||
# ### end Alembic commands ### |
Empty file.
43 changes: 43 additions & 0 deletions
43
nonebot_plugin_wakatime/migrations/cf6ccefd1d7a_remove_platform_and_rename_user_id_to_id.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 @@ | ||
"""remove platform and rename user_id to id | ||
迁移 ID: cf6ccefd1d7a | ||
父迁移: | ||
创建时间: 2024-08-01 08:58:54.835575 | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from collections.abc import Sequence | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
revision: str = "cf6ccefd1d7a" | ||
down_revision: str | Sequence[str] | None = None | ||
branch_labels: str | Sequence[str] | None = ("wakatime",) | ||
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.String(), nullable=False)) | ||
batch_op.drop_column("user_id") | ||
batch_op.drop_column("platform") | ||
|
||
# ### 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("platform", sa.VARCHAR(), nullable=False)) | ||
batch_op.add_column(sa.Column("user_id", sa.VARCHAR(), nullable=False)) | ||
batch_op.drop_column("id") | ||
|
||
# ### 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
Oops, something went wrong.