Skip to content

Commit

Permalink
Set a 1:1 relations b/w APIKEYS and SERVICES table
Browse files Browse the repository at this point in the history
Nuke the columns `name` and `expiry_date` as they would no longer be needed

Signed-off-by: Akashdeep Dhar <[email protected]>
  • Loading branch information
gridhead committed Jul 12, 2024
1 parent ba14c64 commit 87338ed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions webhook_to_fedora_messaging/models/apikey.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class APIKey(Base, UUIDCreatableMixin, CreatableMixin):
__tablename__ = "apikeys"

id = Column(Integer, primary_key=True, nullable=False)
user_id = Column(Integer, ForeignKey("users.id", ondelete="CASCADE"), unique=False, nullable=False)
name = Column(UnicodeText, nullable=False)
service_id = Column(Integer, ForeignKey("services.id", ondelete="CASCADE"), unique=True, nullable=False)
token = Column(UnicodeText, unique=True, nullable=False, default=uuid4().hex)
expiry_date = Column(DateTime, nullable=True)
disabled = Column(Boolean, nullable=False, default=False)

0 comments on commit 87338ed

Please sign in to comment.