Blame alembic/versions/5affe6f5d94f_new_api_token_acl.py

Pierre-Yves Chibon 9811e6
"""new_api_token_acl
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
Revision ID: 5affe6f5d94f
Pierre-Yves Chibon 9811e6
Revises: 46df6466b8fa
Pierre-Yves Chibon 9811e6
Create Date: 2018-01-19 15:27:20.332664
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
"""
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
# revision identifiers, used by Alembic.
Pierre-Yves Chibon 9811e6
revision = '5affe6f5d94f'
Pierre-Yves Chibon 9811e6
down_revision = '46df6466b8fa'
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
from alembic import op
Pierre-Yves Chibon 9811e6
import sqlalchemy as sa
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
def upgrade():
Pierre-Yves Chibon 9811e6
    """ Insert the new ACL into the database. """
Pierre-Yves Chibon 9811e6
    op.execute(
Pierre-Yves Chibon 1a1f2e
        'INSERT INTO acls ("name", "description", "created") '
Pierre-Yves Chibon 1a1f2e
        "VALUES ('pull_request_create', 'Open a new pull-request', NOW());"
Pierre-Yves Chibon 9811e6
    )
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
Pierre-Yves Chibon 9811e6
def downgrade():
Pierre-Yves Chibon 9811e6
    """ Remove the added ACL from the database. """
Pierre-Yves Chibon 9811e6
    op.execute(
Pierre-Yves Chibon 9811e6
        "REMOVE FROM acls WHERE name = 'pull_request_create';"
Pierre-Yves Chibon 9811e6
    )