Coverage for toardb/timeseries/models_programme.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-03 20:32 +0000

1# SPDX-FileCopyrightText: 2021 Forschungszentrum Jülich GmbH 

2# SPDX-License-Identifier: MIT 

3 

4""" 

5class TimeseriesProgramme (Base) 

6================================ 

7""" 

8from sqlalchemy import Column, Integer, String, Text, Sequence 

9from sqlalchemy.orm import relationship 

10from toardb.base import Base 

11 

12TIMESERIES_PROGRAMMES_ID_SEQ = Sequence('timeseries_programmes_id_seq') # define sequence explicitly 

13class TimeseriesProgramme(Base): 

14 """ 

15 Table "public.timeseries_programmes" 

16 

17 +-------------+------------------------+-----------+----------+---------------------------------------------------+ 

18 | Column | Type | Collation | Nullable | Default | 

19 +=============+========================+===========+==========+===================================================+ 

20 | id | integer | | not null | nextval('timeseries_programmes_id_seq'::regclass) | 

21 +-------------+------------------------+-----------+----------+---------------------------------------------------+ 

22 | name | character varying(32) | | not null | | 

23 +-------------+------------------------+-----------+----------+---------------------------------------------------+ 

24 | longname | character varying(128) | | not null | | 

25 +-------------+------------------------+-----------+----------+---------------------------------------------------+ 

26 | homepage | character varying(200) | | not null | | 

27 +-------------+------------------------+-----------+----------+---------------------------------------------------+ 

28 | description | text | | not null | | 

29 +-------------+------------------------+-----------+----------+---------------------------------------------------+ 

30 

31 Indexes: 

32 "timeseries_programmes_pkey" PRIMARY KEY, btree (id) 

33 """ 

34 __tablename__ = 'timeseries_programmes' 

35 

36 id = Column(Integer, TIMESERIES_PROGRAMMES_ID_SEQ, primary_key=True, server_default=TIMESERIES_PROGRAMMES_ID_SEQ.next_value()) 

37 name = Column(String(32), nullable=False) 

38 longname = Column(String(128), nullable=False) 

39 homepage = Column(String(200), nullable=False) 

40 description = Column(Text, nullable=False) 

41 

42 timeseries = relationship("Timeseries", back_populates="programme")