Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions alembic/versions/a434b17f5caf_增加作者名.py
Original file line number Diff line number Diff line change
@@ -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 ###
2 changes: 1 addition & 1 deletion app/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) # 创建时间
Expand Down