mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 15:31:15 -05:00
As per PR comments:
- Remove Organisation.services - added backref='services' to Services.organisation relationship and removed redundant foreign_keys argument.
This commit is contained in:
@@ -349,12 +349,6 @@ class Organisation(db.Model):
|
||||
active = db.Column(db.Boolean, nullable=False, default=True)
|
||||
created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow)
|
||||
updated_at = db.Column(db.DateTime, nullable=True, onupdate=datetime.datetime.utcnow)
|
||||
|
||||
services = db.relationship(
|
||||
'Service',
|
||||
uselist=True,
|
||||
backref=db.backref('services'))
|
||||
|
||||
agreement_signed = db.Column(db.Boolean, nullable=True)
|
||||
agreement_signed_at = db.Column(db.DateTime, nullable=True)
|
||||
agreement_signed_by_id = db.Column(
|
||||
@@ -480,7 +474,7 @@ class Service(db.Model, Versioned):
|
||||
go_live_at = db.Column(db.DateTime, nullable=True)
|
||||
|
||||
organisation_id = db.Column(UUID(as_uuid=True), db.ForeignKey('organisation.id'), index=True, nullable=True)
|
||||
organisation = db.relationship('Organisation', foreign_keys=[organisation_id])
|
||||
organisation = db.relationship('Organisation', backref='services')
|
||||
|
||||
email_branding = db.relationship(
|
||||
'EmailBranding',
|
||||
|
||||
Reference in New Issue
Block a user