data_table.py 781 B

12345678910111213141516171819202122232425
  1. from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
  2. from app.models.database import BaseModel
  3. class DataTable(BaseModel):
  4. __tablename__ = "data_table"
  5. id = Column(Integer, primary_key=True, index=True)
  6. # 数据库名称
  7. database_name = Column(String)
  8. # 数据表名称
  9. table_name = Column(String, nullable=False)
  10. # 源(0:数据湖;1:ailab)
  11. source = Column(Integer, nullable=False)
  12. # 类型(0:被分享;1:自建;2:导入)
  13. type = Column(Integer, nullable=False)
  14. # 项目id
  15. project_id = Column(String, nullable=False)
  16. # hdfs的表的path
  17. table_path = Column(String)
  18. # 创建时间
  19. create_time = Column(Integer, nullable=False)
  20. # 用户id
  21. user_id = Column(String, nullable=False)