mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-06 20:06:12 +08:00
* ⬆️ auto update by pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.9) - [github.com/pycqa/isort: 5.12.0 → 5.13.2](https://github.com/pycqa/isort/compare/5.12.0...5.13.2) - [github.com/psf/black: 23.9.1 → 23.12.1](https://github.com/psf/black/compare/23.9.1...23.12.1) - [github.com/pre-commit/mirrors-prettier: v3.0.3 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.0.3...v4.0.0-alpha.8) - [github.com/pre-commit/mirrors-eslint: v8.50.0 → v9.0.0-alpha.0](https://github.com/pre-commit/mirrors-eslint/compare/v8.50.0...v9.0.0-alpha.0) * 💄 auto fix by pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
"""add user_target
|
|
|
|
Revision ID: 632b8086bc2b
|
|
Revises: aceef470d69c
|
|
Create Date: 2023-03-20 00:39:30.199915
|
|
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
from sqlalchemy.dialects.postgresql import JSONB
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "632b8086bc2b"
|
|
down_revision = "aceef470d69c"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("nonebot_bison_user", schema=None) as batch_op:
|
|
batch_op.drop_constraint("unique-user-constraint", type_="unique")
|
|
batch_op.add_column(
|
|
sa.Column(
|
|
"user_target",
|
|
sa.JSON().with_variant(JSONB, "postgresql"),
|
|
nullable=True,
|
|
)
|
|
)
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("nonebot_bison_user", schema=None) as batch_op:
|
|
batch_op.drop_column("user_target")
|
|
batch_op.create_unique_constraint("unique-user-constraint", ["type", "uid"])
|
|
|
|
# ### end Alembic commands ###
|