-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #585 from wri/feature/metadata_field_update
GTC-2898 Modify resolution metadata fields
- Loading branch information
Showing
7 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""update resolution metadata fields | ||
Revision ID: ef3392e8e054 | ||
Revises: d767b6dd2c4c | ||
Create Date: 2024-09-10 14:19:43.424752 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
import sqlalchemy_utils | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'ef3392e8e054' | ||
down_revision = 'd767b6dd2c4c' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('dataset_metadata', 'resolution', nullable=True, new_column_name='spatial_resolution') | ||
op.add_column('dataset_metadata', sa.Column('resolution_description', sa.String(), nullable=True)) | ||
op.alter_column('version_metadata', 'resolution', nullable=True, new_column_name='spatial_resolution') | ||
op.add_column('version_metadata', sa.Column('resolution_description', sa.String(), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.alter_column('dataset_metadata', 'spatial_resolution', nullable=True, new_column_name='resolution') | ||
op.drop_column('version_metadata', 'resolution_description') | ||
op.alter_column('version_metadata', 'spatial_resolution', nullable=True, new_column_name='resolution') | ||
op.drop_column('dataset_metadata', 'resolution_description') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
VERSION_METADATA = { | ||
"content_date_range": {"start_date": "2000-01-01", "end_date": "2021-01-01"}, | ||
"last_update": "2020-01-03", | ||
"resolution": 10, | ||
"spatial_resolution": 10, | ||
"resolution_description": "10 meters", | ||
} |