Skip to content

Commit ccb4bbe

Browse files
committed
Add Log Table
1 parent 163b39a commit ccb4bbe

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

migrations/versions/117567def844_.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""Add Log Table for User Actions
2+
3+
Revision ID: 117567def844
4+
Revises: 2c3193839c9d
5+
Create Date: 2017-06-19 00:39:17.408944
6+
7+
"""
8+
9+
# revision identifiers, used by Alembic.
10+
revision = '117567def844'
11+
down_revision = '2c3193839c9d'
12+
13+
from alembic import op
14+
import sqlalchemy as sa
15+
from sqlalchemy.dialects import postgresql
16+
17+
def upgrade():
18+
### commands auto generated by Alembic - please adjust! ###
19+
op.create_table('user_log',
20+
sa.Column('id', sa.Integer(), nullable=False),
21+
sa.Column('ipaddr', postgresql.INET(), nullable=False),
22+
sa.Column('timestamp', sa.DateTime(), nullable=False),
23+
sa.Column('uid', sa.String(length=32), nullable=False),
24+
sa.Column('method', sa.Enum('GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH', name='http_enum'), nullable=True),
25+
sa.Column('blueprint', sa.String(length=32), nullable=False),
26+
sa.Column('path', sa.String(length=128), nullable=False),
27+
sa.Column('description', sa.String(length=128), nullable=False),
28+
sa.PrimaryKeyConstraint('id')
29+
)
30+
### end Alembic commands ###
31+
32+
33+
def downgrade():
34+
### commands auto generated by Alembic - please adjust! ###
35+
op.drop_table('user_log')
36+
### end Alembic commands ###

0 commit comments

Comments
 (0)