2016-06-03 18:21:12 +00:00
|
|
|
from sqlalchemy import Boolean, Column, Integer, DateTime, ForeignKey
|
2016-05-22 05:23:22 +00:00
|
|
|
from sqlalchemy.orm import relationship
|
2015-11-11 07:04:42 +00:00
|
|
|
|
2016-05-22 05:23:22 +00:00
|
|
|
from .base import Base
|
2015-11-11 07:04:42 +00:00
|
|
|
|
|
|
|
|
2016-05-22 05:23:22 +00:00
|
|
|
class TakeoffLanding(Base):
|
2015-11-11 07:04:42 +00:00
|
|
|
__tablename__ = 'takeoff_landing'
|
|
|
|
|
2016-05-22 05:23:22 +00:00
|
|
|
id = Column(Integer, primary_key=True)
|
|
|
|
|
|
|
|
timestamp = Column(DateTime, index=True)
|
|
|
|
track = Column(Integer)
|
2015-11-11 07:04:42 +00:00
|
|
|
is_takeoff = Column(Boolean)
|
2016-05-22 05:23:22 +00:00
|
|
|
|
|
|
|
# Relations
|
|
|
|
airport_id = Column(Integer, ForeignKey('airport.id', ondelete='SET NULL'), index=True)
|
|
|
|
airport = relationship('Airport', foreign_keys=[airport_id])
|
|
|
|
|
|
|
|
device_id = Column(Integer, ForeignKey('device.id', ondelete='SET NULL'), index=True)
|
|
|
|
device = relationship('Device', foreign_keys=[device_id])
|