2022-04-29 23:27:35 +02:00
|
|
|
from sqlalchemy import Column, Integer, Boolean, ForeignKey
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
from platypush.common.db import Base
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
from ._base import Entity
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-12-04 16:27:28 +01:00
|
|
|
|
|
|
|
if 'device' not in Base.metadata:
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-10-10 01:38:15 +02:00
|
|
|
class Device(Entity):
|
|
|
|
__tablename__ = 'device'
|
2022-04-04 16:50:17 +02:00
|
|
|
|
2022-10-10 01:38:15 +02:00
|
|
|
id = Column(
|
|
|
|
Integer, ForeignKey(Entity.id, ondelete='CASCADE'), primary_key=True
|
|
|
|
)
|
|
|
|
reachable = Column(Boolean, default=True)
|
|
|
|
|
|
|
|
__mapper_args__ = {
|
|
|
|
'polymorphic_identity': __tablename__,
|
|
|
|
}
|