SiddarthaRachakonda commited on
Commit
3cf4d2c
1 Parent(s): 155d00e

added Message in models

Browse files
Files changed (1) hide show
  1. app/models.py +6 -1
app/models.py CHANGED
@@ -18,4 +18,9 @@ class User(Base):
18
  # attribute as a foreign key.
19
  class Message(Base):
20
  __tablename__ = "messages"
21
- pass
 
 
 
 
 
 
18
  # attribute as a foreign key.
19
  class Message(Base):
20
  __tablename__ = "messages"
21
+ id = Column(Integer, primary_key=True, index=True)
22
+ message = Column(String)
23
+ type = Column(String)
24
+ timestamp = Column(DateTime)
25
+ user_id = Column(Integer, ForeignKey("users.id"))
26
+ user = relationship("User", back_populates="messages")