boartty/gertty/alembic/versions/1bb187bcd401_add_query_sync_table.py
James E. Blair caac2d18fe Sync own changes regardless of subscription
Currently if you submit a change to a project to which you are not
subscribed, it will not automatically be updated.  This change adds
a sync task that behaves like a project sync but instead of querying
a particular project, queries the set of changes owned by the user
but not in subscribed projects.

A new db table is added to store the last updated time for this query,
and is constructed in such a way as to support future similar sync
queries.

Change-Id: I2d51e0e68cc4f6457edaf2c8f8c0e5f6c0b87aed
2015-04-06 07:45:58 -07:00

27 lines
567 B
Python

"""add query sync table
Revision ID: 1bb187bcd401
Revises: 3cc7e3753dc3
Create Date: 2015-03-26 07:32:33.584657
"""
# revision identifiers, used by Alembic.
revision = '1bb187bcd401'
down_revision = '3cc7e3753dc3'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.create_table('sync_query',
sa.Column('key', sa.Integer(), nullable=False),
sa.Column('name', sa.String(255), index=True, unique=True, nullable=False),
sa.Column('updated', sa.DateTime, index=True),
sa.PrimaryKeyConstraint('key')
)
def downgrade():
pass