Script 8de41eec1d1_enabling_fedora_25_chroots_py
[hide private]
[frames] | no frames]

Source Code for Script script-8de41eec1d1_enabling_fedora_25_chroots_py

 1  """enabling fedora-25 chroots 
 2   
 3  Revision ID: 8de41eec1d1 
 4  Revises: 94975badc43 
 5  Create Date: 2016-09-07 15:41:35.130578 
 6   
 7  """ 
 8   
 9  # revision identifiers, used by Alembic. 
10  revision = '8de41eec1d1' 
11  down_revision = '94975badc43' 
12   
13  from alembic import op 
14  import sqlalchemy as sa 
15   
16   
17 -def upgrade():
18 bind = op.get_bind() 19 connection = bind.connect() 20 21 connection.execute( 22 "INSERT INTO mock_chroot(os_release, os_version, arch, is_active) VALUES ('fedora', '25', 'x86_64', True)" 23 ) 24 connection.execute( 25 "INSERT INTO mock_chroot(os_release, os_version, arch, is_active) VALUES ('fedora', '25', 'i386', True)" 26 ) 27 connection.execute( 28 "INSERT INTO mock_chroot(os_release, os_version, arch, is_active) VALUES ('fedora', '25', 'ppc64le', True)" 29 ) 30 connection.close()
31 32
33 -def downgrade():
34 bind = op.get_bind() 35 connection = bind.connect() 36 37 connection.execute( # there might be already referencing records so just set is_active to False instead of removing 38 "UPDATE mock_chroot SET is_active=False WHERE os_release = 'fedora' AND os_version = '25'" 39 ) 40 connection.close()
41