Skip to content

Commit fd7e243

Browse files
committed
feat: make various fields nullable and enhance data transfer handling
1 parent 3528718 commit fd7e243

38 files changed

Lines changed: 1449 additions & 355 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""make measuring_point_history.measuring_point_height nullable
2+
3+
Revision ID: 8c9d0e1f2a3b
4+
Revises: 5336a52336df
5+
Create Date: 2026-02-21 12:00:00.000000
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
import sqlalchemy as sa
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = "8c9d0e1f2a3b"
16+
down_revision: Union[str, Sequence[str], None] = "5336a52336df"
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
op.alter_column(
23+
"measuring_point_history",
24+
"measuring_point_height",
25+
existing_type=sa.Numeric(),
26+
nullable=True,
27+
)
28+
29+
30+
def downgrade() -> None:
31+
op.alter_column(
32+
"measuring_point_history",
33+
"measuring_point_height",
34+
existing_type=sa.Numeric(),
35+
nullable=False,
36+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""make address.postal_code nullable
2+
3+
Revision ID: 9a0b1c2d3e4f
4+
Revises: 8c9d0e1f2a3b
5+
Create Date: 2026-02-21 13:00:00.000000
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
import sqlalchemy as sa
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = "9a0b1c2d3e4f"
16+
down_revision: Union[str, Sequence[str], None] = "8c9d0e1f2a3b"
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
op.alter_column(
23+
"address",
24+
"postal_code",
25+
existing_type=sa.String(length=20),
26+
nullable=True,
27+
)
28+
29+
30+
def downgrade() -> None:
31+
op.alter_column(
32+
"address",
33+
"postal_code",
34+
existing_type=sa.String(length=20),
35+
nullable=False,
36+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
"""make deployment installation_date nullable
2+
3+
Revision ID: a1b2c3d4e5f7
4+
Revises: 9a0b1c2d3e4f
5+
Create Date: 2026-02-21 14:32:00.000000
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
import sqlalchemy as sa
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = "a1b2c3d4e5f7"
16+
down_revision: Union[str, Sequence[str], None] = "9a0b1c2d3e4f"
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
op.alter_column(
23+
"deployment",
24+
"installation_date",
25+
existing_type=sa.Date(),
26+
nullable=True,
27+
)
28+
29+
30+
def downgrade() -> None:
31+
op.alter_column(
32+
"deployment",
33+
"installation_date",
34+
existing_type=sa.Date(),
35+
nullable=False,
36+
)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""make wellscreen depth fields nullable
2+
3+
Revision ID: b3c4d5e6f7a8
4+
Revises: a1b2c3d4e5f7
5+
Create Date: 2026-02-21 15:20:00.000000
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
import sqlalchemy as sa
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = "b3c4d5e6f7a8"
16+
down_revision: Union[str, Sequence[str], None] = "a1b2c3d4e5f7"
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
op.alter_column(
23+
"well_screen",
24+
"screen_depth_top",
25+
existing_type=sa.Float(),
26+
nullable=True,
27+
)
28+
op.alter_column(
29+
"well_screen",
30+
"screen_depth_bottom",
31+
existing_type=sa.Float(),
32+
nullable=True,
33+
)
34+
35+
36+
def downgrade() -> None:
37+
op.alter_column(
38+
"well_screen",
39+
"screen_depth_bottom",
40+
existing_type=sa.Float(),
41+
nullable=False,
42+
)
43+
op.alter_column(
44+
"well_screen",
45+
"screen_depth_top",
46+
existing_type=sa.Float(),
47+
nullable=False,
48+
)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
"""make address.city and address.state nullable
2+
3+
Revision ID: c4d5e6f7a8b9
4+
Revises: b3c4d5e6f7a8
5+
Create Date: 2026-02-21 16:30:00.000000
6+
7+
"""
8+
9+
from typing import Sequence, Union
10+
11+
import sqlalchemy as sa
12+
from alembic import op
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = "c4d5e6f7a8b9"
16+
down_revision: Union[str, Sequence[str], None] = "b3c4d5e6f7a8"
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
op.alter_column(
23+
"address",
24+
"city",
25+
existing_type=sa.String(length=100),
26+
nullable=True,
27+
)
28+
op.alter_column(
29+
"address",
30+
"state",
31+
existing_type=sa.String(length=50),
32+
nullable=True,
33+
)
34+
35+
36+
def downgrade() -> None:
37+
op.alter_column(
38+
"address",
39+
"city",
40+
existing_type=sa.String(length=100),
41+
nullable=False,
42+
)
43+
op.alter_column(
44+
"address",
45+
"state",
46+
existing_type=sa.String(length=50),
47+
nullable=False,
48+
)

api/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# API
2+
3+
This directory contains FastAPI route modules grouped by resource/domain.
4+
5+
## Structure
6+
7+
- One module per domain (for example `thing.py`, `contact.py`, `observation.py`)
8+
- `api/ogc/` contains OGC-specific endpoints
9+
10+
## Guidelines
11+
12+
- Keep endpoints focused on transport concerns (request/response, status codes).
13+
- Put transfer/business logic in service or transfer modules.
14+
- Ensure response schemas match `schemas/` definitions.
15+
16+
## Running locally
17+
18+
Use project entrypoint from repo root (see top-level README for full setup).

cli/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CLI
2+
3+
This directory contains Typer-based command entrypoints for operational and migration workflows.
4+
5+
## Main entrypoint
6+
7+
- `cli/cli.py`
8+
9+
Run commands from repo root:
10+
11+
```bash
12+
source .venv/bin/activate
13+
python -m cli.cli --help
14+
```
15+
16+
## Common commands
17+
18+
- `python -m cli.cli transfer-results`
19+
- `python -m cli.cli compare-duplicated-welldata`
20+
- `python -m cli.cli alembic-upgrade-and-data`
21+
22+
## Notes
23+
24+
- CLI logging is written to `cli/logs/`.
25+
- Keep CLI commands thin; move heavy logic into service/transfer modules.

0 commit comments

Comments
 (0)