Skip to content

Commit

Permalink
Add rotation column to targetdb.field. Make ra/dec not null.
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jun 4, 2020
1 parent 03ed5d5 commit 5745af7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions python/sdssdb/peewee/sdss5db/targetdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions schema/sdss5db/targetdb/targetdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5745af7

Please sign in to comment.