-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new content type for flatpaks, which is inferred from the Koji metadata. Flatpaks are mashed exactly the same as containers - the content type is different mostly to get a non-confusing display of content type in the user interface and to allow future enhancements like Flatpak-specific testing instructions. Signed-off-by: Owen W. Taylor <[email protected]>
- Loading branch information
1 parent
0c341d6
commit 1a6c4e8
Showing
7 changed files
with
266 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
bodhi/server/migrations/versions/385acbb51075_add_flatpak_enum.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright © 2018 Red Hat, Inc. | ||
# | ||
# This file is part of Bodhi. | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
""" | ||
add flatpak enum. | ||
Revision ID: 385acbb51075 | ||
Revises: ebaab70b2cda | ||
Create Date: 2018-07-17 15:34:38.793304 | ||
""" | ||
from alembic import op | ||
from sqlalchemy import exc | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '385acbb51075' | ||
down_revision = 'ebaab70b2cda' | ||
|
||
|
||
def upgrade(): | ||
"""Add a 'flatpak' content type enum value in ck_content_type.""" | ||
op.execute('COMMIT') # See https://bitbucket.org/zzzeek/alembic/issue/123 | ||
try: | ||
# This will raise a ProgrammingError if the DB server doesn't use BDR. | ||
op.execute('SHOW bdr.permit_ddl_locking') | ||
# This server uses BDR, so let's ask for a DDL lock. | ||
op.execute('SET LOCAL bdr.permit_ddl_locking = true') | ||
except exc.ProgrammingError: | ||
# This server doesn't use BDR, so no problem. | ||
pass | ||
op.execute("ALTER TYPE ck_content_type ADD VALUE 'flatpak' AFTER 'container'") | ||
|
||
|
||
def downgrade(): | ||
""" | ||
Alert user that we cannot downgrade this migration. | ||
PostgreSQL does not allow enum values to be removed. | ||
""" | ||
raise NotImplementedError("Downgrading this migration is not supported.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters