kc token public key/token issue, path root set to 1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#db/models/Path.py
|
||||
from sqlalchemy import Column, Text, LargeBinary, String, Integer, ForeignKey, UniqueConstraint
|
||||
from sqlalchemy import Column, String, Integer, ForeignKey, UniqueConstraint
|
||||
from db.models import Base
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ class Path(Base):
|
||||
__tablename__ = "path"
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
name = Column(String(50), nullable=False)
|
||||
parent_id = Column(Integer, ForeignKey("path.id"))
|
||||
parent_id = Column(Integer, ForeignKey("path.id"), nullable=True)
|
||||
__table_args__ = (UniqueConstraint("parent_id", "name", name="unique_parent_id_name"), )
|
||||
def to_dict(self):
|
||||
return {
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
from db import get_db
|
||||
|
||||
def insert_log(log_entry):
|
||||
with get_db() as db:
|
||||
db.add(log_entry)
|
||||
db.commit()
|
||||
with get_db() as session:
|
||||
session.add(log_entry)
|
||||
session.commit()
|
||||
Reference in New Issue
Block a user