kopia lustrzana https://github.com/glidernet/ogn-python
Update model
rodzic
17bc9ed691
commit
d22d9209ac
|
@ -22,6 +22,8 @@ class Airport(Base):
|
|||
runway_length = Column(SmallInteger)
|
||||
frequency = Column(Float(precision=2))
|
||||
|
||||
border = Column('border', Geometry('POLYGON', srid=4326))
|
||||
|
||||
def __repr__(self):
|
||||
return "<Airport %s: %s,%s,%s,%s,%s,%s,%s,%s,%s,% s>" % (
|
||||
self.name,
|
||||
|
|
|
@ -27,10 +27,10 @@ class DeviceStats(Base):
|
|||
jumps = Column(SmallInteger)
|
||||
ambiguous = Column(Boolean)
|
||||
quality = Column(Float(precision=2))
|
||||
|
||||
|
||||
# Relation statistic data
|
||||
quality_offset = Column(Float(precision=2))
|
||||
|
||||
|
||||
# Ranking data
|
||||
max_altitude_ranking_worldwide = Column(Integer)
|
||||
max_altitude_ranking_country = Column(Integer)
|
||||
|
@ -44,7 +44,7 @@ class DeviceStats(Base):
|
|||
# Relations
|
||||
device_id = Column(Integer, ForeignKey('devices.id', ondelete='SET NULL'), index=True)
|
||||
device = relationship('Device', foreign_keys=[device_id], backref=backref('stats', order_by='DeviceStats.date.asc()'))
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return "<DeviceStats: %s,%s,%s,%s>" % (
|
||||
self.date,
|
||||
|
@ -52,4 +52,5 @@ class DeviceStats(Base):
|
|||
self.aircraft_beacon_count,
|
||||
self.max_altitude)
|
||||
|
||||
Index('ix_device_stats_date_device_id', DeviceStats.date, DeviceStats.device_id)
|
||||
|
||||
Index('ix_device_stats_date_device_id', DeviceStats.date, DeviceStats.device_id)
|
||||
|
|
|
@ -11,6 +11,7 @@ class Flight2D(Base):
|
|||
date = Column(Date, primary_key=True)
|
||||
|
||||
path_wkt = Column('path', Geometry('MULTILINESTRING', srid=4326))
|
||||
path_simple_wkt = Column('path_simple', Geometry('MULTILINESTRING', srid=4326)) # this is the path simplified with ST_Simplify(path, 0.0001)
|
||||
|
||||
# Relations
|
||||
device_id = Column(Integer, ForeignKey('devices.id', ondelete='SET NULL'), primary_key=True)
|
||||
|
|
|
@ -25,22 +25,19 @@ class ReceiverStats(Base):
|
|||
aircraft_count = Column(SmallInteger)
|
||||
max_distance = Column(Float)
|
||||
quality = Column(Float(precision=2))
|
||||
|
||||
|
||||
# Relation statistic data
|
||||
quality_offset = Column(Float(precision=2))
|
||||
|
||||
|
||||
# Ranking data
|
||||
aircraft_beacon_count_ranking_worldwide = Column(SmallInteger)
|
||||
aircraft_beacon_count_ranking_country = Column(SmallInteger)
|
||||
aircraft_count_ranking_worldwide = Column(SmallInteger)
|
||||
aircraft_count_ranking_country = Column(SmallInteger)
|
||||
max_distance_ranking_worldwide = Column(SmallInteger)
|
||||
max_distance_ranking_country = Column(SmallInteger)
|
||||
quality_ranking_worldwide = Column(Integer)
|
||||
quality_ranking_country = Column(Integer)
|
||||
aircraft_beacon_count_ranking = Column(SmallInteger)
|
||||
aircraft_count_ranking = Column(SmallInteger)
|
||||
max_distance_ranking = Column(SmallInteger)
|
||||
quality_ranking = Column(Integer)
|
||||
|
||||
# Relations
|
||||
receiver_id = Column(Integer, ForeignKey('receivers.id', ondelete='SET NULL'), index=True)
|
||||
receiver = relationship('Receiver', foreign_keys=[receiver_id], backref=backref('stats', order_by='ReceiverStats.date.asc()'))
|
||||
|
||||
Index('ix_receiver_stats_date_receiver_id', ReceiverStats.date, ReceiverStats.receiver_id)
|
||||
|
||||
Index('ix_receiver_stats_date_receiver_id', ReceiverStats.date, ReceiverStats.receiver_id)
|
||||
|
|
|
@ -18,6 +18,3 @@ class TakeoffLanding(Base):
|
|||
# Relations
|
||||
airport = relationship('Airport', foreign_keys=[airport_id], backref='takeoff_landings')
|
||||
device = relationship('Device', foreign_keys=[device_id], backref='takeoff_landings')
|
||||
|
||||
Index('ix_takeoff_landings_date_device_id_airport_id_timestamp', func.date(TakeoffLanding.timestamp), TakeoffLanding.device_id, TakeoffLanding.airport_id, TakeoffLanding.timestamp)
|
||||
Index('ix_takeoff_landings_date_device_id_timestamp_airport_id', func.date(TakeoffLanding.timestamp), TakeoffLanding.device_id, TakeoffLanding.timestamp, TakeoffLanding.airport_id)
|
Ładowanie…
Reference in New Issue