jbirddog 5eff6d4ead Typeahead datastore (#321)
* Wiring up the datastore

* Writes into the data store

* Bulk save needs the timestamps

* Prep to do the local query

* Local typeahead working

* Pre pr cleanup

* ignore migrations dir in pre-commit for ruff w/ burnettk

* Getting ./bin/pyl to pass

---------

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
2023-06-09 12:28:59 -07:00

45 lines
1.4 KiB
Python

"""empty message
Revision ID: 377be1608b45
Revises: e4b6bbf83a3e
Create Date: 2023-06-07 12:39:19.989484
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '377be1608b45'
down_revision = 'e4b6bbf83a3e'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('typeahead',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('category', sa.String(length=255), nullable=True),
sa.Column('search_term', sa.String(length=255), nullable=True),
sa.Column('result', sa.JSON(), nullable=True),
sa.Column('updated_at_in_seconds', sa.Integer(), nullable=True),
sa.Column('created_at_in_seconds', sa.Integer(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
with op.batch_alter_table('typeahead', schema=None) as batch_op:
batch_op.create_index(batch_op.f('ix_typeahead_category'), ['category'], unique=False)
batch_op.create_index(batch_op.f('ix_typeahead_search_term'), ['search_term'], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('typeahead', schema=None) as batch_op:
batch_op.drop_index(batch_op.f('ix_typeahead_search_term'))
batch_op.drop_index(batch_op.f('ix_typeahead_category'))
op.drop_table('typeahead')
# ### end Alembic commands ###