5affe6f5d94f_new_api_token_acl.py 646 B

1234567891011121314151617181920212223242526272829
  1. """new_api_token_acl
  2. Revision ID: 5affe6f5d94f
  3. Revises: 46df6466b8fa
  4. Create Date: 2018-01-19 15:27:20.332664
  5. """
  6. # revision identifiers, used by Alembic.
  7. revision = '5affe6f5d94f'
  8. down_revision = '46df6466b8fa'
  9. from alembic import op
  10. import sqlalchemy as sa
  11. def upgrade():
  12. """ Insert the new ACL into the database. """
  13. op.execute(
  14. 'INSERT INTO acls ("name", "description", "created") '
  15. "VALUES ('pull_request_create', 'Open a new pull-request', NOW());"
  16. )
  17. def downgrade():
  18. """ Remove the added ACL from the database. """
  19. op.execute(
  20. "REMOVE FROM acls WHERE name = 'pull_request_create';"
  21. )