1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-23 05:24:18 +00:00
pds-2021-g2-nest/code/backend/nest_backend/database/tables/Authorization.py

13 lines
507 B
Python
Raw Normal View History

"""
This module defines the Authorization database class.
"""
from ..base import Base
class Authorization(Base.Model):
rid = Base.Column(Base.Integer, Base.ForeignKey("repository.id", ondelete="CASCADE"), primary_key=True)
email = Base.Column(Base.String, Base.ForeignKey("user.email", ondelete="CASCADE"), primary_key=True)
# Relationships
repository = Base.relationship("Repository", back_populates="authorizations")
user = Base.relationship("User", back_populates="authorizations")