Add creation date to User table

This commit is contained in:
Joseph Schorr 2018-03-09 13:31:29 -05:00
parent 32a473d23c
commit c4a6273e00
2 changed files with 28 additions and 0 deletions

View file

@ -441,6 +441,8 @@ class User(BaseModel):
maximum_queued_builds_count = IntegerField(null=True)
creation_date = DateTimeField(default=datetime.utcnow, null=True)
def delete_instance(self, recursive=False, delete_nullable=False):
# If we are deleting a robot account, only execute the subset of queries necessary.
if self.robot:

View file

@ -0,0 +1,26 @@
"""Add creation date to User table
Revision ID: 0cf50323c78b
Revises: 87fbbc224f10
Create Date: 2018-03-09 13:19:41.903196
"""
# revision identifiers, used by Alembic.
revision = '0cf50323c78b'
down_revision = '87fbbc224f10'
from alembic import op
import sqlalchemy as sa
def upgrade(tables):
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('creation_date', sa.DateTime(), nullable=True))
# ### end Alembic commands ###
def downgrade(tables):
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'creation_date')
# ### end Alembic commands ###