fix: add test for migration 7c0d9a4e3b1f
This commit is contained in:
parent
7c155f99a2
commit
9ced00e2d5
|
|
@ -4,6 +4,7 @@ from . import (
|
|||
test_05486ce795d5_make_session_name_required_on_messages,
|
||||
test_066e87ca5b07_align_schema_with_declarative_models,
|
||||
test_08894082221a_replace_collection_name_with_observer_,
|
||||
test_7c0d9a4e3b1f_add_unique_index_for_pending_dreams,
|
||||
test_20f89a421aff_rename_metamessage_type_to_label,
|
||||
test_29ade7350c19_remove_document_level_valid_constraint,
|
||||
test_66e63cf2cf77_add_indexes_to_documents_table,
|
||||
|
|
@ -23,6 +24,7 @@ from . import (
|
|||
test_d429de0e5338_adopt_peer_paradigm,
|
||||
test_e9b705f9adf9_add_server_defaults_to_timestamp_,
|
||||
test_ec8f94139b02_codify_workspace_name_and_message_id_in_,
|
||||
test_f1a2b3c4d5e6_add_reasoning_tree_columns,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
|
|
@ -30,12 +32,14 @@ __all__ = [
|
|||
"test_066e87ca5b07_align_schema_with_declarative_models",
|
||||
"test_08894082221a_replace_collection_name_with_observer_",
|
||||
"test_110bdf470272_rename_deriver_disabled_to_deriver_",
|
||||
"test_119a52b73c60_support_external_embeddings",
|
||||
"test_20f89a421aff_rename_metamessage_type_to_label",
|
||||
"test_29ade7350c19_remove_document_level_valid_constraint",
|
||||
"test_556a16564f50_add_user_id_and_app_id_to_tables",
|
||||
"test_564ba40505c5_add_session_name_column_to_documents",
|
||||
"test_66e63cf2cf77_add_indexes_to_documents_table",
|
||||
"test_76ffba56fe8c_add_error_field_to_queueitem",
|
||||
"test_7c0d9a4e3b1f_add_unique_index_for_pending_dreams",
|
||||
"test_88b0fb10906f_add_webhooks_table",
|
||||
"test_917195d9b5e9_add_messageembedding_table",
|
||||
"test_a1b2c3d4e5f6_initial_schema",
|
||||
|
|
@ -47,5 +51,5 @@ __all__ = [
|
|||
"test_d429de0e5338_adopt_peer_paradigm",
|
||||
"test_e9b705f9adf9_add_server_defaults_to_timestamp_",
|
||||
"test_ec8f94139b02_codify_workspace_name_and_message_id_in_",
|
||||
"test_119a52b73c60_support_external_embeddings",
|
||||
"test_f1a2b3c4d5e6_add_reasoning_tree_columns",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
"""Hooks for revision 7c0d9a4e3b1f (add_unique_index_for_pending_dreams)."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from tests.alembic.registry import register_after_upgrade, register_before_upgrade
|
||||
from tests.alembic.verifier import MigrationVerifier
|
||||
|
||||
# The partial unique index created by this migration
|
||||
INDEX = ("queue", "ux_queue_dream_pending_work_unit_key")
|
||||
|
||||
|
||||
@register_before_upgrade("7c0d9a4e3b1f")
|
||||
def prepare_add_unique_index_for_pending_dreams(verifier: MigrationVerifier) -> None:
|
||||
"""Seed state and assertions before upgrading to 7c0d9a4e3b1f."""
|
||||
# The unique index should not exist before the migration
|
||||
verifier.assert_indexes_not_exist([INDEX])
|
||||
|
||||
|
||||
@register_after_upgrade("7c0d9a4e3b1f")
|
||||
def verify_add_unique_index_for_pending_dreams(verifier: MigrationVerifier) -> None:
|
||||
"""Add assertions validating the effects of 7c0d9a4e3b1f."""
|
||||
# The partial unique index should now exist
|
||||
verifier.assert_indexes_exist([INDEX])
|
||||
Loading…
Reference in New Issue