Script 9b7211be5017_add_reviewed_outdated_chroot_table_py
[hide private]
[frames] | no frames]

Source Code for Script script-9b7211be5017_add_reviewed_outdated_chroot_table_py

 1  """ 
 2  Add reviewed_outdated_chroot table 
 3   
 4  Revision ID: 9b7211be5017 
 5  Revises: de903581465c 
 6  Create Date: 2020-10-08 11:27:27.588111 
 7  """ 
 8   
 9  import sqlalchemy as sa 
10  from alembic import op 
11   
12   
13  revision = '9b7211be5017' 
14  down_revision = '63db6872060f' 
15   
16 -def upgrade():
17 op.create_table('reviewed_outdated_chroot', 18 sa.Column('id', sa.Integer(), nullable=False), 19 sa.Column('user_id', sa.Integer(), nullable=False), 20 sa.Column('copr_chroot_id', sa.Integer(), nullable=False), 21 sa.ForeignKeyConstraint(['copr_chroot_id'], ['copr_chroot.id'], ondelete='CASCADE'), 22 sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), 23 sa.PrimaryKeyConstraint('id') 24 ) 25 op.create_index(op.f('ix_reviewed_outdated_chroot_user_id'), 'reviewed_outdated_chroot', ['user_id'], unique=False)
26 27
28 -def downgrade():
29 op.drop_index(op.f('ix_reviewed_outdated_chroot_user_id'), table_name='reviewed_outdated_chroot') 30 op.drop_table('reviewed_outdated_chroot')
31