Skip to content

Commit

Permalink
Add FK field from CatalogToSDSS_DR13_PhotoObj_Primary to SDSS_DR13_Ph…
Browse files Browse the repository at this point in the history
…otoObj
  • Loading branch information
albireox committed Jul 9, 2020
1 parent c4f2248 commit c1602bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Changelog

This document records the main changes to the ``sdssdb`` code.

* Add ``ForeignKeyField`` from ``CatalogToSDSS_DR13_PhotoObj_Primary`` directly to ``SDSS_DR13_PhotoObj``.

* :release:`0.4.4 <2020-07-07>`
* Add ``ForeignKeyField`` to ``TIC_v8`` where for all models in ``catalogdb`` connected to Gaia.
* Use ``autorollback=True`` by default in `.PeeweeDatabaseConnection`.
Expand Down
7 changes: 7 additions & 0 deletions python/sdssdb/peewee/sdss5db/catalogdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,4 +1082,11 @@ class Meta:
through_model=RelationalModel,
backref='+'))

if tname == 'sdss_dr13_photoobj_primary':
RelationalModel._meta.add_field('sdss_dr13_photoobj',
ForeignKeyField(SDSS_DR13_PhotoObj,
column_name='target_id',
field='objid',
backref='+'))

globals()[model_name] = RelationalModel

0 comments on commit c1602bc

Please sign in to comment.