Commit 0669474b authored by Elizabeth Myers's avatar Elizabeth Myers 💬
Browse files

Add emoji to the database

parent 317acdc5
......@@ -34,6 +34,8 @@ class StorageUser(Base):
'StorageGroupLine', foreign_keys='StorageGroupLine.user_id')
uploads = relationship(
'StorageUserUpload', foreign_keys='StorageUserUpload.user_id')
user_emoji = relationship(
'StorageEmoji', foreign_keys='StorageEmoji.uploader_id')
# required in order to access columns with server defaults
# or SQL expression defaults, subsequent to a flush, without
......@@ -192,6 +194,17 @@ class StorageGroupLine(Base):
__mapper_args__ = {'eager_defaults': True}
class StorageEmoji(Base):
__tablename__ = 'emoji'
id = Column(Integer, primary_key=True)
short_code = Column(String(32), unique=True, nullable=False)
pathname = String(64, unique=True, nullable=False)
create_date = Column(DateTime, server_default=func.now())
uploader_id = Column(Integer, ForeignKey('user.id', on_delete='SET NULL'))
uploader = relationship('StorageUser', back_populates='user_emoji')
engine = create_async_engine(
conf.database_db_url, echo=True
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment