mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Add ServiceLetterContact data model and script
This commit is contained in:
32
migrations/versions/0122_add_service_letter_contact.py
Normal file
32
migrations/versions/0122_add_service_letter_contact.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0122_add_service_letter_contact
|
||||
Revises: 0121_nullable_logos
|
||||
Create Date: 2017-09-21 12:16:02.975120
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0122_add_service_letter_contact'
|
||||
down_revision = '0121_nullable_logos'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_table('service_letter_contacts',
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('service_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('contact_block', sa.Text(), nullable=False),
|
||||
sa.Column('is_default', sa.Boolean(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('updated_at', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_service_letter_contact_service_id'), 'service_letter_contacts', ['service_id'], unique=False)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_index(op.f('ix_service_letter_contact_service_id'), table_name='service_letter_contacts')
|
||||
op.drop_table('service_letter_contacts')
|
||||
Reference in New Issue
Block a user