prism-models 0.6.3__py3-none-any.whl → 0.6.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,8 @@ from alembic import op
11
11
  import sqlalchemy as sa
12
12
  from sqlalchemy.dialects import postgresql
13
13
 
14
+ contact_role_enum = sa.Enum('ADMIN', 'ACCOUNT_ADMIN', 'MANAGER', 'VIEWER', name='contactrole')
15
+
14
16
  # revision identifiers, used by Alembic.
15
17
  revision: str = '4d9291a3acb1'
16
18
  down_revision: Union[str, Sequence[str], None] = '6abdd3f001ab'
@@ -21,32 +23,33 @@ depends_on: Union[str, Sequence[str], None] = None
21
23
  def upgrade() -> None:
22
24
  """Upgrade schema."""
23
25
  # ### commands auto generated by Alembic - please adjust! ###
26
+ # Drop references to qa_pair before removing the table to satisfy FK constraints.
27
+ op.drop_constraint(op.f('vector_qa_pair_id_key'), 'vector', type_='unique')
28
+ op.drop_constraint(op.f('vector_qa_pair_id_fkey'), 'vector', type_='foreignkey')
29
+ op.drop_column('vector', 'qa_pair_id')
30
+
24
31
  op.drop_table('qa_pair_chunk_association')
25
32
  op.drop_index(op.f('qa_pair_document_id_idx'), table_name='qa_pair')
26
33
  op.drop_index(op.f('qa_pair_id_idx'), table_name='qa_pair')
27
34
  op.drop_table('qa_pair')
28
- op.add_column('contact', sa.Column('contact_role', sa.Enum('ADMIN', 'ACCOUNT_ADMIN', 'MANAGER', 'VIEWER', name='contactrole'), server_default='VIEWER', nullable=False))
35
+ contact_role_enum.create(op.get_bind(), checkfirst=True)
36
+ op.add_column('contact', sa.Column('contact_role', contact_role_enum, server_default='VIEWER', nullable=False))
29
37
  op.add_column('contact', sa.Column('manager_contact_id', sa.Integer(), nullable=True))
30
38
  op.create_index(op.f('contact_manager_contact_id_idx'), 'contact', ['manager_contact_id'], unique=False)
31
39
  op.create_foreign_key(op.f('contact_manager_contact_id_fkey'), 'contact', 'contact', ['manager_contact_id'], ['id'], ondelete='SET NULL')
32
40
  op.drop_index(op.f('idx_document_title_trgm'), table_name='document', postgresql_ops={'title': 'gin_trgm_ops'}, postgresql_using='gin')
33
- op.drop_constraint(op.f('vector_qa_pair_id_key'), 'vector', type_='unique')
34
- op.drop_constraint(op.f('vector_qa_pair_id_fkey'), 'vector', type_='foreignkey')
35
- op.drop_column('vector', 'qa_pair_id')
36
41
  # ### end Alembic commands ###
37
42
 
38
43
 
39
44
  def downgrade() -> None:
40
45
  """Downgrade schema."""
41
46
  # ### commands auto generated by Alembic - please adjust! ###
42
- op.add_column('vector', sa.Column('qa_pair_id', sa.INTEGER(), autoincrement=False, nullable=True))
43
- op.create_foreign_key(op.f('vector_qa_pair_id_fkey'), 'vector', 'qa_pair', ['qa_pair_id'], ['id'])
44
- op.create_unique_constraint(op.f('vector_qa_pair_id_key'), 'vector', ['qa_pair_id'], postgresql_nulls_not_distinct=False)
45
47
  op.create_index(op.f('idx_document_title_trgm'), 'document', ['title'], unique=False, postgresql_ops={'title': 'gin_trgm_ops'}, postgresql_using='gin')
46
48
  op.drop_constraint(op.f('contact_manager_contact_id_fkey'), 'contact', type_='foreignkey')
47
49
  op.drop_index(op.f('contact_manager_contact_id_idx'), table_name='contact')
48
50
  op.drop_column('contact', 'manager_contact_id')
49
51
  op.drop_column('contact', 'contact_role')
52
+ contact_role_enum.drop(op.get_bind(), checkfirst=True)
50
53
  op.create_table('qa_pair',
51
54
  sa.Column('document_id', sa.INTEGER(), autoincrement=False, nullable=False),
52
55
  sa.Column('question', sa.TEXT(), autoincrement=False, nullable=False),
@@ -70,4 +73,7 @@ def downgrade() -> None:
70
73
  sa.ForeignKeyConstraint(['qa_pair_id'], ['qa_pair.id'], name=op.f('qa_pair_chunk_association_qa_pair_id_fkey')),
71
74
  sa.PrimaryKeyConstraint('qa_pair_id', 'chunk_id', name=op.f('qa_pair_chunk_association_pkey'))
72
75
  )
76
+ op.add_column('vector', sa.Column('qa_pair_id', sa.INTEGER(), autoincrement=False, nullable=True))
77
+ op.create_foreign_key(op.f('vector_qa_pair_id_fkey'), 'vector', 'qa_pair', ['qa_pair_id'], ['id'])
78
+ op.create_unique_constraint(op.f('vector_qa_pair_id_key'), 'vector', ['qa_pair_id'], postgresql_nulls_not_distinct=False)
73
79
  # ### end Alembic commands ###
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: prism-models
3
- Version: 0.6.3
3
+ Version: 0.6.5
4
4
  Requires-Python: >=3.12
5
5
  Requires-Dist: sqlalchemy[asyncio]>=2.0.0
6
6
  Requires-Dist: alembic>=1.16.0
@@ -63,8 +63,8 @@ prism_models/migration/versions/2025_11_24_1124_dc57fb290621_added_conversation_
63
63
  prism_models/migration/versions/2025_11_25_1847_c6c36663acd5_added_user_preferences_table.py,sha256=4E51jRKENB-pU2yg_Pf2zxORWFqPfHcQ4aQmblPS4Ew,2438
64
64
  prism_models/migration/versions/2025_12_07_2236_88f01df468f2_added_sparse_embeddings_field_in_vector_.py,sha256=Qrg6ouy11sESaPJcfkfh9Vk8CoOW34vrMmF69OStZDg,995
65
65
  prism_models/migration/versions/2025_12_09_1146_6abdd3f001ab_adding_orchestrator_model_to_profile_.py,sha256=eiCgTyFW7TbifwXPbZtsYW9_UPYwyCMF4I7eXnMOTwQ,937
66
- prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py,sha256=t9mWTA6Yu4Ko2zlfkSkEelerXn2NfB79TWziRoRRJYA,4506
67
- prism_models-0.6.3.dist-info/METADATA,sha256=NP-pdnndSfRfqT3dfjwRX8h5EgQZaPIY0ske8rsypKU,283
68
- prism_models-0.6.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
- prism_models-0.6.3.dist-info/top_level.txt,sha256=UNzqwpLgFYU0EoyB9LiB1jTtc89A1sQ24fSEyNVvgJI,13
70
- prism_models-0.6.3.dist-info/RECORD,,
66
+ prism_models/migration/versions/2025_12_17_1220_4d9291a3acb1_removed_qa_pair_chunk.py,sha256=QnbVia8YU2_Rp0LWFvbA2lUy7kmdrGLbDmTHw-YQAoM,4752
67
+ prism_models-0.6.5.dist-info/METADATA,sha256=e35cEPTl8s-1RdPFXOxsAo_K-GwrcH_J7FkOB3jQ6Jk,283
68
+ prism_models-0.6.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
69
+ prism_models-0.6.5.dist-info/top_level.txt,sha256=UNzqwpLgFYU0EoyB9LiB1jTtc89A1sQ24fSEyNVvgJI,13
70
+ prism_models-0.6.5.dist-info/RECORD,,