Skip to content

Commit

Permalink
GTC-2898 Correct migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
manukala6 committed Sep 10, 2024
1 parent 0f1d9d4 commit 786ab41
Showing 1 changed file with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""empty message
"""update resolution metadata fields
Revision ID: e8a7dc28a874
Revision ID: ab98e958dc3b
Revises: d767b6dd2c4c
Create Date: 2024-09-06 20:37:11.512231
Create Date: 2024-09-10 13:49:58.066058
"""
from alembic import op
Expand All @@ -11,29 +11,25 @@
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'e8a7dc28a874'
revision = 'ab98e958dc3b'
down_revision = 'd767b6dd2c4c'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('dataset_metadata', sa.Column('spatial_resolution', sa.Numeric(), nullable=True))
op.alter_column('dataset_metadata', 'resolution', nullable=False, new_column_name='spatial_resolution')
op.add_column('dataset_metadata', sa.Column('resolution_description', sa.String(), nullable=True))
op.drop_column('dataset_metadata', 'resolution')
op.add_column('version_metadata', sa.Column('spatial_resolution', sa.Numeric(), nullable=True))
op.alter_column('version_metadata', 'resolution', nullable=False, new_column_name='spatial_resolution')
op.add_column('version_metadata', sa.Column('resolution_description', sa.String(), nullable=True))
op.drop_column('version_metadata', 'resolution')
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('version_metadata', sa.Column('resolution', sa.NUMERIC(), autoincrement=False, nullable=True))
op.alter_column('dataset_metadata', 'spatial_resolution', nullable=False, new_column_name='resolution')
op.drop_column('version_metadata', 'resolution_description')
op.drop_column('version_metadata', 'spatial_resolution')
op.add_column('dataset_metadata', sa.Column('resolution', sa.NUMERIC(), autoincrement=False, nullable=True))
op.alter_column('version_metadata', 'spatial_resolution', nullable=False, new_column_name='resolution')
op.drop_column('dataset_metadata', 'resolution_description')
op.drop_column('dataset_metadata', 'spatial_resolution')
# ### end Alembic commands ###

0 comments on commit 786ab41

Please sign in to comment.