Adding current migration files.
This commit is contained in:
parent
8066d540e0
commit
11f2d88b16
|
@ -0,0 +1,31 @@
|
||||||
|
"""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.
|
||||||
|
revision = '33de094da890'
|
||||||
|
down_revision = 'ed422fc58ba'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy.dialects import postgresql
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
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')
|
||||||
|
)
|
||||||
|
### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_table('certificate_replacement_associations')
|
||||||
|
### end Alembic commands ###
|
|
@ -28,8 +28,8 @@ from lemur.common.utils import get_psuedo_random_string
|
||||||
|
|
||||||
conn = op.get_bind()
|
conn = op.get_bind()
|
||||||
|
|
||||||
#op.drop_table('encrypted_keys')
|
op.drop_table('encrypted_keys')
|
||||||
#op.drop_table('encrypted_passwords')
|
op.drop_table('encrypted_passwords')
|
||||||
|
|
||||||
# helper tables to migrate data
|
# helper tables to migrate data
|
||||||
temp_key_table = op.create_table('encrypted_keys',
|
temp_key_table = op.create_table('encrypted_keys',
|
||||||
|
|
Loading…
Reference in New Issue