diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 69021b9f..f8e34b1c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ This document records the main changes to the ``sdssdb`` code. * Add schema for ``gaia_dr2_ruwe``. * Rename ``targetdb.program`` to ``carton``, and ``survey`` to ``mapper``. Add ``priority`` field in ``carton_to_target``. * Add ``z`` column to ``targetdb.magnitude``. +* Add ``rotation`` column to ``targetdb.field``. * :release:`0.4.2 <2020-05-29>` * Add ``targetdb.version.tag`` column. diff --git a/python/sdssdb/peewee/sdss5db/targetdb.py b/python/sdssdb/peewee/sdss5db/targetdb.py index 66117297..0ec5e3b3 100644 --- a/python/sdssdb/peewee/sdss5db/targetdb.py +++ b/python/sdssdb/peewee/sdss5db/targetdb.py @@ -61,17 +61,18 @@ class Meta: class Field(TargetdbBase): + pk = AutoField() + racen = DoubleField(null=False) + deccen = DoubleField(null=False) + rotation = FloatField(null=True) cadence = ForeignKeyField(column_name='cadence_pk', field='pk', model=Cadence, null=True) - deccen = DoubleField(null=True) observatory = ForeignKeyField(column_name='observatory_pk', field='pk', model=Observatory, null=True) - pk = AutoField() - racen = DoubleField(null=True) version = ForeignKeyField(column_name='version_pk', field='pk', model=Version) diff --git a/schema/sdss5db/targetdb/targetdb.sql b/schema/sdss5db/targetdb/targetdb.sql index 0e5f7945..645338a9 100644 --- a/schema/sdss5db/targetdb/targetdb.sql +++ b/schema/sdss5db/targetdb/targetdb.sql @@ -116,8 +116,9 @@ CREATE TABLE targetdb.design ( CREATE TABLE targetdb.field ( pk SERIAL PRIMARY KEY NOT NULL, - racen DOUBLE PRECISION, - deccen DOUBLE PRECISION, + racen DOUBLE PRECISION NOT NULL, + deccen DOUBLE PRECISION NOT NULL, + rotation REAL, version_pk SMALLINT, cadence_pk SMALLINT, observatory_pk SMALLINT);