Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
db migration (we hope)
Browse files Browse the repository at this point in the history
  • Loading branch information
naknomum committed Jan 9, 2024
1 parent e4ead8b commit 9478a95
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions migrations/versions/effd65fb089e_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# -*- coding: utf-8 -*-
"""empty message
Revision ID: effd65fb089e
Revises: 53b0fec87272
Create Date: 2024-01-05 18:24:21.360901
"""
import sqlalchemy as sa
from alembic import op

import app
import app.extensions

# revision identifiers, used by Alembic.
revision = 'effd65fb089e'
down_revision = '53b0fec87272'


def upgrade():
"""
Upgrade Semantic Description:
ENTER DESCRIPTION HERE
"""
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('collaboration', schema=None) as batch_op:
batch_op.add_column(
sa.Column('export_initiator_guid', app.extensions.GUID(), nullable=True)
)
batch_op.add_column(
sa.Column(
'export_req_notification_guid', app.extensions.GUID(), nullable=True
)
)
batch_op.create_index(
batch_op.f('ix_collaboration_export_initiator_guid'),
['export_initiator_guid'],
unique=False,
)
batch_op.create_foreign_key(
batch_op.f('fk_collaboration_export_initiator_guid_user'),
'user',
['export_initiator_guid'],
['guid'],
)
batch_op.create_foreign_key(
batch_op.f('fk_collaboration_export_req_notification_guid_notification'),
'notification',
['export_req_notification_guid'],
['guid'],
)

with op.batch_alter_table('collaboration_user_associations', schema=None) as batch_op:
batch_op.add_column(
sa.Column('export_approval_state', sa.String(length=32), nullable=False)
)

# ### end Alembic commands ###


def downgrade():
"""
Downgrade Semantic Description:
ENTER DESCRIPTION HERE
"""
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('collaboration_user_associations', schema=None) as batch_op:
batch_op.drop_column('export_approval_state')

with op.batch_alter_table('collaboration', schema=None) as batch_op:
batch_op.drop_constraint(
batch_op.f('fk_collaboration_export_req_notification_guid_notification'),
type_='foreignkey',
)
batch_op.drop_constraint(
batch_op.f('fk_collaboration_export_initiator_guid_user'), type_='foreignkey'
)
batch_op.drop_index(batch_op.f('ix_collaboration_export_initiator_guid'))
batch_op.drop_column('export_req_notification_guid')
batch_op.drop_column('export_initiator_guid')

# ### end Alembic commands ###

0 comments on commit 9478a95

Please sign in to comment.