-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* closes CERNDocumentServer/cds-rdm#284
- Loading branch information
Showing
6 changed files
with
30 additions
and
30 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
invenio_vocabularies/alembic/8a91f4cfedd2_removes_internal_id_from_name_metadata.py
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,29 @@ | ||
# | ||
Check failure on line 1 in invenio_vocabularies/alembic/8a91f4cfedd2_removes_internal_id_from_name_metadata.py GitHub Actions / Python / Tests (3.9, postgresql14, opensearch2)
Check failure on line 1 in invenio_vocabularies/alembic/8a91f4cfedd2_removes_internal_id_from_name_metadata.py GitHub Actions / Python / Tests (3.9, postgresql14, opensearch2)
Check failure on line 1 in invenio_vocabularies/alembic/8a91f4cfedd2_removes_internal_id_from_name_metadata.py GitHub Actions / Python / Tests (3.12, postgresql14, opensearch2)
Check failure on line 1 in invenio_vocabularies/alembic/8a91f4cfedd2_removes_internal_id_from_name_metadata.py GitHub Actions / Python / Tests (3.12, postgresql14, opensearch2)
|
||
# This file is part of Invenio. | ||
# Copyright (C) 2016-2018 CERN. | ||
# | ||
# Invenio is free software; you can redistribute it and/or modify it | ||
# under the terms of the MIT License; see LICENSE file for more details. | ||
|
||
"""Removes internal_id from name_metadata.""" | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '8a91f4cfedd2' | ||
down_revision = 'af2457652217' | ||
branch_labels = () | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
"""Upgrade database.""" | ||
op.drop_index('ix_name_metadata_internal_id', table_name='name_metadata') | ||
op.drop_column('name_metadata', 'internal_id') | ||
|
||
def downgrade(): | ||
"""Downgrade database.""" | ||
op.add_column('name_metadata', sa.Column('internal_id', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) | ||
op.create_index('ix_name_metadata_internal_id', 'name_metadata', ['internal_id'], unique=False) |
This file was deleted.
Oops, something went wrong.
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