backend merge

This commit is contained in:
2023-09-23 06:38:00 +00:00
parent 6902079866
commit 7f7d625fdd
4 changed files with 180 additions and 10 deletions

View File

@@ -1,12 +1,16 @@
from sqlalchemy import Boolean, Column, Integer, String
from .session import Base
from sqlalchemy import Boolean, Column, Integer, String, DateTime
from sqlalchemy.ext.declarative import as_declarative
from datetime import datetime
@as_declarative()
class Base:
id = Column(Integer, primary_key=True, index=True)
create_time = Column(DateTime, default=datetime.now)
update_time = Column(DateTime, default=datetime.now, onupdate=datetime.now)
class User(Base):
__tablename__ = "user"
id = Column(Integer, primary_key=True, index=True)
email = Column(String(50), unique=True, index=True, nullable=False)
first_name = Column(String(100))
last_name = Column(String(100))
@@ -17,15 +21,31 @@ class User(Base):
class AppSetting(Base):
__tablename__ = "appsetting"
id = Column(Integer, primary_key=True, index=True)
appid = Column(String(100), index=True, nullable=False)
setting = Column(String(1000))
class Kintone(Base):
__tablename__ = "kintone"
id = Column(Integer, primary_key=True, index=True)
type = Column(Integer, index=True, nullable=False)
name = Column(String(100), nullable=False)
desc = Column(String)
content = Column(String)
content = Column(String)
class Action(Base):
__tablename__ = "action"
name = Column(String(100), index=True, nullable=False)
title = Column(String(200))
subtitle = Column(String(500))
outputpoints = Column(String)
property = Column(String)
class Flow(Base):
__tablename__ = "flow"
flowid = Column(String(100), index=True, nullable=False)
appid = Column(String(100), index=True, nullable=False)
eventid = Column(String(100), index=True, nullable=False)
name = Column(String(200))
content = Column(String)