初始化鸿蒙应用展示平台项目 - 前后端分离架构
This commit is contained in:
15
backend/app/models/app_metrics.py
Normal file
15
backend/app/models/app_metrics.py
Normal file
@@ -0,0 +1,15 @@
|
||||
from sqlalchemy import Column, String, Integer, BigInteger, DateTime, DECIMAL, ForeignKey
|
||||
from sqlalchemy.sql import func
|
||||
from app.database import Base
|
||||
|
||||
class AppMetrics(Base):
|
||||
__tablename__ = "app_metrics"
|
||||
|
||||
id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||
app_id = Column(String(50), ForeignKey("app_info.app_id", ondelete="CASCADE"), nullable=False, index=True)
|
||||
pkg_name = Column(String(255), ForeignKey("app_info.pkg_name", ondelete="CASCADE"), nullable=False, index=True)
|
||||
version = Column(String(50), nullable=False)
|
||||
size_bytes = Column(BigInteger, nullable=False)
|
||||
download_count = Column(BigInteger, nullable=False, index=True)
|
||||
release_date = Column(BigInteger, nullable=False)
|
||||
created_at = Column(DateTime, nullable=False, server_default=func.now(), index=True)
|
||||
Reference in New Issue
Block a user