-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: updated tests and added alembic recipe
- Loading branch information
Fatimah
committed
Feb 19, 2024
1 parent
67f69a8
commit 31197c7
Showing
4 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
invenio_pages/alembic/b0f93ca4a147_add_has_custom_view_to_pages.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,37 @@ | ||
# | ||
# 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. | ||
|
||
"""Add has_custom_view to pages.""" | ||
|
||
import sqlalchemy as sa | ||
import sqlalchemy_utils | ||
from alembic import op | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b0f93ca4a147" | ||
down_revision = "145402e8523a" | ||
branch_labels = () | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
"""Upgrade database.""" | ||
# Add the new column | ||
op.add_column( | ||
"pages_page", | ||
sa.Column("has_custom_view", sa.Boolean(), nullable=True, default="False"), | ||
) | ||
|
||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
"""Downgrade database.""" | ||
# Drop the column | ||
op.drop_column("pages_page", "has_custom_view") | ||
# ### 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