From f64600c174304089acb7265bc1df99b59394d3f2 Mon Sep 17 00:00:00 2001 From: Fantasy lee <129943055+Fantasylee21@users.noreply.github.com> Date: Tue, 29 Apr 2025 17:35:50 +0800 Subject: [PATCH] =?UTF-8?q?[chore]:=20=E8=B0=83=E6=95=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E4=BD=9C=E8=80=85=E5=90=8D=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...40\344\275\234\350\200\205\345\220\215.py" | 38 +++++++++++++++++++ app/models/model.py | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 "alembic/versions/a434b17f5caf_\345\242\236\345\212\240\344\275\234\350\200\205\345\220\215.py" diff --git "a/alembic/versions/a434b17f5caf_\345\242\236\345\212\240\344\275\234\350\200\205\345\220\215.py" "b/alembic/versions/a434b17f5caf_\345\242\236\345\212\240\344\275\234\350\200\205\345\220\215.py" new file mode 100644 index 0000000..6081c9f --- /dev/null +++ "b/alembic/versions/a434b17f5caf_\345\242\236\345\212\240\344\275\234\350\200\205\345\220\215.py" @@ -0,0 +1,38 @@ +"""增加作者名 + +Revision ID: a434b17f5caf +Revises: 4b9d22943860 +Create Date: 2025-04-29 17:34:19.895192 + +""" +from typing import Sequence, Union + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import mysql + +# revision identifiers, used by Alembic. +revision: str = 'a434b17f5caf' +down_revision: Union[str, None] = '4b9d22943860' +branch_labels: Union[str, Sequence[str], None] = None +depends_on: Union[str, Sequence[str], None] = None + + +def upgrade() -> None: + """Upgrade schema.""" + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('articleDB', 'author', + existing_type=mysql.VARCHAR(length=100), + type_=sa.String(length=300), + existing_nullable=False) + # ### end Alembic commands ### + + +def downgrade() -> None: + """Downgrade schema.""" + # ### commands auto generated by Alembic - please adjust! ### + op.alter_column('articleDB', 'author', + existing_type=sa.String(length=300), + type_=mysql.VARCHAR(length=100), + existing_nullable=False) + # ### end Alembic commands ### diff --git a/app/models/model.py b/app/models/model.py index 6a5a7c2..1e0f357 100644 --- a/app/models/model.py +++ b/app/models/model.py @@ -115,7 +115,7 @@ class ArticleDB(Base): title = Column(String(200), nullable=False) url = Column(String(200), nullable=False) - author = Column(String(100), nullable=False) + author = Column(String(300), nullable=False) file_path = Column(String(200), nullable=False) create_time = Column(DateTime, default=func.now(), nullable=False) # 创建时间