Mercurial > libervia-backend
view sat/memory/migration/versions/8974efc51d22_create_tables_for_pubsub_caching.py @ 3967:f461f11ea176
plugin XEP-0384: Implementation of Automatic Trust Management:
- Implementation of Trust Messages (XEP-0434)
- Implementation of Automatic Trust Management (XEP-0450)
- Implementations directly as part of the OMEMO plugin, since omemo:2 is the only protocol supported by ATM at the moment
- Trust system selection updated to allow choice between manual trust with ATM and BTBV
- dev-requirements.txt updated to include additional requirements for the e2e tests
fix 376
author | Syndace <me@syndace.dev> |
---|---|
date | Fri, 28 Oct 2022 18:50:06 +0200 |
parents | d5116197e403 |
children |
line wrap: on
line source
"""create tables for Pubsub caching Revision ID: 8974efc51d22 Revises: 602caf848068 Create Date: 2021-07-27 16:38:54.658212 """ from alembic import op import sqlalchemy as sa from sat.memory.sqla_mapping import JID, Xml # revision identifiers, used by Alembic. revision = '8974efc51d22' down_revision = '602caf848068' branch_labels = None depends_on = None def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('pubsub_nodes', sa.Column('id', sa.Integer(), nullable=False), sa.Column('profile_id', sa.Integer(), nullable=True), sa.Column('service', JID(), nullable=True), sa.Column('name', sa.Text(), nullable=False), sa.Column('subscribed', sa.Boolean(create_constraint=True, name='subscribed_bool'), nullable=False), sa.Column('analyser', sa.Text(), nullable=True), sa.Column('sync_state', sa.Enum('IN_PROGRESS', 'COMPLETED', 'ERROR', 'NO_SYNC', name='sync_state', create_constraint=True), nullable=True), sa.Column('sync_state_updated', sa.Float(), nullable=False), sa.Column('type', sa.Text(), nullable=True), sa.Column('subtype', sa.Text(), nullable=True), sa.Column('extra', sa.JSON(), nullable=True), sa.ForeignKeyConstraint(['profile_id'], ['profiles.id'], name=op.f('fk_pubsub_nodes_profile_id_profiles'), ondelete='CASCADE'), sa.PrimaryKeyConstraint('id', name=op.f('pk_pubsub_nodes')), sa.UniqueConstraint('profile_id', 'service', 'name', name=op.f('uq_pubsub_nodes_profile_id')) ) op.create_table('pubsub_items', sa.Column('id', sa.Integer(), nullable=False), sa.Column('node_id', sa.Integer(), nullable=False), sa.Column('name', sa.Text(), nullable=False), sa.Column('data', Xml(), nullable=False), sa.Column('created', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False), sa.Column('updated', sa.DateTime(), server_default=sa.text('(CURRENT_TIMESTAMP)'), nullable=False), sa.Column('parsed', sa.JSON(), nullable=True), sa.ForeignKeyConstraint(['node_id'], ['pubsub_nodes.id'], name=op.f('fk_pubsub_items_node_id_pubsub_nodes'), ondelete='CASCADE'), sa.PrimaryKeyConstraint('id', name=op.f('pk_pubsub_items')), sa.UniqueConstraint('node_id', 'name', name=op.f('uq_pubsub_items_node_id')) ) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_table('pubsub_items') op.drop_table('pubsub_nodes') # ### end Alembic commands ###