Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/obsproc 110 #104

Merged
merged 6 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""add partner column in the proposal table and partner table

Check warning

Code scanning / Pylint (reported by Codacy)

Module name "20241220-145409_0b72e62efd44_add_partner_column_in_the_proposal_" doesn't conform to snake_case naming style Warning

Module name "20241220-145409_0b72e62efd44_add_partner_column_in_the_proposal_" doesn't conform to snake_case naming style

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Module name "20241220-145409_0b72e62efd44_add_partner_column_in_the_proposal_" doesn't conform to snake_case naming style Warning

Module name "20241220-145409_0b72e62efd44_add_partner_column_in_the_proposal_" doesn't conform to snake_case naming style

Revision ID: 0b72e62efd44
Revises: b68482e38606
Create Date: 2024-12-20 14:54:09.851011

"""
from alembic import op

Check warning

Code scanning / Pylint (reported by Codacy)

No name 'op' in module 'alembic' Warning

No name 'op' in module 'alembic'
import sqlalchemy as sa

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'sqlalchemy' (import-error) Warning

Unable to import 'sqlalchemy' (import-error)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

third party import "import sqlalchemy as sa" should be placed before "from alembic import op" Warning

third party import "import sqlalchemy as sa" should be placed before "from alembic import op"


# revision identifiers, used by Alembic.
revision = '0b72e62efd44'

Check warning

Code scanning / Pylint (reported by Codacy)

Constant name "revision" doesn't conform to UPPER_CASE naming style Warning

Constant name "revision" doesn't conform to UPPER_CASE naming style

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "revision" doesn't conform to UPPER_CASE naming style Warning

Constant name "revision" doesn't conform to UPPER_CASE naming style
down_revision = 'b68482e38606'

Check warning

Code scanning / Pylint (reported by Codacy)

Constant name "down_revision" doesn't conform to UPPER_CASE naming style Warning

Constant name "down_revision" doesn't conform to UPPER_CASE naming style

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "down_revision" doesn't conform to UPPER_CASE naming style Warning

Constant name "down_revision" doesn't conform to UPPER_CASE naming style
branch_labels = None

Check warning

Code scanning / Pylint (reported by Codacy)

Constant name "branch_labels" doesn't conform to UPPER_CASE naming style Warning

Constant name "branch_labels" doesn't conform to UPPER_CASE naming style

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "branch_labels" doesn't conform to UPPER_CASE naming style Warning

Constant name "branch_labels" doesn't conform to UPPER_CASE naming style
depends_on = None

Check warning

Code scanning / Pylint (reported by Codacy)

Constant name "depends_on" doesn't conform to UPPER_CASE naming style Warning

Constant name "depends_on" doesn't conform to UPPER_CASE naming style

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "depends_on" doesn't conform to UPPER_CASE naming style Warning

Constant name "depends_on" doesn't conform to UPPER_CASE naming style


def upgrade():

Check warning

Code scanning / Pylint (reported by Codacy)

Missing function docstring Warning

Missing function docstring

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing function or method docstring Warning

Missing function or method docstring
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('partner',
sa.Column('partner_id', sa.Integer(), autoincrement=False, nullable=False, comment='Unique identifier of the partner'),

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (123/100) Warning

Line too long (123/100)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (123/100) Warning

Line too long (123/100)
sa.Column('partner_name', sa.String(), nullable=False, comment='Name of the partner (e.g., subaru, gemini, keck, and uh)'),

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (127/100) Warning

Line too long (127/100)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (127/100) Warning

Line too long (127/100)
sa.Column('partner_description', sa.String(), nullable=True, comment='Description of the partner'),

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (103/100) Warning

Line too long (103/100)

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (103/100) Warning

Line too long (103/100)
sa.Column('created_at', sa.DateTime(), server_default=sa.text("TIMEZONE('utc', CURRENT_TIMESTAMP)"), nullable=True, comment='The date and time in UTC when the record was created'),

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (184/100) Warning

Line too long (184/100)

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).

Check warning

Code scanning / Prospector (reported by Codacy)

line too long (184 > 159 characters) (E501) Warning

line too long (184 > 159 characters) (E501)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (184/100) Warning

Line too long (184/100)
sa.Column('updated_at', sa.DateTime(), nullable=True, comment='The date and time in UTC when the record was last updated'),

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (127/100) Warning

Line too long (127/100)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (127/100) Warning

Line too long (127/100)
sa.PrimaryKeyConstraint('partner_id'),

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).
sa.UniqueConstraint('partner_id'),

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).
sa.UniqueConstraint('partner_name')

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 16 spaces). Warning

Wrong continued indentation (add 16 spaces).
)

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong continued indentation (add 15 spaces). Warning

Wrong continued indentation (add 15 spaces).
op.add_column('proposal', sa.Column('partner_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'proposal', 'partner', ['partner_id'], ['partner_id'])
# ### end Alembic commands ###


def downgrade():

Check warning

Code scanning / Pylint (reported by Codacy)

Missing function docstring Warning

Missing function docstring

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing function or method docstring Warning

Missing function or method docstring
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, 'proposal', type_='foreignkey')
op.drop_column('proposal', 'partner_id')
op.drop_table('partner')
# ### end Alembic commands ###
Binary file added diagrams/erdiagram_targetdb-20241220155829.pdf
Binary file not shown.
18 changes: 12 additions & 6 deletions docs/examples/obsproc.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@
```csv title="proposal_categories.csv"
proposal_category_id,proposal_category_name,proposal_category_description
1,openuse,Subaru openuse proposal
2,keck,Subaru/Keck time exchange proposal
3,gemini,Subaru/Gemini time exchange proposal
4,uh,University of Hawaii proposal
```

```csv title="partner.csv"
partner_id,partner_name,partner_description
1,subaru,Subaru Telescope
2,keck,"W. M. Keck Observatory"
3,gemini,Gemini Telescope
4,uh,University of Hawaii
```

```csv title="pfs_arm.csv"
Expand Down Expand Up @@ -100,6 +105,7 @@
```console
$ pfs-targetdb-cli insert filter_names.csv -c db_config.toml --table filter_name --commit
$ pfs-targetdb-cli insert proposal_categories.csv -c db_config.toml --table proposal_category --commit
$ pfs-targetdb-cli insert partner.csv -c db_config.toml --table partner --commit

Check notice on line 108 in docs/examples/obsproc.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

docs/examples/obsproc.md#L108

Dollar signs used before commands without showing output
$ pfs-targetdb-cli insert pfs_arm.csv -c db_config.toml --table pfs_arm --commit
$ pfs-targetdb-cli insert target_types.csv -c db_config.toml --table target_type --commit
```
Expand Down Expand Up @@ -169,15 +175,15 @@
**`Proposals` Sheet**:

| proposal_id | input_catalog_name | input_catalog_description | group_id | pi_first_name | pi_last_name | pi_middle_name | proposal_category_name | upload_id | n_obj | fiberhour_total | fiberhour_lr | fiberhour_mr | rot_total | rot_lr | rot_mr |
|-------------|--------------------|---------------------------|----------|---------------|--------------|----------------|------------------------|------------------|-------|-----------------|--------------|--------------|-----------|--------|--------|
| ----------- | ------------------ | ------------------------- | -------- | ------------- | ------------ | -------------- | ---------------------- | ---------------- | ----- | --------------- | ------------ | ------------ | --------- | ------ | ------ |
| S99A-QT001 | pfs_example_1 | Example target list 1 | o99101 | Eiichi | Shibusawa | | openuse | d6e94eae259faf4e | 1572 | 379.5 | 379.5 | | 5.2 | 5.2 | |
| S99A-QT002 | pfs_example_2 | Example target list 2 | o99102 | Umeko | Tsuda | | openuse | 5f695375c60f34c7 | 9712 | 17504 | 17504 | | 15.83 | 15.83 | |
| S99A-QT003 | pfs_example_3 | Example target list 3 | o99103 | Shibasaburo | Kitasato | | openuse | ba59115da8084653 | 2047 | 395.25 | 395.25 | | 12.7 | 12.7 | |

**`Allocation` Sheet**:

| proposal_id | grade | rank | allocated_rot_total | allocated_rot_lr | allocated_rot_mr | allocated_time_total | allocated_time_lr | allocated_time_mr | n_ppc | allocation_rate_lr | allocation_rate_mr | completion_rate_lr | completion_rate_mr |
|-------------|-------|------|---------------------|------------------|------------------|----------------------|-------------------|-------------------|-------|--------------------|--------------------|--------------------|--------------------|
| ----------- | ----- | ---- | ------------------- | ---------------- | ---------------- | -------------------- | ----------------- | ----------------- | ----- | ------------------ | ------------------ | ------------------ | ------------------ |
| S99A-QT001 | A | 9 | 2.8 | | 2.8 | 284.25 | 0 | 284.25 | 9 | 0.749011858 | | 0.723 | |
| S99A-QT002 | B | 6.5 | 6.5 | 6.5 | | 8140.5 | 8140.5 | 0 | 21 | 0.465065128 | | 0.279 | |
| S99A-QT003 | B | 6 | 9.6 | 9.6 | | 350.25 | 350.25 | 0 | 31 | 0.886148008 | | 0.684 | |
Expand Down Expand Up @@ -268,4 +274,4 @@
--commit --upload_id "aabbccddeeffgghh"
```

Currently, you need to insert the custom pointing list one by one. We are planning to support batch insertion in the future.
Currently, you need to insert the custom pointing list one by one. We are planning to support batch insertion in the future.
32 changes: 32 additions & 0 deletions docs/schema/partner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# `partner`

## Overview

The `partner` table is used to store the information on partner institutions.

## Columns

Here are the columns in the `partner` table:

| Column Name | Type | Description | Required[^1] | Default |
Dismissed Show dismissed Hide dismissed

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
| ------------------- | -------- | ---------------------------------------------------------- | ------------ | ------- |
| partner_id | int | The unique identifier of the partner | \* | |
| partner_name | str | The name of the partner | \* | |
| partner_description | str | A brief description of the partner | | "" |
| created_at | datetime | The date and time in UTC when the record was created. | | |
| updated_at | datetime | The date and time in UTC when the record was last updated. | | |

[^1]: Required when inserted by using the [CLI tool](../reference/cli.md) or equivalent functions.

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note documentation

[no-shortcut-reference-link] Use the trailing [] on reference links

## Unique constraint

- `partner_id` is the primary key of the table and must be unique. However, it not set as an auto-increment column.

## Available proposal categories

| partner_id | partner_name | partner_description |
| ---------: | ------------ | ---------------------- |
| 1 | subaru | Subaru Telescope |
| 2 | keck | W. M. Keck Observatory |
| 3 | gemini | Gemini Observatory |
| 4 | uh | University of Hawaii |
4 changes: 3 additions & 1 deletion docs/schema/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The `proposal` table is used to store the information on proposals.
Here are the columns in the `proposal` table:

| Column Name | Type | Description | Unit | Required[^1] | Default |
|----------------------|----------|---------------------------------------------------------------------|------|--------------|---------|
| -------------------- | -------- | ------------------------------------------------------------------- | ---- | ------------ | ------- |
| proposal_id | str | Proposal-ID (e.g, S23B-QN901) | | \* | |
| group_id | str | Group ID issued by STARS (e.g., o21195) | | \* | |
| pi_first_name | str | PI's first name | | | "" |
Expand All @@ -21,6 +21,7 @@ Here are the columns in the `proposal` table:
| allocated_time_lr | float | Allocated fiberhours for low-resolution mode | h | | 0 |
| allocated_time_mr | float | Allocated fiberhours for medium-resolution mode | h | | 0 |
| proposal_category_id | int | `proposal_category_id` in the `proposal_category` table | | | 0 |
| partner_id | int | `partner_id` in the `partner` table | | | |
| is_too | bool | A flag to indicate if the proposal is a Target of Opportunity (ToO) | | | False |
| created_at | datetime | The date and time in UTC when the record was created. | | | |
| updated_at | datetime | The date and time in UTC when the record was last updated. | | | |
Expand All @@ -35,6 +36,7 @@ Here are the columns in the `proposal` table:
## Foreign key constraints

- `proposal_category_id` is a foreign key constraint that references the `proposal_category_id` in the `proposal_category` table.
- `partner_id` is a foreign key constraint that references the `partner_id` in the `partner` table

## Notes

Expand Down
9 changes: 3 additions & 6 deletions docs/schema/proposal_category.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ Here are the columns in the `proposal_category` table:

## Available proposal categories

| proposal_category_id | proposal_category_name | proposal_category_description |
| -------------------: | ---------------------- | ------------------------------------ |
| 1 | openuse | Subaru openuse proposal |
| 2 | keck | Subaru/Keck time exchange proposal |
| 3 | gemini | Subaru/Gemini time exchange proposal |
| 4 | uh | University of Hawaii proposal |
| proposal_category_id | proposal_category_name | proposal_category_description |
| -------------------: | ---------------------- | ----------------------------- |
| 1 | openuse | Subaru openuse proposal |
8 changes: 8 additions & 0 deletions docs/tbls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| [public.fluxstd](public.fluxstd.md) | 61 | | BASE TABLE |
| [public.target](public.target.md) | 61 | | BASE TABLE |
| [public.cluster](public.cluster.md) | 10 | | BASE TABLE |
| [public.partner](public.partner.md) | 5 | | BASE TABLE |

## Stored procedures and functions

Expand Down Expand Up @@ -310,6 +311,13 @@ erDiagram
timestamp_without_time_zone created_at
timestamp_without_time_zone updated_at
}
"public.partner" {
integer partner_id
varchar partner_name
varchar partner_description
timestamp_without_time_zone created_at
timestamp_without_time_zone updated_at
}
```

---
Expand Down
46 changes: 46 additions & 0 deletions docs/tbls/public.partner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# public.partner

## Description

## Columns

| Name | Type | Default | Nullable | Children | Parents | Comment |
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
| partner_id | integer | | false | | | Unique identifier of the partner |
| partner_name | varchar | | false | | | Name of the partner (e.g., subaru, gemini, keck, and uh) |
| partner_description | varchar | | true | | | Description of the partner |
| created_at | timestamp without time zone | timezone('utc'::text, CURRENT_TIMESTAMP) | true | | | The date and time in UTC when the record was created |
| updated_at | timestamp without time zone | | true | | | The date and time in UTC when the record was last updated |

## Constraints

| Name | Type | Definition |
| ---- | ---- | ---------- |
| partner_pkey | PRIMARY KEY | PRIMARY KEY (partner_id) |
| partner_partner_name_key | UNIQUE | UNIQUE (partner_name) |

## Indexes

| Name | Definition |
| ---- | ---------- |
| partner_pkey | CREATE UNIQUE INDEX partner_pkey ON public.partner USING btree (partner_id) |
| partner_partner_name_key | CREATE UNIQUE INDEX partner_partner_name_key ON public.partner USING btree (partner_name) |

## Relations

```mermaid
erDiagram


"public.partner" {
integer partner_id
varchar partner_name
varchar partner_description
timestamp_without_time_zone created_at
timestamp_without_time_zone updated_at
}
```

---

> Generated by [tbls](https://github.com/k1LoW/tbls)
5 changes: 5 additions & 0 deletions examples/data/partner.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
partner_id,partner_name,partner_description
1,subaru,Subaru Telescope
2,keck,"W. M. Keck Observatory"
3,gemini,Gemini Telescope
4,uh,University of Hawaii
3 changes: 0 additions & 3 deletions examples/data/proposal_category.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
proposal_category_id,proposal_category_name,proposal_category_description
1,openuse,Subaru openuse proposal
2,keck,Subaru/Keck time exchange proposal
3,gemini,Subaru/Gemini time exchange proposal
4,uh,University of Hawaii proposal
10 changes: 7 additions & 3 deletions examples/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Use the official Docker Hub Postgres 10.6 image
# FROM postgres:10.6
FROM postgres:12
# FROM postgres:12
FROM postgres:16

# Set environment variables
ENV POSTGRES_USER ""
Expand All @@ -11,8 +12,11 @@ ENV POSTGRES_DB ""
RUN apt-get update && apt-get install -y \
git \
build-essential \
liblz4-dev \
libreadline-dev \
libzstd-dev \
zlib1g-dev \
postgresql-server-dev-12
postgresql-server-dev-16

# Clone the q3c extension from GitHub
RUN git clone https://github.com/segasai/q3c.git
Expand All @@ -31,4 +35,4 @@ EXPOSE 5432
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]

# Set the default command to run when starting the container
CMD ["postgres"]
CMD ["postgres"]
1 change: 1 addition & 0 deletions src/targetdb/cli/cli_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class TargetdbTable(str, Enum):
filter_name = "filter_name"
fluxstd = "fluxstd"
input_catalog = "input_catalog"
partner = "partner"
pfs_arm = "pfs_arm"
proposal = "proposal"
proposal_category = "proposal_category"
Expand Down
2 changes: 2 additions & 0 deletions src/targetdb/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
from .filter_name import filter_name # noqa E402
from .pfs_arm import pfs_arm # noqa E402
from .proposal_category import proposal_category # noqa E402
from .partner import partner # noqa E402

Check warning

Code scanning / Pylint (reported by Codacy)

Import "from .partner import partner" should be placed at the top of the module Warning

Import "from .partner import partner" should be placed at the top of the module

Check warning

Code scanning / Prospector (reported by Codacy)

Import "from .partner import partner" should be placed at the top of the module (wrong-import-position) Warning

Import "from .partner import partner" should be placed at the top of the module (wrong-import-position)
Fixed Show fixed Hide fixed

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Import "from .partner import partner" should be placed at the top of the module Warning

Import "from .partner import partner" should be placed at the top of the module

# from .proposal_grade import proposal_grade # noqa E402
from .input_catalog import input_catalog # noqa E402
Expand All @@ -54,6 +55,7 @@
"filter_name",
"pfs_arm",
"proposal_category",
"partner",
# "proposal_grade",
"input_catalog",
"user_pointing",
Expand Down
44 changes: 44 additions & 0 deletions src/targetdb/models/partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env python

Check warning

Code scanning / Pylint (reported by Codacy)

Missing module docstring Warning

Missing module docstring

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing module docstring Warning

Missing module docstring

from sqlalchemy import (

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'sqlalchemy' (import-error) Warning

Unable to import 'sqlalchemy' (import-error)
Column,
DateTime,
Integer,
String,
)
from sqlalchemy.orm import relationship

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'sqlalchemy.orm' (import-error) Warning

Unable to import 'sqlalchemy.orm' (import-error)

from . import Base, comment_created_at, comment_updated_at, utcnow


class partner(Base):

Check warning

Code scanning / Pylint (reported by Codacy)

Missing class docstring Warning

Missing class docstring

Check warning

Code scanning / Pylint (reported by Codacy)

Class name "partner" doesn't conform to PascalCase naming style Warning

Class name "partner" doesn't conform to PascalCase naming style

Check warning

Code scanning / Pylint (reported by Codacy)

Too few public methods (0/2) Warning

Too few public methods (0/2)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Class name "partner" doesn't conform to PascalCase naming style Warning

Class name "partner" doesn't conform to PascalCase naming style

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Too few public methods (0/2) Warning

Too few public methods (0/2)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing class docstring Warning

Missing class docstring
__tablename__ = "partner"

partner_id = Column(
Integer,
primary_key=True,
unique=True,
autoincrement=False,
comment="Unique identifier of the partner",
)
partner_name = Column(
String,
unique=True,
nullable=False,
comment="Name of the partner (e.g., subaru, gemini, keck, and uh)",
)
partner_description = Column(
String, default="", comment="Description of the partner"
)
created_at = Column(
DateTime,
comment=comment_created_at,
server_default=utcnow(),
)
updated_at = Column(
DateTime,
comment=comment_updated_at,
onupdate=utcnow(),
)

proposals = relationship("proposal", backref="partner")
Loading
Loading