mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Merge branch 'master' into async-job-stats
Conflicts: app/notifications/notifications_ses_callback.py
This commit is contained in:
@@ -1 +1,7 @@
|
||||
Generic single-database configuration.
|
||||
Generic single-database configuration.
|
||||
|
||||
python application.py db migration to generate migration script.
|
||||
|
||||
python application.py db upgrade to upgrade db with script.
|
||||
|
||||
python application.py db downgrade to rollback db changes.
|
||||
|
||||
53
migrations/versions/0083_add_perm_types_and_svc_perm.py
Normal file
53
migrations/versions/0083_add_perm_types_and_svc_perm.py
Normal file
@@ -0,0 +1,53 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0083_add_perm_types_and_svc_perm
|
||||
Revises: 0082_add_go_live_template
|
||||
Create Date: 2017-05-12 11:29:32.664811
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0083_add_perm_types_and_svc_perm'
|
||||
down_revision = '0082_add_go_live_template'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
service_permission_types=op.create_table('service_permission_types',
|
||||
sa.Column('name', sa.String(length=255), nullable=False),
|
||||
sa.PrimaryKeyConstraint('name'))
|
||||
|
||||
op.bulk_insert(service_permission_types,
|
||||
[
|
||||
{'name': x} for x in {
|
||||
'letter',
|
||||
'email',
|
||||
'sms',
|
||||
'international_sms',
|
||||
'incoming_sms'
|
||||
}
|
||||
])
|
||||
|
||||
op.create_table('service_permissions',
|
||||
sa.Column('service_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('permission', sa.String(length=255), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['permission'], ['service_permission_types.name'], ),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
|
||||
sa.PrimaryKeyConstraint('service_id', 'permission'))
|
||||
op.create_index(op.f('ix_service_permissions_permission'), 'service_permissions', ['permission'], unique=False)
|
||||
op.create_index(op.f('ix_service_permissions_service_id'), 'service_permissions', ['service_id'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index(op.f('ix_service_permissions_service_id'), table_name='service_permissions')
|
||||
op.drop_index(op.f('ix_service_permissions_permission'), table_name='service_permissions')
|
||||
op.drop_table('service_permissions')
|
||||
op.drop_table('service_permission_types')
|
||||
# ### end Alembic commands ###
|
||||
@@ -1,14 +1,14 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0083_add_job_stats
|
||||
Revises: 0082_add_go_live_template
|
||||
Revision ID: 0084_add_job_stats
|
||||
Revises: 0083_add_perm_types_and_svc_perm
|
||||
Create Date: 2017-05-12 13:16:14.147368
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0083_add_job_stats'
|
||||
down_revision = '0082_add_go_live_template'
|
||||
revision = '0084_add_job_stats'
|
||||
down_revision = '0083_add_perm_types_and_svc_perm'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
Reference in New Issue
Block a user