前后端更新

This commit is contained in:
super committed 2026-03-04 22:55:36 +08:00
1 parent a0c8721fbb
commit 24da604727
33 files changed
+1951 -580

No files matched your search

@@ -0,0 +1,36 @@
"""Add Announcement table
Revision ID: 1a79b14cffa5
Revises: cae76a195dec
Create Date: 2026-03-04 09:42:16.200197
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1a79b14cffa5'
down_revision = 'cae76a195dec'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('announcements',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('title', sa.String(length=200), nullable=False),
sa.Column('content', sa.Text(), nullable=False),
sa.Column('is_active', sa.Boolean(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('updated_at', sa.DateTime(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('announcements')
# ### end Alembic commands ###
@@ -0,0 +1,34 @@
"""add reset_token fields
Revision ID: cae76a195dec
Revises: 439e501ac52b
Create Date: 2026-03-04 09:16:59.253441
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'cae76a195dec'
down_revision = '439e501ac52b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('reset_token', sa.String(length=100), nullable=True))
batch_op.add_column(sa.Column('reset_token_expiry', sa.DateTime(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('reset_token_expiry')
batch_op.drop_column('reset_token')
# ### end Alembic commands ###