mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Delete JobStatistics model
Also changed the delete_service_and_all_associated_db_objects function from the services DAO to remove reference to JobStatistics table.
This commit is contained in:
@@ -20,7 +20,6 @@ from app.models import (
|
||||
InboundNumber,
|
||||
InvitedUser,
|
||||
Job,
|
||||
JobStatistics,
|
||||
Notification,
|
||||
NotificationHistory,
|
||||
Permission,
|
||||
@@ -220,10 +219,6 @@ def delete_service_and_all_associated_db_objects(service):
|
||||
query.delete(synchronize_session=False)
|
||||
db.session.commit()
|
||||
|
||||
job_stats = JobStatistics.query.join(Job).filter(Job.service_id == service.id)
|
||||
list(map(db.session.delete, job_stats))
|
||||
db.session.commit()
|
||||
|
||||
subq = db.session.query(Template.id).filter_by(service=service).subquery()
|
||||
_delete_commit(TemplateRedacted.query.filter(TemplateRedacted.template_id.in_(subq)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user