improve: change db schema for settings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import Column, Text, Integer, String, DateTime, ForeignKey, Float, text, UniqueConstraint
|
||||
from sqlalchemy import Column, Text, Integer, String, DateTime, ForeignKey, UniqueConstraint
|
||||
from db.models import Base
|
||||
import datetime
|
||||
|
||||
@@ -13,6 +13,8 @@ class Markdown(Base):
|
||||
path_id = Column(Integer, ForeignKey('path.id'), nullable=False)
|
||||
order = Column(String(36), default=lambda: str(uuid.uuid4()))
|
||||
shortcut = Column(String(36), default="")
|
||||
template_id = Column(Integer, ForeignKey("markdown_template.id"), nullable=True)
|
||||
__table_args__ = (UniqueConstraint('path_id', 'title', name="unique_path_id_title"),)
|
||||
def to_dict(self):
|
||||
return {
|
||||
'id': self.id,
|
||||
@@ -22,6 +24,7 @@ class Markdown(Base):
|
||||
'path_id': self.path_id,
|
||||
'order': self.order,
|
||||
'shortcut': self.shortcut,
|
||||
'template_id': self.template_id,
|
||||
}
|
||||
__payload__ = {
|
||||
'dev': [
|
||||
|
||||
Reference in New Issue
Block a user