1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00
pds-2021-g2-nest/code/backend/nest_backend/database/tables/Notification.py

16 lines
446 B
Python
Raw Normal View History

"""
This module defines the Notification database class.
"""
2021-05-07 17:46:14 +00:00
from ..base import ext
2021-05-07 17:46:14 +00:00
class Notification(ext.Model):
__tablename__ = "notification"
2021-05-07 17:46:14 +00:00
id = ext.Column(ext.Integer, primary_key=True)
ora = ext.Column(ext.DateTime, nullable=False)
# Foreign Key
2021-05-07 17:46:14 +00:00
alert_id = ext.Column(ext.Integer, ext.ForeignKey("alert.id"), nullable=False)
# Relationships
2021-05-07 17:46:14 +00:00
alert = ext.relationship("Alert", back_populates="notifications")