32 lines
960 B
Python
32 lines
960 B
Python
"""Creating a one-to-many relationship for notifications
|
|
|
|
Revision ID: 4dc5ddd111b8
|
|
Revises: 4c8915e461b3
|
|
Create Date: 2015-07-24 15:02:04.398262
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '4dc5ddd111b8'
|
|
down_revision = '4c8915e461b3'
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
def upgrade():
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table('certificate_notification_associations',
|
|
sa.Column('notification_id', sa.Integer(), nullable=True),
|
|
sa.Column('certificate_id', sa.Integer(), nullable=True),
|
|
sa.ForeignKeyConstraint(['certificate_id'], ['certificates.id'], ondelete='cascade'),
|
|
sa.ForeignKeyConstraint(['notification_id'], ['notifications.id'], ondelete='cascade')
|
|
)
|
|
### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('certificate_notification_associations')
|
|
### end Alembic commands ###
|