123456789101112131415161718192021222324 |
- from sqlalchemy import Column, Integer, String, text
- from sqlalchemy.dialects.postgresql import JSONB
- from db.base_class import Base
- class KGNode(Base):
- __tablename__ = 'kg_nodes'
- id = Column(Integer, primary_key=True, server_default=text("nextval('kg_ids_seq')"))
- name = Column(String(64), nullable=False)
- category = Column(String(64), nullable=False)
- layout = Column(String(100))
- version = Column(String(16))
- status = Column(Integer, nullable=False, server_default=text('0'))
- embedding = Column(JSONB)
- __table_args__ = (
- {'schema': 'public'},
- {
- 'postgresql_partition_by': 'LIST (category)',
- 'postgresql_with': {
- 'fillfactor': '50'
- }
- }
- )
|