-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️
licensed_items
migration add product to key, version unique inde…
…x key (🗃️) (#7260)
- Loading branch information
1 parent
870b9b2
commit 7526a43
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
...stgres_database/migration/versions/a8d336ca9379_idx_licensed_items_key_version_product.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,38 @@ | ||
"""idx licensed items - key/version/product | ||
Revision ID: a8d336ca9379 | ||
Revises: 5e43b5ec7604 | ||
Create Date: 2025-02-21 14:29:42.575724+00:00 | ||
""" | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "a8d336ca9379" | ||
down_revision = "5e43b5ec7604" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index("idx_licensed_items_key_version", table_name="licensed_items") | ||
op.create_index( | ||
"idx_licensed_items_key_version_product", | ||
"licensed_items", | ||
["key", "version", "product_name"], | ||
unique=True, | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_index("idx_licensed_items_key_version_product", table_name="licensed_items") | ||
op.create_index( | ||
"idx_licensed_items_key_version", | ||
"licensed_items", | ||
["key", "version"], | ||
unique=True, | ||
) | ||
# ### 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