mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Password changed at is defaulted to the current date when the user is created.
This PR set the users.password_changed_at column to not be nullable.
This commit is contained in:
28
migrations/versions/0034_pwd_changed_at_not_null.py
Normal file
28
migrations/versions/0034_pwd_changed_at_not_null.py
Normal file
@@ -0,0 +1,28 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0034_pwd_changed_at_not_null
|
||||
Revises: 0033_api_key_type
|
||||
Create Date: 2016-06-28 10:37:25.389020
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0034_pwd_changed_at_not_null'
|
||||
down_revision = '0033_api_key_type'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.get_bind()
|
||||
op.execute('update users set password_changed_at = created_at where password_changed_at is null')
|
||||
op.alter_column('users', 'password_changed_at', nullable=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
pass
|
||||
### end Alembic commands ###
|
||||
Reference in New Issue
Block a user