Blame alembic/versions/6a3ed02ee160_new_api_token_internal_access_acl.py

Slavek Kabrda 984d0f
"""empty message
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
Revision ID: 6a3ed02ee160
Slavek Kabrda 984d0f
Revises: 9cb4580e269a
Slavek Kabrda 984d0f
Create Date: 2018-11-22 14:36:59.024463
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
"""
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
from alembic import op
Slavek Kabrda 984d0f
import sqlalchemy as sa
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
# revision identifiers, used by Alembic.
Slavek Kabrda 984d0f
revision = '6a3ed02ee160'
Slavek Kabrda 984d0f
down_revision = '9cb4580e269a'
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
def upgrade():
Slavek Kabrda 984d0f
    """ Insert the new ACL into the database. """
Slavek Kabrda 984d0f
    op.execute(
Slavek Kabrda 984d0f
        'INSERT INTO acls ("name", "description", "created") '
Slavek Kabrda 984d0f
        "VALUES ('internal_access', 'Access Pagure''s internal APIs', NOW());"
Slavek Kabrda 984d0f
    )
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
Slavek Kabrda 984d0f
def downgrade():
Slavek Kabrda 984d0f
    """ Remove the added ACL from the database. """
Slavek Kabrda 984d0f
    op.execute(
Slavek Kabrda 984d0f
        "REMOVE FROM acls WHERE name = 'internal_access';"
Slavek Kabrda 984d0f
    )