Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct area_name for communes #8

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
CHANGELOG
=========


1.4.1 (unreleased)
------------------

**🐛 Corrections**

* Nom des communes (branche alembic `ref_geo_fr_municipalities`): correction des caractères `¼` et `½` en `Œ` et `œ`

1.4.0 (2023-09-14)
------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""empty message

Revision ID: fda887e7b578
Revises: 0dfdbfbccd63
Create Date: 2023-02-28 13:25:40.908589

"""
from alembic import op
from utils_flask_sqla.migrations.utils import logger


# revision identifiers, used by Alembic.
revision = "fda887e7b578"
down_revision = "0dfdbfbccd63"
branch_labels = None
depends_on = None


def upgrade():
logger.info("Correct area_name for communes (for characters Œ and œ)")
op.execute(

Check warning on line 21 in src/ref_geo/migrations/versions/fda887e7b578_correct_area_name_for_COM.py

View check run for this annotation

Codecov / codecov/patch

src/ref_geo/migrations/versions/fda887e7b578_correct_area_name_for_COM.py#L20-L21

Added lines #L20 - L21 were not covered by tests
f"""
update ref_geo.l_areas
set area_name = replace(area_name, '¼', 'Œ')
where area_name like '%¼%';
update ref_geo.l_areas
set area_name = replace(area_name, '½', 'œ')
where area_name like '%½%';
"""
)


def downgrade():
op.execute(

Check warning on line 34 in src/ref_geo/migrations/versions/fda887e7b578_correct_area_name_for_COM.py

View check run for this annotation

Codecov / codecov/patch

src/ref_geo/migrations/versions/fda887e7b578_correct_area_name_for_COM.py#L34

Added line #L34 was not covered by tests
f"""
update ref_geo.l_areas
set area_name = replace(area_name, 'Œ', '¼')
where area_name like '%Œ%';
update ref_geo.l_areas
set area_name = replace(area_name, 'œ', '½')
where area_name like '%œ%';
"""
)
Loading