feature1
This commit is contained in:
@@ -38,3 +38,23 @@ class UserApplication(Base):
|
||||
|
||||
user = relationship("User", back_populates="applications")
|
||||
application = relationship("Application", back_populates="users")
|
||||
|
||||
# Association table for AccessRequest and Application
|
||||
class RequestApplication(Base):
|
||||
__tablename__ = "request_applications"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
request_id = Column(Integer, ForeignKey("access_requests.id"))
|
||||
application_id = Column(Integer, ForeignKey("applications.id"))
|
||||
|
||||
class AccessRequest(Base):
|
||||
__tablename__ = "access_requests"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
username = Column(String, index=True)
|
||||
email = Column(String, index=True)
|
||||
hashed_password = Column(String)
|
||||
status = Column(String, default="pending") # pending, approved, rejected
|
||||
created_at = Column(DateTime, default=datetime.utcnow)
|
||||
|
||||
requested_apps = relationship("Application", secondary="request_applications")
|
||||
|
||||
Reference in New Issue
Block a user