| |
@@ -45,23 +45,23 @@
|
| |
status = db.Column(db.String(80), unique=False)
|
| |
"""E.g. 'NEW' or 'ASSIGNED'"""
|
| |
component = db.Column(db.String(80), unique=False)
|
| |
- active = db.Column(db.Boolean)
|
| |
+ active = db.Column(db.Boolean(create_constraint=True, name='active_bool'))
|
| |
"""An alias for 'open', i.e. `True` when open, `False` when closed"""
|
| |
last_bug_sync = db.Column(db.DateTime)
|
| |
- needinfo = db.Column(db.Boolean)
|
| |
+ needinfo = db.Column(db.Boolean(create_constraint=True, name='needinfo_bool'))
|
| |
needinfo_requestee = db.Column(db.String(1024), unique=False)
|
| |
last_whiteboard_change = db.Column(db.DateTime)
|
| |
"""The time when we detected a blocker/FE keyword change. It doesn't really mark *any*
|
| |
whiteboard change, just for those tracked keywords."""
|
| |
- proposed_blocker = db.Column(db.Boolean)
|
| |
- proposed_fe = db.Column(db.Boolean)
|
| |
- rejected_blocker = db.Column(db.Boolean)
|
| |
- rejected_fe = db.Column(db.Boolean)
|
| |
- accepted_blocker = db.Column(db.Boolean)
|
| |
- accepted_0day = db.Column(db.Boolean)
|
| |
- accepted_prevrel = db.Column(db.Boolean)
|
| |
- accepted_fe = db.Column(db.Boolean)
|
| |
- prioritized = db.Column(db.Boolean)
|
| |
+ proposed_blocker = db.Column(db.Boolean(create_constraint=True, name='proposed_blocker_bool'))
|
| |
+ proposed_fe = db.Column(db.Boolean(create_constraint=True, name='proposed_fe_bool'))
|
| |
+ rejected_blocker = db.Column(db.Boolean(create_constraint=True, name='rejected_blocker_bool'))
|
| |
+ rejected_fe = db.Column(db.Boolean(create_constraint=True, name='rejected_fe_bool'))
|
| |
+ accepted_blocker = db.Column(db.Boolean(create_constraint=True, name='accepted_blocker_bool'))
|
| |
+ accepted_0day = db.Column(db.Boolean(create_constraint=True, name='accepted_0day_bool'))
|
| |
+ accepted_prevrel = db.Column(db.Boolean(create_constraint=True, name='accepted_prevrel_bool'))
|
| |
+ accepted_fe = db.Column(db.Boolean(create_constraint=True, name='accepted_fe_bool'))
|
| |
+ prioritized = db.Column(db.Boolean(create_constraint=True, name='prioritized_bool'))
|
| |
milestone_id = db.Column(db.Integer, db.ForeignKey('milestone.id'))
|
| |
milestone: Optional['model_milestone.Milestone'] = db.relationship(
|
| |
'Milestone', back_populates='bugs')
|
| |
The new SQLAlchemy naming convention fails with SQLAlchemy < 1.4 when executed
on SQLite (used in the test suite). The reason is that SQLite doesn't support
Boolean type natively, and SQLAlchemy automatically tries to create a
constraint, but that fails with a constraint name specified. SQLAlchemy 1.4
resolves this issue by not creating constraints at all (for non-native types).
You can read more about it here:
https://github.com/pallets/flask-sqlalchemy/pull/886
https://docs.sqlalchemy.org/en/14/core/constraints.html#configuring-naming-for-boolean-enum-and-other-schema-types
Since we need to support SQLAlchemy 1.3 at the moment (in Fedora 33 and 34),
out of several solutions I decided to name constraints for all Boolean types.
I also specified that the constraint should be created (no reason not to create
it, when we have it named already). Otherwise the contraints would stop being
created once upgraded to SQLAlchemy >= 1.4.
Fixes: https://pagure.io/fedora-qa/blockerbugs/issue/197