Source code for toardb.timeseries.models_programme
# SPDX-FileCopyrightText: 2021 Forschungszentrum Jülich GmbH
# SPDX-License-Identifier: MIT
"""
class TimeseriesProgramme (Base)
================================
"""
from sqlalchemy import Column, Integer, String, Text, Sequence
from sqlalchemy.orm import relationship
from toardb.base import Base
TIMESERIES_PROGRAMMES_ID_SEQ = Sequence('timeseries_programmes_id_seq') # define sequence explicitly
[docs]class TimeseriesProgramme(Base):
"""
Table "public.timeseries_programmes"
+-------------+------------------------+-----------+----------+---------------------------------------------------+
| Column | Type | Collation | Nullable | Default |
+=============+========================+===========+==========+===================================================+
| id | integer | | not null | nextval('timeseries_programmes_id_seq'::regclass) |
+-------------+------------------------+-----------+----------+---------------------------------------------------+
| name | character varying(32) | | not null | |
+-------------+------------------------+-----------+----------+---------------------------------------------------+
| longname | character varying(128) | | not null | |
+-------------+------------------------+-----------+----------+---------------------------------------------------+
| homepage | character varying(200) | | not null | |
+-------------+------------------------+-----------+----------+---------------------------------------------------+
| description | text | | not null | |
+-------------+------------------------+-----------+----------+---------------------------------------------------+
Indexes:
"timeseries_programmes_pkey" PRIMARY KEY, btree (id)
"""
__tablename__ = 'timeseries_programmes'
id = Column(Integer, TIMESERIES_PROGRAMMES_ID_SEQ, primary_key=True, server_default=TIMESERIES_PROGRAMMES_ID_SEQ.next_value())
name = Column(String(32), nullable=False)
longname = Column(String(128), nullable=False)
homepage = Column(String(200), nullable=False)
description = Column(Text, nullable=False)
timeseries = relationship("Timeseries", back_populates="programme")