mirror of
https://github.com/suyiiyii/nonebot-bison.git
synced 2025-06-05 19:36:43 +08:00
* 🎨 修改 nonebot_bison 目录位置 * auto fix by pre-commit hooks * 🚚 fix frontend build target * 🚚 use soft link * Revert "🚚 use soft link" This reverts commit de21f79d5ae1bd5515b04f42a4138cb25ddf3e62. * 🚚 modify dockerfile --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: felinae98 <731499577@qq.com>
48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
"""add constraint
|
|
|
|
Revision ID: c97c445e2bdb
|
|
Revises: 0571870f5222
|
|
Create Date: 2022-03-26 19:46:50.910721
|
|
|
|
"""
|
|
import sqlalchemy as sa
|
|
from alembic import op
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "c97c445e2bdb"
|
|
down_revision = "0571870f5222"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("subscribe", schema=None) as batch_op:
|
|
batch_op.create_unique_constraint(
|
|
"unique-subscribe-constraint", ["target_id", "user_id"]
|
|
)
|
|
|
|
with op.batch_alter_table("target", schema=None) as batch_op:
|
|
batch_op.create_unique_constraint(
|
|
"unique-target-constraint", ["target", "platform_name"]
|
|
)
|
|
|
|
with op.batch_alter_table("user", schema=None) as batch_op:
|
|
batch_op.create_unique_constraint("unique-user-constraint", ["type", "uid"])
|
|
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
with op.batch_alter_table("user", schema=None) as batch_op:
|
|
batch_op.drop_constraint("unique-user-constraint", type_="unique")
|
|
|
|
with op.batch_alter_table("target", schema=None) as batch_op:
|
|
batch_op.drop_constraint("unique-target-constraint", type_="unique")
|
|
|
|
with op.batch_alter_table("subscribe", schema=None) as batch_op:
|
|
batch_op.drop_constraint("unique-subscribe-constraint", type_="unique")
|
|
|
|
# ### end Alembic commands ###
|