|
@@ -0,0 +1,29 @@
|
|
|
+from sqlalchemy import Column, Integer, String, DateTime, Float, Boolean,Text
|
|
|
+from database import Base
|
|
|
+from datetime import datetime
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+class Incident(Base):
|
|
|
+ __tablename__ = 'incidents'
|
|
|
+
|
|
|
+ id = Column(Integer, autoincrement=True, primary_key=True)
|
|
|
+ title = Column(String(255), nullable=False, comment='事件标题')
|
|
|
+ incident_type = Column(String(100), nullable=False, comment='事件类型')
|
|
|
+ incident_level = Column(String(50), comment='事件等级')
|
|
|
+ status = Column(String(50), default='active', comment='事件状态')
|
|
|
+ occurrence_time = Column(DateTime, comment='事发时间')
|
|
|
+ report_time = Column(DateTime, default=datetime.now, comment='上报时间')
|
|
|
+ fatalities = Column(Integer, default=0, comment='死亡人数')
|
|
|
+ injuries = Column(Integer, default=0, comment='受伤人数')
|
|
|
+ missing = Column(Integer, default=0, comment='失联人数')
|
|
|
+ source = Column(String(255), comment='事件来源')
|
|
|
+ location = Column(String(255), comment='事发地点')
|
|
|
+ longitude = Column(Float, comment='经度')
|
|
|
+ latitude = Column(Float, comment='纬度')
|
|
|
+ summary = Column(Text, comment='事件概要')
|
|
|
+ recorded_by = Column(String(50), comment='记录用户ID')
|
|
|
+ del_flag = Column(String(1), default='0', comment='删除标志(0代表存在 2代表删除)')
|
|
|
+
|
|
|
+ class Config:
|
|
|
+ orm_mode = True
|