Merge pull request #159 from kevgliss/migrations
Adding current migration files.
This commit is contained in:
commit
cdd15ca818
|
@ -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()
|
||||
|
||||
#op.drop_table('encrypted_keys')
|
||||
#op.drop_table('encrypted_passwords')
|
||||
op.drop_table('encrypted_keys')
|
||||
op.drop_table('encrypted_passwords')
|
||||
|
||||
# helper tables to migrate data
|
||||
temp_key_table = op.create_table('encrypted_keys',
|
||||
|
|
Loading…
Reference in New Issue