mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 06:03:12 -04:00
add test api key type
This commit is contained in:
@@ -142,6 +142,7 @@ class ApiKey(db.Model, Versioned):
|
|||||||
|
|
||||||
KEY_TYPE_NORMAL = 'normal'
|
KEY_TYPE_NORMAL = 'normal'
|
||||||
KEY_TYPE_TEAM = 'team'
|
KEY_TYPE_TEAM = 'team'
|
||||||
|
KEY_TYPE_TEST = 'test'
|
||||||
|
|
||||||
|
|
||||||
class KeyTypes(db.Model):
|
class KeyTypes(db.Model):
|
||||||
|
|||||||
23
migrations/versions/0038_test_api_key_type.py
Normal file
23
migrations/versions/0038_test_api_key_type.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
"""0038_test_api_key_type
|
||||||
|
|
||||||
|
Revision ID: 0038_test_api_key_type
|
||||||
|
Revises: 0037_service_sms_sender
|
||||||
|
Create Date: 2016-07-05 10:28:12.947306
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '0038_test_api_key_type'
|
||||||
|
down_revision = '0037_service_sms_sender'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.execute("insert into key_types values ('test')")
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
op.execute("update notifications set key_type = 'normal' where key_type = 'test'")
|
||||||
|
op.execute("update api_keys set key_type = 'normal' where key_type = 'test'")
|
||||||
|
op.execute("delete from key_types where name='test'")
|
||||||
Reference in New Issue
Block a user