22 lines
694 B
Python
22 lines
694 B
Python
|
|
"""Asset 模型。"""
|
||
|
|
|
||
|
|
from sqlalchemy import Column, DateTime, Integer, String, Text
|
||
|
|
|
||
|
|
from app.core.db import Base, utc_now
|
||
|
|
|
||
|
|
|
||
|
|
class Asset(Base):
|
||
|
|
__tablename__ = "assets"
|
||
|
|
|
||
|
|
id = Column(String, primary_key=True)
|
||
|
|
asset_type = Column(String, nullable=False)
|
||
|
|
storage_key = Column(String, nullable=False)
|
||
|
|
url = Column(String, nullable=True)
|
||
|
|
provider = Column(String, nullable=True)
|
||
|
|
style_profile = Column(String, nullable=True)
|
||
|
|
prompt_final = Column(Text, nullable=True)
|
||
|
|
status = Column(String, nullable=False)
|
||
|
|
width = Column(Integer, nullable=True)
|
||
|
|
height = Column(Integer, nullable=True)
|
||
|
|
created_at = Column(DateTime(timezone=True), default=utc_now)
|