mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-09 15:10:27 +00:00
Fix migration script and user model
This commit is contained in:
parent
4bdd433079
commit
d09a645300
@ -8,7 +8,6 @@ Create Date: 2019-12-21 17:11:36.564632
|
|||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = '3f76448bb6de'
|
revision = '3f76448bb6de'
|
||||||
down_revision = 'b0fea72a3f20'
|
down_revision = 'b0fea72a3f20'
|
||||||
@ -18,7 +17,9 @@ depends_on = None
|
|||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
with op.batch_alter_table('user') as batch_op:
|
with op.batch_alter_table('user') as batch_op:
|
||||||
batch_op.add_column(sa.Column('confirmed', sa.Boolean()))
|
batch_op.add_column(
|
||||||
|
sa.Column('confirmed', sa.Boolean(), nullable=False,
|
||||||
|
default=False))
|
||||||
|
|
||||||
|
|
||||||
def downgrade():
|
def downgrade():
|
||||||
|
@ -26,7 +26,7 @@ class User(db.Model):
|
|||||||
lastname = db.Column(db.String(64))
|
lastname = db.Column(db.String(64))
|
||||||
email = db.Column(db.String(128))
|
email = db.Column(db.String(128))
|
||||||
otp_secret = db.Column(db.String(16))
|
otp_secret = db.Column(db.String(16))
|
||||||
confirmed = db.Column(db.SmallInteger, default=0)
|
confirmed = db.Column(db.SmallInteger, nullable=False, default=0)
|
||||||
role_id = db.Column(db.Integer, db.ForeignKey('role.id'))
|
role_id = db.Column(db.Integer, db.ForeignKey('role.id'))
|
||||||
|
|
||||||
def __init__(self,
|
def __init__(self,
|
||||||
|
Loading…
Reference in New Issue
Block a user