Skip to content

Commit

Permalink
updating orms for schema changes
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 committed Sep 23, 2024
1 parent 0f204ac commit e98e5f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion python/sdssdb/peewee/sdss5db/vizdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# Database: sdss5db
# Peewee version: 3.13.2

from peewee import (AutoField, BigIntegerField, BooleanField,
from peewee import (AutoField, BigIntegerField, BooleanField, DateField,
DoubleField, IntegerField, SmallIntegerField, TextField)
from playhouse.postgres_ext import ArrayField

Expand All @@ -34,6 +34,7 @@ class SDSSidFlat(VizBase):
pk = AutoField()
ra_catalogid = DoubleField(null=True)
dec_catalogid = DoubleField(null=True)
rank = IntegerField(null=True)

class Meta:
table_name = 'sdss_id_flat'
Expand All @@ -48,6 +49,7 @@ class SDSSidStacked(VizBase):
ra_sdss_id = DoubleField(null=True)
dec_sdss_id = DoubleField(null=True)
sdss_id = BigIntegerField(null=False, primary_key=True)
last_updated = DateField(null=True)

class Meta:
table_name = 'sdss_id_stacked'
Expand All @@ -60,8 +62,12 @@ class SDSSidToPipes(VizBase):
sdss_id = BigIntegerField(null=False)
in_boss = BooleanField(null=False)
in_apogee = BooleanField(null=False)
in_bvs = BooleanField(null=False)
in_astra = BooleanField(null=False)
has_been_observed = BooleanField(null=False)
release = TextField(null=True)
obs = TextField(null=True)
mjd = IntegerField(null=True)

class Meta:
table_name = 'sdssid_to_pipes'
Expand Down
9 changes: 8 additions & 1 deletion python/sdssdb/sqlalchemy/sdss5db/vizdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


from sqlalchemy.ext.declarative import AbstractConcreteBase, declared_attr
from sqlalchemy import (ARRAY, BigInteger, Boolean, Column, Float, Integer,
from sqlalchemy import (ARRAY, BigInteger, Boolean, Column, Date, Float, Integer,
SmallInteger, Text, text)

from sdssdb.sqlalchemy.sdss5db import SDSS5dbBase, database
Expand Down Expand Up @@ -53,6 +53,8 @@ class SDSSidFlat(Base):
pk = Column('pk', BigInteger, primary_key=True)
ra_catalogid = Column('ra_catalogid', Float(53))
dec_catalogid = Column('dec_catalogid', Float(53))
rank = Column('rank', Integer)



class SDSSidStacked(Base):
Expand All @@ -65,6 +67,7 @@ class SDSSidStacked(Base):
ra_sdss_id = Column('ra_sdss_id', Float(53))
dec_sdss_id = Column('dec_sdss_id', Float(53))
sdss_id = Column('sdss_id', BigInteger, primary_key=True)
last_updated = Column('last_updated', Date)


class SDSSidToPipes(Base):
Expand All @@ -75,8 +78,12 @@ class SDSSidToPipes(Base):
sdss_id = Column('sdss_id', BigInteger)
in_boss = Column('in_boss', Boolean)
in_apogee = Column('in_apogee', Boolean)
in_bvs = Column('in_bvs', Boolean)
in_astra = Column('in_astra', Boolean)
has_been_observed = Column('has_been_observed', Boolean)
mjd = Column('release', Text)
mjd = Column('obs', Text)
mjd = Column('mjd', Integer)


class Releases(Base):
Expand Down

0 comments on commit e98e5f0

Please sign in to comment.