2021-04-21 16:47:18 +00:00
|
|
|
"""
|
|
|
|
This module defines the Authorization database class.
|
|
|
|
"""
|
|
|
|
|
|
|
|
from ..base import Base
|
|
|
|
|
|
|
|
|
|
|
|
class Authorization(Base.Model):
|
2021-05-06 12:12:11 +00:00
|
|
|
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)
|
2021-04-21 16:47:18 +00:00
|
|
|
# Relationships
|
|
|
|
repository = Base.relationship("Repository", back_populates="authorizations")
|
|
|
|
user = Base.relationship("User", back_populates="authorizations")
|