-
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.
Remove
article_exclude_reason
column (#17)
* [remove] article_exclude_reason * [change] update tests * [change] bump version * [add] article language column * [add] alembic revision
- Loading branch information
1 parent
bf7ad76
commit cd6a12e
Showing
13 changed files
with
102 additions
and
177 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
alembic/versions/2023_12_04_1338-46c271f8f06f_remove_article_exclude_reason_field_.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,59 @@ | ||
"""remove article_exclude_reason field from page table and add new article fields | ||
Revision ID: 46c271f8f06f | ||
Revises: e8f9a954be12 # noqa: W291 | ||
Create Date: 2023-12-04 13:38:09.372485 | ||
""" | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "46c271f8f06f" | ||
down_revision = "e8f9a954be12" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
sa.Enum("ENGLISH", "SPANISH", name="language").create(op.get_bind()) | ||
op.add_column( | ||
"article", | ||
sa.Column("language", postgresql.ENUM("ENGLISH", "SPANISH", name="language", create_type=False), nullable=False), | ||
) | ||
op.add_column("article", sa.Column("is_in_house_content", sa.Boolean(), nullable=False)) | ||
op.drop_column("page", "article_exclude_reason") | ||
sa.Enum("NOT_ARTICLE", "NOT_IN_HOUSE_ARTICLE", "TEST_ARTICLE", "HAS_EXCLUDED_TAG", name="articleexcludereason").drop( | ||
op.get_bind() | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
sa.Enum( | ||
"NOT_ARTICLE", "NOT_IN_HOUSE_ARTICLE", "TEST_ARTICLE", "HAS_EXCLUDED_TAG", name="articleexcludereason" | ||
).create(op.get_bind()) | ||
op.add_column( | ||
"page", | ||
sa.Column( | ||
"article_exclude_reason", | ||
postgresql.ENUM( | ||
"NOT_ARTICLE", | ||
"NOT_IN_HOUSE_ARTICLE", | ||
"TEST_ARTICLE", | ||
"HAS_EXCLUDED_TAG", | ||
name="articleexcludereason", | ||
create_type=False, | ||
), | ||
autoincrement=False, | ||
nullable=True, | ||
), | ||
) | ||
op.drop_column("article", "is_in_house_content") | ||
op.drop_column("article", "language") | ||
sa.Enum("ENGLISH", "SPANISH", name="language").drop(op.get_bind()) | ||
# ### end Alembic commands ### |
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 |
---|---|---|
@@ -1,20 +1,15 @@ | ||
__all__ = [ | ||
"SQLModel", | ||
"Article", | ||
"Page", | ||
"SQLModel", | ||
"ArticleExcludeReason", | ||
"Embedding", | ||
"StrategyType", | ||
"MAX_EMBEDDING_DIMENSIONS", | ||
"Execution", | ||
"Recommendation", | ||
"StrategyRecommendationType", | ||
] | ||
|
||
from .article import Article | ||
from .embedding import MAX_DIMENSIONS as MAX_EMBEDDING_DIMENSIONS | ||
from .embedding import Embedding | ||
from .execution import Execution, StrategyRecommendationType, StrategyType | ||
from .execution import Execution | ||
from .helpers import SQLModel | ||
from .page import ArticleExcludeReason, Page | ||
from .page import Page | ||
from .recommendation import Recommendation |
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
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
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
Oops, something went wrong.