sqla (mapping): fix missing PEP constraint:

A constraint name was missing on the `PubsubNode.pep` column, resulting in a crash when
trying to generate the initial database on launch with an empty `local_dir`.

Migration script introducing the column (f4cb5fc600c7_add_missing_pep_check_constraint.py)
has been updated too. Another migration script has been made to add the constraint to
existing DB (only if they are missing).
This commit is contained in:
Goffi 2026-06-20 10:27:51 +02:00
commit 7107d64a5b

View file

@ -629,7 +629,7 @@ class PubsubNode(Base):
service = Column(JID)
name = Column(Text, nullable=False)
pep = Column(
Boolean(create_constraint=True),
Boolean(create_constraint=True, name="pep_bool"),
nullable=False,
server_default=false(),
)