Files
pear-admin-flask/migrations/versions/ec7c5d1aab2e_add_site_about_table.py
T

40 lines
1.6 KiB
Python

"""add site_about table
Revision ID: ec7c5d1aab2e
Revises: 38751d88d42c
Create Date: 2026-09-05 17:50:00.000000
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'ec7c5d1aab2e'
down_revision = '38751d88d42c'
branch_labels = None
depends_on = None
def upgrade():
op.create_table(
'site_about',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False, comment='主键'),
sa.Column('site_name', sa.String(length=120), nullable=True, comment='站点名'),
sa.Column('content_md', sa.Text(), nullable=True, comment='关于本站正文 (Markdown)'),
sa.Column('icp', sa.String(length=120), nullable=True, comment='ICP 备案号'),
sa.Column('contact_email', sa.String(length=120), nullable=True, comment='联系邮箱'),
sa.Column('contact_qq', sa.String(length=32), nullable=True, comment='联系 QQ'),
sa.Column('contact_wechat', sa.String(length=120), nullable=True, comment='微信号'),
sa.Column('contact_telegram', sa.String(length=120), nullable=True, comment='Telegram'),
sa.Column('contact_github', sa.String(length=255), nullable=True, comment='GitHub 链接'),
sa.Column('donate_url', sa.String(length=255), nullable=True, comment='捐赠/打赏 URL 或二维码图片地址'),
sa.Column('create_at', sa.DateTime(), nullable=True, comment='创建时间'),
sa.Column('update_at', sa.DateTime(), nullable=True, comment='更新时间'),
sa.PrimaryKeyConstraint('id'),
)
def downgrade():
op.drop_table('site_about')