From 11f2d88b160bf2020631a237bde91d2b5405fbbc Mon Sep 17 00:00:00 2001 From: kevgliss Date: Mon, 30 Nov 2015 15:43:38 -0800 Subject: [PATCH] Adding current migration files. --- lemur/migrations/versions/33de094da890_.py | 31 ++++++++++++++++++++++ lemur/migrations/versions/ed422fc58ba_.py | 4 +-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 lemur/migrations/versions/33de094da890_.py diff --git a/lemur/migrations/versions/33de094da890_.py b/lemur/migrations/versions/33de094da890_.py new file mode 100644 index 00000000..a4ca3810 --- /dev/null +++ b/lemur/migrations/versions/33de094da890_.py @@ -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 ### diff --git a/lemur/migrations/versions/ed422fc58ba_.py b/lemur/migrations/versions/ed422fc58ba_.py index 0c52c1ae..d08a403b 100644 --- a/lemur/migrations/versions/ed422fc58ba_.py +++ b/lemur/migrations/versions/ed422fc58ba_.py @@ -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',