server/db: maintain order of tag aliases

First alias has a special meaning in certain contexts, such as post
serialization, where only one alias is chosen to show to the client.
This commit is contained in:
rr- 2016-05-11 18:32:53 +02:00
parent 299055c427
commit 59ae0a4c9a

View file

@ -48,7 +48,11 @@ class Tag(Base):
last_edit_time = Column('last_edit_time', DateTime)
category = relationship('TagCategory', lazy='joined')
names = relationship('TagName', cascade='all, delete-orphan', lazy='joined')
names = relationship(
'TagName',
cascade='all,delete-orphan',
lazy='joined',
order_by='TagName.tag_name_id')
suggestions = relationship(
'Tag',
secondary='tag_suggestion',