-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c89591d
commit 3dbebab
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
alembic/versions/b24d92b5017f_rename_solr_search_facet_resource.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,40 @@ | ||
"""Rename Solr search facet resource | ||
Revision ID: b24d92b5017f | ||
Revises: 0307976d3d52 | ||
Create Date: 2024-08-08 10:49:29.172916 | ||
""" | ||
import os | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
qwc_config_schema = os.getenv("QWC_CONFIG_SCHEMA", "qwc_config") | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'b24d92b5017f' | ||
down_revision = '0307976d3d52' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
sql = sa.sql.text(""" | ||
UPDATE {schema}.resource_types | ||
SET description = 'Search facet' | ||
WHERE name = 'solr_facet'; | ||
""".format(schema=qwc_config_schema)) | ||
|
||
conn = op.get_bind() | ||
conn.execute(sql) | ||
|
||
|
||
def downgrade(): | ||
sql = sa.sql.text(""" | ||
UPDATE {schema}.resource_types | ||
SET description = 'Solr search facet' | ||
WHERE name = 'solr_facet'; | ||
""".format(schema=qwc_config_schema)) | ||
|
||
conn = op.get_bind() | ||
conn.execute(sql) |