lemur/lemur/migrations/versions/33de094da890_.py

38 lines
1.1 KiB
Python
Raw Normal View History

2015-12-01 00:43:38 +01:00
"""Adding the ability to specify certificate replacements
Revision ID: 33de094da890
Revises: ed422fc58ba
Create Date: 2015-11-30 15:40:19.827272
"""
# revision identifiers, used by Alembic.
2019-05-16 16:57:02 +02:00
revision = "33de094da890"
down_revision = None
2015-12-01 00:43:38 +01:00
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
2019-05-16 16:57:02 +02:00
2015-12-01 00:43:38 +01:00
def upgrade():
### commands auto generated by Alembic - please adjust! ###
2019-05-16 16:57:02 +02:00
op.create_table(
"certificate_replacement_associations",
sa.Column("replaced_certificate_id", sa.Integer(), nullable=True),
sa.Column("certificate_id", sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(
["certificate_id"], ["certificates.id"], ondelete="cascade"
),
sa.ForeignKeyConstraint(
["replaced_certificate_id"], ["certificates.id"], ondelete="cascade"
),
2015-12-01 00:43:38 +01:00
)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
2019-05-16 16:57:02 +02:00
op.drop_table("certificate_replacement_associations")
2015-12-01 00:43:38 +01:00
### end Alembic commands ###