Skip to content

Commit

Permalink
Add a last_login field for persons.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Oct 24, 2013
1 parent abc5299 commit 0e08f15
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions alembic/versions/4099fa344171_add_last_login.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""add last login
Revision ID: 4099fa344171
Revises: 139ec7ed17b7
Create Date: 2013-10-24 10:13:45.104902
"""

# revision identifiers, used by Alembic.
revision = '4099fa344171'
down_revision = '139ec7ed17b7'

from alembic import op
import sqlalchemy as sa


def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.add_column('persons', sa.Column('last_login', sa.DateTime(), nullable=True))
### end Alembic commands ###


def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column('persons', 'last_login')
### end Alembic commands ###
1 change: 1 addition & 0 deletions tahrir_api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ class Person(DeclarativeBase):
bio = Column(Unicode(140))
created_on = Column(DateTime, nullable=False,
default=datetime.datetime.now)
last_login = Column(DateTime, nullable=True, default=None)
opt_out = Column(Boolean, nullable=False, default=False)
# An integer that organizes the users by the number of
# badges they have ever been awarded. A value of None
Expand Down

0 comments on commit 0e08f15

Please sign in to comment.