Script 3341bf554454_add_mageia_chroots_py
[hide private]
[frames] | no frames]

Source Code for Script script-3341bf554454_add_mageia_chroots_py

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