Skip to content

Commit

Permalink
[frontend] add migration to enable mageia chroots
Browse files Browse the repository at this point in the history
  • Loading branch information
clime committed Sep 20, 2016
1 parent e6ce903 commit 49909c4
Showing 1 changed file with 43 additions and 0 deletions.
@@ -0,0 +1,43 @@
"""add mageia chroots
Revision ID: 3341bf554454
Revises: 8de41eec1d1
Create Date: 2016-09-20 19:28:16.115630
"""

# revision identifiers, used by Alembic.
revision = '3341bf554454'
down_revision = '8de41eec1d1'

from alembic import op
import sqlalchemy as sa


def upgrade():
bind = op.get_bind()
connection = bind.connect()

connection.execute(
"INSERT INTO mock_chroot(os_release, os_version, arch, is_active) VALUES ('mageia', '6', 'x86_64', True)"
)
connection.execute(
"INSERT INTO mock_chroot(os_release, os_version, arch, is_active) VALUES ('mageia', '6', 'i586', True)"
)
connection.execute(
"INSERT INTO mock_chroot(os_release, os_version, arch, is_active) VALUES ('mageia', 'cauldron', 'x86_64', True)"
)
connection.execute(
"INSERT INTO mock_chroot(os_release, os_version, arch, is_active) VALUES ('mageia', 'cauldron', 'i586', True)"
)
connection.close()


def downgrade():
bind = op.get_bind()
connection = bind.connect()

connection.execute( # there might be already referencing records so just set is_active to False instead of removing
"UPDATE mock_chroot SET is_active=False WHERE os_release = 'mageia'"
)
connection.close()

0 comments on commit 49909c4

Please sign in to comment.