add additional user fields
This commit is contained in:
parent
e7a117be33
commit
30318b68bb
36
alembic/versions/c99026ab9918_add_additional_user_fields.py
Normal file
36
alembic/versions/c99026ab9918_add_additional_user_fields.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
"""add additional user fields
|
||||||
|
|
||||||
|
Revision ID: c99026ab9918
|
||||||
|
Revises: 903d7c66ff1d
|
||||||
|
Create Date: 2018-10-15 11:10:46.073745
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = 'c99026ab9918'
|
||||||
|
down_revision = '903d7c66ff1d'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('users', sa.Column('citizenship', sa.String(), nullable=True))
|
||||||
|
op.add_column('users', sa.Column('date_latest_training', sa.Date(), nullable=True))
|
||||||
|
op.add_column('users', sa.Column('designation', sa.String(), nullable=True))
|
||||||
|
op.add_column('users', sa.Column('phone_number', sa.String(), nullable=True))
|
||||||
|
op.add_column('users', sa.Column('service_branch', sa.String(), nullable=True))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('users', 'service_branch')
|
||||||
|
op.drop_column('users', 'phone_number')
|
||||||
|
op.drop_column('users', 'designation')
|
||||||
|
op.drop_column('users', 'date_latest_training')
|
||||||
|
op.drop_column('users', 'citizenship')
|
||||||
|
# ### end Alembic commands ###
|
@ -1,4 +1,4 @@
|
|||||||
from sqlalchemy import String, ForeignKey, Column
|
from sqlalchemy import String, ForeignKey, Column, Date
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
from sqlalchemy.dialects.postgresql import UUID
|
from sqlalchemy.dialects.postgresql import UUID
|
||||||
|
|
||||||
@ -20,6 +20,11 @@ class User(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
|
|||||||
dod_id = Column(String, unique=True, nullable=False)
|
dod_id = Column(String, unique=True, nullable=False)
|
||||||
first_name = Column(String)
|
first_name = Column(String)
|
||||||
last_name = Column(String)
|
last_name = Column(String)
|
||||||
|
phone_number = Column(String)
|
||||||
|
service_branch = Column(String)
|
||||||
|
citizenship = Column(String)
|
||||||
|
designation = Column(String)
|
||||||
|
date_latest_training = Column(Date)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def atat_permissions(self):
|
def atat_permissions(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user