add is_main to Move

This commit is contained in:
Sorrel Bri 2019-10-02 14:50:56 -07:00
parent e3d47844be
commit 9ce70cff4a
2 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,28 @@
"""empty message
Revision ID: 16c70b11242e
Revises: 9519d28f13f0
Create Date: 2019-10-02 14:50:27.180692
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '16c70b11242e'
down_revision = '9519d28f13f0'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('moves', sa.Column('is_main', sa.Boolean(), nullable=False))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('moves', 'is_main')
# ### end Alembic commands ###

View file

@ -14,6 +14,7 @@ class Move(db.Model):
x_point = db.Column(db.Integer) x_point = db.Column(db.Integer)
y_point = db.Column(db.Integer) y_point = db.Column(db.Integer)
move_number = db.Column(db.Integer) move_number = db.Column(db.Integer)
is_main = db.Column(db.Boolean(), nullable=False, default=True)
# foreign keys # foreign keys
game = db.Column(db.Integer, db.ForeignKey("games.id"), nullable=False) game = db.Column(db.Integer, db.ForeignKey("games.id"), nullable=False)