Script 29c352bde564_separate_private_stuff_into_private__py
|
|
1 """separate private stuff into private tables by schema
2
3 Revision ID: 29c352bde564
4 Revises: b64659389c54
5 Create Date: 2018-12-03 12:55:34.810037
6
7 """
8
9
10 revision = '29c352bde564'
11 down_revision = 'b64659389c54'
12
13 from alembic import op
14 import sqlalchemy as sa
15
16
18 op.create_table('user_private',
19 sa.Column('mail', sa.String(length=150), nullable=False),
20 sa.Column('timezone', sa.String(length=50), nullable=True),
21 sa.Column('api_login', sa.String(length=40), nullable=False),
22 sa.Column('api_token', sa.String(length=40), nullable=False),
23 sa.Column('api_token_expiration', sa.Date(), nullable=False),
24 sa.Column('user_id', sa.Integer(), nullable=False),
25 sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
26 sa.PrimaryKeyConstraint('user_id')
27 )
28 op.create_table('copr_private',
29 sa.Column('webhook_secret', sa.String(length=100), nullable=True),
30 sa.Column('scm_api_auth_json', sa.Text(), nullable=True),
31 sa.Column('copr_id', sa.Integer(), nullable=False),
32 sa.ForeignKeyConstraint(['copr_id'], ['copr.id'], ),
33 sa.PrimaryKeyConstraint('copr_id')
34 )
35 op.create_index('copr_private_webhook_secret', 'copr_private', ['webhook_secret'], unique=False)
36
37
39 op.drop_index('copr_private_webhook_secret', table_name='copr_private')
40 op.drop_table('copr_private')
41 op.drop_table('user_private')
42