Skip to content
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
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# apply black
a6c1024819e2de9f72d71d9d89c95405ce422970
# apply black 26
cbed347c2f38414ab1f606e2c1c4308ce1a0b718
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import setuptools
from pathlib import Path


root_dir = Path(__file__).absolute().parent
with (root_dir / "VERSION").open() as f:
version = f.read()
Expand Down
1 change: 0 additions & 1 deletion src/pypn_habref_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from pypn_habref_api.env import db, ma
from pypn_habref_api.routes import routes


migrate = Migrate()


Expand Down
1 change: 0 additions & 1 deletion src/pypn_habref_api/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy


db_path = environ.get("FLASK_SQLALCHEMY_DB")
if db_path:
db_module_name, db_object_name = db_path.rsplit(".", 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

from utils_flask_sqla.migrations.utils import logger, open_remote_file


# revision identifiers, used by Alembic.
revision = "46e91e738845"
down_revision = None
Expand Down Expand Up @@ -53,8 +52,7 @@ def upgrade():
)

logger.info("Populate table autocomplete_habitat…")
op.execute(
"""
op.execute("""
INSERT INTO ref_habitats.autocomplete_habitat
SELECT
cd_hab,
Expand All @@ -64,8 +62,7 @@ def upgrade():
concat(lb_code, ' - ', lb_hab_fr, ' ', lb_hab_fr_complet)
FROM ref_habitats.habref h
JOIN ref_habitats.typoref t ON t.cd_typo = h.cd_typo
"""
)
""")


def downgrade():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "62e63cd6135d"
down_revision = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "805442837a68"
down_revision = "46e91e738845"
Expand All @@ -19,8 +18,7 @@


def upgrade():
op.execute(
"""
op.execute("""
ALTER TABLE ref_habitats.habref ADD column lb_hab_en_save character varying(500);
UPDATE ref_habitats.habref
SET lb_hab_en_save = lb_auteur;
Expand All @@ -29,10 +27,8 @@ def upgrade():
UPDATE ref_habitats.habref
SET lb_hab_en = lb_hab_en_save;
ALTER TABLE ref_habitats.habref DROP column lb_hab_en_save
"""
)
op.execute(
"""
""")
op.execute("""
DELETE FROM ref_habitats.autocomplete_habitat;
INSERT INTO ref_habitats.autocomplete_habitat
SELECT
Expand All @@ -43,8 +39,7 @@ def upgrade():
concat(lb_code, ' - ', lb_hab_fr, ' ', lb_hab_fr_complet)
FROM ref_habitats.habref h
JOIN ref_habitats.typoref t ON t.cd_typo = h.cd_typo;
"""
)
""")


def downgrade():
Expand Down
1 change: 0 additions & 1 deletion src/pypn_habref_api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
)
from pypn_habref_api.env import db as DB


routes = Blueprint("habref", __name__)


Expand Down