mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-17 22:14:25 +01:00
Hints (#232)
* Switching to Flask-Migrate to create tables/database. Adding Hints & Unlocks. * Adding db.create_all call for sqlite db's (sqlite is not properly handled with alembic yet) * Python 3 testing works properly with 3.5 * Adding admin side of hints * Hints are viewable for users
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
"""Adding Hints and Unlocks tables
|
||||
|
||||
Revision ID: c7225db614c1
|
||||
Revises: d6514ec92738
|
||||
Create Date: 2017-03-23 01:31:43.940187
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'c7225db614c1'
|
||||
down_revision = 'd6514ec92738'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('hints',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('type', sa.Integer(), nullable=True),
|
||||
sa.Column('chal', sa.Integer(), nullable=True),
|
||||
sa.Column('hint', sa.Text(), nullable=True),
|
||||
sa.Column('cost', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['chal'], ['challenges.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('unlocks',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('teamid', sa.Integer(), nullable=True),
|
||||
sa.Column('date', sa.DateTime(), nullable=True),
|
||||
sa.Column('itemid', sa.Integer(), nullable=True),
|
||||
sa.Column('model', sa.String(length=32), nullable=True),
|
||||
sa.ForeignKeyConstraint(['teamid'], ['teams.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('unlocks')
|
||||
op.drop_table('hints')
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user