* Initial work on #74. * Fixing tests. * Adding migration script. * Excluding migrations from coverage report.
This commit is contained in:
36
lemur/migrations/versions/6d6151f5f307_.py
Normal file
36
lemur/migrations/versions/6d6151f5f307_.py
Normal file
@ -0,0 +1,36 @@
|
||||
"""Adding private key auditing.
|
||||
|
||||
Revision ID: 6d6151f5f307
|
||||
Revises: 932525b82f1a
|
||||
Create Date: 2016-11-18 16:08:12.191959
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6d6151f5f307'
|
||||
down_revision = '932525b82f1a'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from sqlalchemy_utils.types import ArrowType
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('views',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('certificate_id', sa.Integer(), nullable=True),
|
||||
sa.Column('viewed_at', ArrowType(), server_default=sa.text('now()'), nullable=False),
|
||||
sa.Column('user_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['certificate_id'], ['certificates.id'], ),
|
||||
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('views')
|
||||
### end Alembic commands ###
|
Reference in New Issue
Block a user