diff --git a/python/sdssdb/peewee/sdss5db/opsdb.py b/python/sdssdb/peewee/sdss5db/opsdb.py index d1ffcf47..20cec5c8 100644 --- a/python/sdssdb/peewee/sdss5db/opsdb.py +++ b/python/sdssdb/peewee/sdss5db/opsdb.py @@ -339,6 +339,7 @@ class Overhead(OpsdbBase): column_name='configuration_id', field='configuration_id', backref='overheads') + macro_id = IntegerField() macro = TextField() stage = TextField() start_time = DateTimeTZField() diff --git a/python/sdssdb/sqlalchemy/sdss5db/opsdb.py b/python/sdssdb/sqlalchemy/sdss5db/opsdb.py index 7f7d5e74..5297e3e4 100644 --- a/python/sdssdb/sqlalchemy/sdss5db/opsdb.py +++ b/python/sdssdb/sqlalchemy/sdss5db/opsdb.py @@ -220,8 +220,7 @@ class Quickred(Base): class Overhead(Base): __tablename__ = 'overhead' - pk = Column(Integer, primary_key=True, server_default=text("nextval('targetdb.overhead_pk_seq'::regclass)")) - configuration_id = Column(ForeignKey('targetdb.overhead.configuration_id', ondelete='CASCADE', onupdate='CASCADE', deferrable=True, initially='DEFERRED'), index=True) + macro_id = Column(Integer) macro = Column(Text) stage = Column(Text) start_time = Column(DateTime) diff --git a/schema/sdss5db/opsdb/opsdb.sql b/schema/sdss5db/opsdb/opsdb.sql index 618e59c0..45cc1a72 100644 --- a/schema/sdss5db/opsdb/opsdb.sql +++ b/schema/sdss5db/opsdb/opsdb.sql @@ -124,6 +124,7 @@ CREATE TABLE opsdb.priority_version( CREATE TABLE opsdb.overhead( pk SERIAL PRIMARY KEY NOT NULL, configuration_id INTEGER, + macro_id INTEGER, macro TEXT, stage TEXT, start_time TIMESTAMPTZ,