feat: 添加飞书用户模块和订阅功能支持 - 新增feishu_users模块用于处理飞书用户身份验证和权限管理 - 新增subscriptions模块用于处理订阅相关功能 - 新增personalization模块用于个性化服务 - 在alembic迁移配置中注册新的模型模块 - 在API路由器中添加feishu_users和subscriptions路由 - 实现事件调度服务的改进,包括错误处理和状态更新优化 - 添加飞书命令处理的权限检查机制 - 实现飞书应用票据事件处理 - 改进审计日志记录功能 ```
42 lines
1.1 KiB
Python
42 lines
1.1 KiB
Python
"""Prevent erased initial administrators from being bootstrapped again.
|
|
|
|
Revision ID: 202607260005
|
|
Revises: 202607260004
|
|
Create Date: 2026-07-27
|
|
"""
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
revision = "202607260005"
|
|
down_revision = "202607260004"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.create_table(
|
|
"feishu_admin_bootstrap_tombstones",
|
|
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
|
|
sa.Column("identity_hash", sa.String(length=64), nullable=False),
|
|
sa.Column("created_at", sa.DateTime(), nullable=False),
|
|
sa.PrimaryKeyConstraint("id"),
|
|
)
|
|
op.create_index(
|
|
op.f("ix_feishu_admin_bootstrap_tombstones_created_at"),
|
|
"feishu_admin_bootstrap_tombstones",
|
|
["created_at"],
|
|
unique=False,
|
|
)
|
|
op.create_index(
|
|
op.f("ix_feishu_admin_bootstrap_tombstones_identity_hash"),
|
|
"feishu_admin_bootstrap_tombstones",
|
|
["identity_hash"],
|
|
unique=True,
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_table("feishu_admin_bootstrap_tombstones")
|