update db with setup boolean
This commit is contained in:
parent
ba44711328
commit
bf68ca1bbe
2 changed files with 33 additions and 0 deletions
32
data/forest/migrations/versions/c91b20e3d138_.py
Normal file
32
data/forest/migrations/versions/c91b20e3d138_.py
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
"""empty message
|
||||||
|
|
||||||
|
Revision ID: c91b20e3d138
|
||||||
|
Revises:
|
||||||
|
Create Date: 2024-04-08 15:29:03.170183
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'c91b20e3d138'
|
||||||
|
down_revision = None
|
||||||
|
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('setup', sa.Boolean(), 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('setup')
|
||||||
|
|
||||||
|
# ### end Alembic commands ###
|
|
@ -61,6 +61,7 @@ class User(db.Model, UserMixin):
|
||||||
email = db.Column(db.String(128), unique=True, nullable=False)
|
email = db.Column(db.String(128), unique=True, nullable=False)
|
||||||
active = db.Column(db.Boolean(), default=True, nullable=False)
|
active = db.Column(db.Boolean(), default=True, nullable=False)
|
||||||
confirmed = db.Column(db.Boolean, default=False)
|
confirmed = db.Column(db.Boolean, default=False)
|
||||||
|
setup = db.Column(db.Boolean, default=False)
|
||||||
|
|
||||||
role_id = db.Column(db.ForeignKey('roles.id')) #FK
|
role_id = db.Column(db.ForeignKey('roles.id')) #FK
|
||||||
password_hash = db.Column(db.String)
|
password_hash = db.Column(db.String)
|
||||||
|
|
Loading…
Reference in a new issue