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

Add migration to make agency_type non-null #256

Merged
merged 1 commit into from
Feb 11, 2025
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
28 changes: 28 additions & 0 deletions alembic/versions/83090d813802_make_agency_type_non_null.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""make_agency_type_non_null

Check warning on line 1 in alembic/versions/83090d813802_make_agency_type_non_null.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] alembic/versions/83090d813802_make_agency_type_non_null.py#L1 <400>

First line should end with a period
Raw output
./alembic/versions/83090d813802_make_agency_type_non_null.py:1:1: D400 First line should end with a period

Revision ID: 83090d813802
Revises: 94da2c95b58d
Create Date: 2025-02-11 10:05:49.486152

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

Check warning on line 11 in alembic/versions/83090d813802_make_agency_type_non_null.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] alembic/versions/83090d813802_make_agency_type_non_null.py#L11 <401>

'sqlalchemy as sa' imported but unused
Raw output
./alembic/versions/83090d813802_make_agency_type_non_null.py:11:1: F401 'sqlalchemy as sa' imported but unused


# revision identifiers, used by Alembic.
revision: str = '83090d813802'
down_revision: Union[str, None] = '94da2c95b58d'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:

Check warning on line 21 in alembic/versions/83090d813802_make_agency_type_non_null.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] alembic/versions/83090d813802_make_agency_type_non_null.py#L21 <103>

Missing docstring in public function
Raw output
./alembic/versions/83090d813802_make_agency_type_non_null.py:21:1: D103 Missing docstring in public function
# Add non-null constraint to agency_type
op.alter_column('agencies', 'agency_type', nullable=False)


def downgrade() -> None:

Check warning on line 26 in alembic/versions/83090d813802_make_agency_type_non_null.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] alembic/versions/83090d813802_make_agency_type_non_null.py#L26 <103>

Missing docstring in public function
Raw output
./alembic/versions/83090d813802_make_agency_type_non_null.py:26:1: D103 Missing docstring in public function
# Remove non-null constraint from agency_type
op.alter_column('agencies', 'agency_type', nullable=True)
12 changes: 11 additions & 1 deletion local_database/DataDumper/ENV.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,14 @@
| `DUMP_USER` | The username of the user to connect to the database. | `test_source_collector_user` |
| `DUMP_PASSWORD` | The password of the user to connect to the database. | `HanviliciousHamiltonHilltops` |
| `DUMP_DB_NAME` | The name of the database to dump. | `source_collector_test_db` |
| `DUMP_PORT` | The port of the database to dump. | `5432` |
| `DUMP_PORT` | The port of the database to dump. | `5432` |

Shell Script

```env
DUMP_HOST=127.0.0.1
DUMP_USER=test_source_collector_user
DUMP_PASSWORD=HanviliciousHamiltonHilltops
DUMP_DB_NAME=source_collector_test_db
DUMP_PORT=5432
```
Loading