mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 14:34:21 +01:00
* add: use ruff instead of flake8 * Update ruff switches and remove flake8 plugins * fix: ignore linting rules * fix: ignore I001 * fix: spaces before noqa --------- Co-authored-by: Kevin Chung <kchung@ctfd.io>
33 lines
873 B
Python
33 lines
873 B
Python
"""Add next_id to Challenges table
|
|
|
|
Revision ID: 4d3c1b59d011
|
|
Revises: 6012fe8de495
|
|
Create Date: 2022-04-07 03:53:27.554190
|
|
|
|
"""
|
|
from alembic import op # noqa: I001
|
|
import sqlalchemy as sa
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "4d3c1b59d011"
|
|
down_revision = "6012fe8de495"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.add_column("challenges", sa.Column("next_id", sa.Integer(), nullable=True))
|
|
op.create_foreign_key(
|
|
None, "challenges", "challenges", ["next_id"], ["id"], ondelete="SET NULL"
|
|
)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_constraint(None, "challenges", type_="foreignkey")
|
|
op.drop_column("challenges", "next_id")
|
|
# ### end Alembic commands ###
|