from sqlalchemy import Boolean, Column, Integer, String

from .session import Base


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))
    hashed_password = Column(String(200), nullable=False)
    is_active = Column(Boolean, default=True)
    is_superuser = Column(Boolean, default=False)

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)