feat: track designer downloads and notifications

This commit is contained in:
2026-03-08 23:42:18 +08:00
parent 5ff85debdc
commit 147fc58409
9 changed files with 119 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
from sqlalchemy import Column, Integer, DateTime, ForeignKey
from sqlalchemy import Column, Integer, DateTime, ForeignKey, String, Float
from sqlalchemy.sql import func
from app.core.database import Base
@@ -9,5 +9,8 @@ class DownloadRecord(Base):
user_id = Column(Integer, ForeignKey("users.id"), nullable=False, index=True)
work_id = Column(Integer, ForeignKey("works.id"), nullable=False, index=True)
order_id = Column(Integer, ForeignKey("orders.id"), nullable=False, index=True)
designer_name = Column(String(100), nullable=True, index=True)
work_title = Column(String(255), nullable=True)
amount = Column(Float, default=0.0)
downloaded_at = Column(DateTime(timezone=True), server_default=func.now())