-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This field is used to store labels of products without barcode
- Loading branch information
1 parent
bcbcc2a
commit 3a368a5
Showing
4 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
alembic/versions/20231123_1400_012466c0013e_add_prices_labels_tags_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,40 @@ | ||
"""add prices.labels_tags field | ||
Revision ID: 012466c0013e | ||
Revises: 5acb37b190cc | ||
Create Date: 2023-11-23 14:00:14.162599 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "012466c0013e" | ||
down_revision: Union[str, None] = "5acb37b190cc" | ||
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( | ||
"prices", | ||
sa.Column( | ||
"labels_tags", postgresql.JSONB(astext_type=sa.Text()), nullable=True | ||
), | ||
) | ||
op.create_index( | ||
op.f("ix_prices_labels_tags"), "prices", ["labels_tags"], unique=False | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index(op.f("ix_prices_labels_tags"), table_name="prices") | ||
op.drop_column("prices", "labels_tags") | ||
# ### 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
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