-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
alembic/versions/eff1387cfd0b_add_deletedconversation_table.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,33 @@ | ||
"""add deletedconversation table | ||
Revision ID: eff1387cfd0b | ||
Revises: bd57477f19a2 | ||
Create Date: 2022-02-24 13:11:22.227528 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'eff1387cfd0b' | ||
down_revision = 'bd57477f19a2' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# Add deletedconversation table to manage locally-deleted records | ||
# and ensure they do not get re-downloaded to the database during | ||
# a network race condition. | ||
# UUID was chosen as PK to avoid storing data such as source_id that | ||
# could divulge information about the source account creation timeline. | ||
# Note that records in this table are purged every 15 seconds. | ||
op.create_table('deletedconversation', | ||
sa.Column('uuid', sa.String(length=36), nullable=False), | ||
sa.PrimaryKeyConstraint('uuid', name=op.f('pk_deletedconversation')) | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_table('deletedconversation') |