zd / app /models /dictionary_entry.py
Juna190825's picture
Create app/models/dictionary_entry.py
ab9a9b9 verified
raw
history blame contribute delete
775 Bytes
from sqlalchemy import Column, Integer, String, Text, Boolean, DateTime
from datetime import datetime
from app.db import Base
class DictionaryEntry(Base):
__tablename__ = "dictionary_entries"
id = Column(Integer, primary_key=True, index=True)
headword_zomi = Column(String, index=True, nullable=False)
headword_english = Column(String, index=True, nullable=False)
translations = Column(Text, nullable=True) # comma-separated list
part_of_speech = Column(String, nullable=True)
definition = Column(Text, nullable=False)
definition_translation = Column(Text, nullable=True)
is_approved = Column(Boolean, default=True)
created_at = Column(DateTime, default=datetime.utcnow)
updated_at = Column(DateTime, default=datetime.utcnow)