Added active attribute to the users table
							parent
							
								
									3ef86bca1e
								
							
						
					
					
						commit
						c7d65e06d2
					
				@ -0,0 +1,30 @@
 | 
			
		||||
"""Adding user active attribute
 | 
			
		||||
 | 
			
		||||
Revision ID: 7c2d43ec9c84
 | 
			
		||||
Revises: 374c36260db7
 | 
			
		||||
Create Date: 2018-06-10 17:57:32.570036
 | 
			
		||||
 | 
			
		||||
"""
 | 
			
		||||
from alembic import op
 | 
			
		||||
import sqlalchemy as sa
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
# revision identifiers, used by Alembic.
 | 
			
		||||
revision = '7c2d43ec9c84'
 | 
			
		||||
down_revision = '374c36260db7'
 | 
			
		||||
branch_labels = None
 | 
			
		||||
depends_on = None
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def upgrade():
 | 
			
		||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
			
		||||
    op.add_column('users', sa.Column('active', sa.Boolean()))
 | 
			
		||||
    op.execute('UPDATE users SET active = True')
 | 
			
		||||
    op.alter_column('users', 'active', nullable=False)
 | 
			
		||||
    # ### end Alembic commands ###
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def downgrade():
 | 
			
		||||
    # ### commands auto generated by Alembic - please adjust! ###
 | 
			
		||||
    op.drop_column('users', 'active')
 | 
			
		||||
    # ### end Alembic commands ###
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue