-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add reference and org_name fields
- Loading branch information
1 parent
c2bbb4d
commit acd1ada
Showing
5 changed files
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,18 @@ Import DMAP data into a PostgreSQL database | |
* run `docker-compose build` to build the docker images for local testing | ||
* run `docker-compose up dmap_local_rds` to stand up a local postgres db | ||
* this imnage could be used when running pytest | ||
* run `docker-compose up dmap_importer` to run the importer application | ||
* run `docker-compose up dmap_import` to run the importer application | ||
|
||
### Outside of Docker | ||
|
||
1. Navigate to repository directory. | ||
2. Update `.env` variable. Source it `source .env`. | ||
3. Run `poetry run start` to run the ingestion process. | ||
4. Run `psql postgresql://postgres:[email protected]:5432/dmap_importer` to get into the database. Alternatively, after `docker-compose up`, you can: | ||
1. `docker exec -it dmap_local_rds bash` | ||
2. `psql -U postgres -d dmap_importer` | ||
5. Run format, type and lint checker: | ||
* `poetry run black .` | ||
* `poetry run mypy .` | ||
* `poetry run pylint src tests` | ||
6. Run tests, `poetry run pytest`. |
36 changes: 36 additions & 0 deletions
36
src/alembic/versions/002_0d3bf1348c58_new_reference_org_name_columns.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""new reference org name columns | ||
Revision ID: 0d3bf1348c58 | ||
Revises: d630193252db | ||
Create Date: 2024-06-01 22:10:22.189820 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "0d3bf1348c58" | ||
down_revision: Union[str, None] = "d630193252db" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.add_column( | ||
"use_transaction_longitudinal", sa.Column("reference", sa.String()) | ||
) | ||
op.add_column( | ||
"use_transaction_location", sa.Column("reference", sa.String()) | ||
) | ||
op.add_column("sale_transaction", sa.Column("reference", sa.String())) | ||
op.add_column("sale_transaction", sa.Column("org_name", sa.String())) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_column("use_transaction_longitudinal", "reference") | ||
op.drop_column("use_transaction_location", "reference") | ||
op.drop_column("sale_transaction", "reference") | ||
op.drop_column("sale_transaction", "org_name") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters