Spaces:
Sleeping
Sleeping
| from sqlalchemy import Column, Integer, String, Text, ForeignKey, DateTime | |
| from sqlalchemy.sql import text | |
| from database import Base | |
| class Contact(Base): | |
| __tablename__ = "contacts" | |
| id = Column(Integer, primary_key=True, index=True, comment='主键ID') | |
| company_code = Column(String(50), ForeignKey("companies.company_code"), nullable=False, server_default="", index=True, comment='公司编码') | |
| contact_name = Column(String(100), nullable=False, server_default="", comment='联系人姓名') | |
| phone = Column(String(50), nullable=False, server_default="", comment='联系电话') | |
| email = Column(String(100), nullable=False, server_default="", comment='电子邮箱') | |
| position = Column(String(100), nullable=False, server_default="", comment='职位') | |
| department = Column(String(100), nullable=False, server_default="", comment='部门') | |
| facebook = Column(String(255), nullable=False, server_default="", comment='Facebook账号') | |
| facebook_api_key = Column(String(255), nullable=False, server_default="", comment='Facebook API Key') | |
| facebook_app_secret = Column(String(255), nullable=False, server_default="", comment='Facebook App Secret') | |
| tiktok = Column(String(255), nullable=False, server_default="", comment='TikTok账号') | |
| tiktok_api_key = Column(String(255), nullable=False, server_default="", comment='TikTok API Key') | |
| tiktok_app_secret = Column(String(255), nullable=False, server_default="", comment='TikTok App Secret') | |
| whatsapp = Column(String(50), nullable=False, server_default="", comment='WhatsApp账号') | |
| whatsapp_api_key = Column(String(255), nullable=False, server_default="", comment='WhatsApp API Key') | |
| whatsapp_app_secret = Column(String(255), nullable=False, server_default="", comment='WhatsApp App Secret') | |
| wechat = Column(String(100), nullable=False, server_default="", comment='微信账号') | |
| linkedin = Column(String(255), nullable=False, server_default="", comment='LinkedIn账号') | |
| note = Column(Text, nullable=False, default="", comment='备注') | |
| created_at = Column(DateTime(timezone=True), nullable=False, server_default=text('CURRENT_TIMESTAMP'), comment='创建时间') | |
| updated_at = Column(DateTime(timezone=True), nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), comment='更新时间') | |