improve: change db schema for settings

This commit is contained in:
h z
2025-03-20 13:58:24 +00:00
parent 864b78641b
commit e7000f0b2e
13 changed files with 361 additions and 42 deletions

18
db/models/PathTemplate.py Normal file
View File

@@ -0,0 +1,18 @@
from sqlalchemy import Column, Integer, Text, UniqueConstraint, String
from db.models import Base
class PathTemplate(Base):
__tablename__ = 'path_template'
id = Column(Integer, primary_key=True)
title = Column(String(255), nullable=False)
structure = Column(Text, nullable=False)
__table_args__ = (UniqueConstraint("title", name="unique_title"),)
def to_dict(self):
return {
'id': self.id,
'title': self.title,
'structure': self.structure
}