Improve conversation/threads handling
This commit is contained in:
parent
47b898bb13
commit
7d9ced7740
3 changed files with 98 additions and 4 deletions
|
@ -0,0 +1,40 @@
|
|||
"""New conversation field
|
||||
|
||||
Revision ID: 9bc69ed947e2
|
||||
Revises: 1702e88016db
|
||||
Create Date: 2022-08-14 16:38:37.688377+00:00
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '9bc69ed947e2'
|
||||
down_revision = '1702e88016db'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('inbox', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('conversation', sa.String(), nullable=True))
|
||||
|
||||
with op.batch_alter_table('outbox', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('conversation', sa.String(), nullable=True))
|
||||
|
||||
op.execute("UPDATE inbox SET conversation = ap_context")
|
||||
op.execute("UPDATE outbox SET conversation = ap_context")
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('outbox', schema=None) as batch_op:
|
||||
batch_op.drop_column('conversation')
|
||||
|
||||
with op.batch_alter_table('inbox', schema=None) as batch_op:
|
||||
batch_op.drop_column('conversation')
|
||||
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Add a link
Reference in a new issue