Script 32ba137a3d56_add_token_informatio_py
|
|
1 """Add token information to the user table
2
3 Revision ID: 32ba137a3d56
4 Revises: 595a31c145fb
5 Create Date: 2013-01-07 20:56:14.698735
6
7 """
8
9
10 revision = "32ba137a3d56"
11 down_revision = "595a31c145fb"
12
13 from alembic import op
14 import sqlalchemy as sa
15
16
18 """ Add the coluns api_token and api_token_expiration to the user table.
19 """
20 op.add_column("user", sa.Column("api_token", sa.String(40),
21 nullable=False,
22 server_default="default_token"))
23
24 op.add_column("user", sa.Column("api_token_expiration", sa.Date,
25 nullable=False,
26 server_default="2000-1-1"))
27
28
30 """ Drop the coluns api_token and api_token_expiration to the user table.
31 """
32 op.drop_column("user", "api_token")
33 op.drop_column("user", "api_token_expiration")
34