Skip to content

Commit

Permalink
Feat/add infocontinue public program metadata (#172)
Browse files Browse the repository at this point in the history
* wip

* doc: alembic
  • Loading branch information
polomarcus authored May 3, 2024
1 parent b0a4ee3 commit 3499381
Show file tree
Hide file tree
Showing 7 changed files with 1,058 additions and 28 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,14 @@ Using [Alembic](https://alembic.sqlalchemy.org/en/latest/autogenerate.html) Auto
```
# If changes have already been applied and you want to recreate your alembic file:
# 1. change to you main branch
# 2. start test container and run "pytest -vv -k api" to rebuild the state of the DB
# 3. rechange to your WIP branch and
# 4. connect to the test container : docker compose exec test bash
# 2. start test container and run "pytest -vv -k api" to rebuild the state of the DB (or drop table the table you want)
# 3. rechange to your WIP branch
# 4. connect to the test container : docker compose up test -d / docker compose exec test bash
# 5. reapply the latest saved state : poetry run alembic upgrade head
# 6. Save the new columns
poetry run alembic revision --autogenerate -m "Add new column test for table keywords"
# this should generate a file to commit inside "alembic/versions"
# to apply it we need to run, from our container
# 7. to apply it we need to run, from our container
poetry run alembic upgrade head
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Add info/public to program metadata
Revision ID: 5bff4dceda53
Revises: c1d78b9968fe
Create Date: 2024-05-03 09:09:44.751432
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '5bff4dceda53'
down_revision: Union[str, None] = 'c1d78b9968fe'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('program_metadata', sa.Column('public', sa.Boolean(), nullable=True))
op.add_column('program_metadata', sa.Column('infocontinue', sa.Boolean(), nullable=True))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('program_metadata', 'infocontinue')
op.drop_column('program_metadata', 'public')
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Add info/public to program metadata
Revision ID: 5cc9e1ec5362
Revises: 356882459cec
Create Date: 2024-05-03 08:54:16.764307
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '5cc9e1ec5362'
down_revision: Union[str, None] = '356882459cec'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Add info/public to program metadata
Revision ID: c1d78b9968fe
Revises: 5cc9e1ec5362
Create Date: 2024-05-03 08:56:47.087189
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'c1d78b9968fe'
down_revision: Union[str, None] = '5cc9e1ec5362'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
Loading

1 comment on commit 3499381

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
postgres
   insert_data.py44784%36–38, 57–59, 64
   insert_existing_data_example.py19384%25–27
postgres/schemas
   models.py1411093%115–122, 134–135, 192–193, 207–208
quotaclimat/data_ingestion
   scrap_sitemap.py1341787%27–28, 33–34, 66–71, 95–97, 138–140, 202, 223–228
quotaclimat/data_ingestion/ingest_db
   ingest_sitemap_in_db.py553733%21–42, 45–58, 62–73
quotaclimat/data_ingestion/scrap_html
   scrap_description_article.py36392%19–20, 32
quotaclimat/data_processing/mediatree
   api_import.py18411040%42–46, 51–63, 67–70, 76, 79–112, 118–133, 137–138, 151–163, 167–173, 186–197, 200–204, 210, 237–238, 242, 246–265, 268–270
   channel_program.py91990%21–23, 34–36, 50, 86, 95
   config.py15287%7, 16
   detect_keywords.py180498%178, 230–232
   update_pg_keywords.py443032%14–84, 105–106, 127–152, 158
   utils.py662365%18, 29–53, 56, 65, 81–82
quotaclimat/utils
   healthcheck_config.py291452%22–24, 27–38
   logger.py241154%22–24, 28–37
   sentry.py10280%21–22
TOTAL109828274% 

Tests Skipped Failures Errors Time
79 0 💤 0 ❌ 0 🔥 57.422s ⏱️

Please sign in to comment.