diff options
author | Cody Hiar <cody@hiar.ca> | 2021-02-03 14:58:59 -0700 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2021-02-03 14:58:59 -0700 |
commit | 2cf71f2ec7d2d6133b9ad2346e5e3ccb1410a3a0 (patch) | |
tree | f51b52f4e3878f398d7fcff1f1c605604c4b446a /mappings.py | |
parent | 2b007a5a500b635ddcfe4b9a512777f3d21fa6b6 (diff) |
Initial working version of archiver
Diffstat (limited to 'mappings.py')
-rw-r--r-- | mappings.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mappings.py b/mappings.py index e80756f..ae1f0b5 100644 --- a/mappings.py +++ b/mappings.py @@ -1,5 +1,5 @@ """Database for project.""" -from sqlalchemy import Column, Integer, String, create_engine +from sqlalchemy import Column, Integer, String, create_engine, DateTime from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker @@ -18,14 +18,16 @@ class Message(Base): type = Column(String) username = Column(String) text = Column(String) + timestamp = Column(DateTime) # ---------------------------------------------------------------------- - def __init__(self, iid, type, username, text): + def __init__(self, iid, type, username, text, timestamp): """Create record.""" self.iid = iid self.type = type self.username = username self.text = text + self.timestamp = timestamp def create_tables(): |