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

feat(media) : increase the t_medias.source varchar size #595

Merged
merged 5 commits into from
Dec 20, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""increase t_medias.source size

Revision ID: 2c68a907f74c
Revises: 3c4762751898
Create Date: 2024-12-19 10:31:05.778720

"""

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "2c68a907f74c"
down_revision = "3c4762751898"
branch_labels = None
depends_on = None


def upgrade():
op.alter_column(
"t_medias", "source", type_=sa.Unicode(), existing_nullable=True, schema="taxonomie"
)


def downgrade():
op.alter_column(
"t_medias",
"source",
type_=sa.VARCHAR(length=25),
existing_nullable=True,
schema="taxonomie",
)
6 changes: 5 additions & 1 deletion apptax/taxonomie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,11 @@ class Taxref(db.Model):

status = db.relationship("VBdcStatus", order_by="VBdcStatus.lb_type_statut")
synonymes = db.relationship(
"Taxref", foreign_keys=[cd_ref], primaryjoin="Taxref.cd_ref == Taxref.cd_ref", uselist=True
"Taxref",
foreign_keys=[cd_ref],
primaryjoin="Taxref.cd_ref == Taxref.cd_ref",
uselist=True,
post_update=True,
)
parent = db.relationship("Taxref", primaryjoin=foreign(cd_sup) == remote(cd_ref))
attributs = db.relationship("CorTaxonAttribut", back_populates="taxon")
Expand Down
1 change: 0 additions & 1 deletion apptax/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def noms_without_listexample():
with db.session.begin_nested():
for cd_nom, cd_ref, nom_francais, comments, attr in bibnom_exemple:
nom = Taxref.query.get(cd_nom)
db.session.add(nom)
noms.append(nom)
return noms

Expand Down
9 changes: 9 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# CHANGELOG


2.1.1 (unreleased)
------------------

**🚀 Nouveautés**

- La limite du nombre de caractères dans la colonne `source` des médias est levée (#595 par @jacquesfize,@amandine-sahl)


2.1.0 (2024-12-06)
------------------

Expand Down
Loading