Database Layout#

This page shows the complete database schema diagram. The diagram is auto-generated from SQLAlchemy models using eralchemy2 and shows all tables and their relationships.

How to Read the Diagram#

  • Boxes represent database tables

  • Lines represent foreign key relationships

  • Arrows point from child table (with foreign key) to parent table (referenced)

  • Polymorphic inheritance is shown with “type” discriminator columns

  • The diagram is comprehensive but complex - the concept pages provide explanations of subsystems

Schema Diagram#

CCAT Operations Database Schema

Note: If the diagram is not visible, run python -m ccat_ops_db.render_database_schema to generate it.

Major Table Groups#

The database is organized into several major groups:

Observatory

Observatory, Telescope, Instrument, InstrumentModule

Programs

ObservingProgram, SubObservingProgram, ObsUnit, ExecutedObsUnit

Sources

Source, FixedSource, SolarSystemObject, ConstantElevationSource

Data

RawDataFile, RawDataPackage, DataTransferPackage

Locations

Site, DataLocation, DiskDataLocation, S3DataLocation, TapeDataLocation

Transfers

DataTransferRoute, DataTransfer, LongTermArchiveTransfer, StagingJob

Physical Copies

PhysicalCopy, RawDataFilePhysicalCopy, RawDataPackagePhysicalCopy, DataTransferPackagePhysicalCopy

Configuration

ObservationConfiguration, InstrumentModuleConfiguration

Access

User, Role, ApiToken

How the Diagram is Generated#

The diagram is generated by the render_database_schema.py module:

Command:

python -m ccat_ops_db.render_database_schema

Build Integration: The main documentation Makefile should run this during build to regenerate the diagram when models change.

Note: If you update models, rebuild the documentation to regenerate the diagram.