
# revision identifiers, used by Alembic.
revision = '2f3192e76e5'
down_revision = '3dbc20af3c9'

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('word', sa.Column('search_vector', sqlalchemy_utils.TSVectorType(), nullable=True))
    op.create_index('ix_word_search_vector', 'word', ['search_vector'], unique=False, postgresql_using='gin')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_word_search_vector', table_name='word')
    op.drop_column('word', 'search_vector')
    ### end Alembic commands ###


# revision identifiers, used by Alembic.
revision = '2f3192e76e5'
down_revision = '3dbc20af3c9'

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy_searchable import sync_trigger


def upgrade():
    conn = op.get_bind()
    sync_trigger(conn, 'word', 'search_vector', ["singular", "plural", "infinitive", "past_tense",
                                                 "present_perfect_tense", "positive", "comparative", "superlative",
                                                 "adverb", "conjunction", "preposition", "meaning", "examples"])
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('word', sa.Column('search_vector', sqlalchemy_utils.TSVectorType(), nullable=True))
    op.create_index('ix_word_search_vector', 'word', ['search_vector'], unique=False, postgresql_using='gin')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_word_search_vector', table_name='word')
    op.drop_column('word', 'search_vector')
    ### end Alembic commands ###

Add sync trigger to latest migration
Add sync trigger to latest migration

  
  # revision identifiers, used by Alembic.
  revision = '2f3192e76e5'
  down_revision = '3dbc20af3c9'
  
  from alembic import op
  import sqlalchemy as sa
  import sqlalchemy_utils
+ from sqlalchemy_searchable import sync_trigger
  
  
  def upgrade():
+     conn = op.get_bind()
+     sync_trigger(conn, 'word', 'search_vector', ["singular", "plural", "infinitive", "past_tense",
+                                                  "present_perfect_tense", "positive", "comparative", "superlative",
+                                                  "adverb", "conjunction", "preposition", "meaning", "examples"])
      ### commands auto generated by Alembic - please adjust! ###
      op.add_column('word', sa.Column('search_vector', sqlalchemy_utils.TSVectorType(), nullable=True))
      op.create_index('ix_word_search_vector', 'word', ['search_vector'], unique=False, postgresql_using='gin')
      ### end Alembic commands ###
  
  
  def downgrade():
      ### commands auto generated by Alembic - please adjust! ###
      op.drop_index('ix_word_search_vector', table_name='word')
      op.drop_column('word', 'search_vector')
      ### end Alembic commands ###
  
Add sync trigger to latest migration
## Code Before:

# revision identifiers, used by Alembic.
revision = '2f3192e76e5'
down_revision = '3dbc20af3c9'

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('word', sa.Column('search_vector', sqlalchemy_utils.TSVectorType(), nullable=True))
    op.create_index('ix_word_search_vector', 'word', ['search_vector'], unique=False, postgresql_using='gin')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_word_search_vector', table_name='word')
    op.drop_column('word', 'search_vector')
    ### end Alembic commands ###

## Instruction:
Add sync trigger to latest migration
## Code After:

# revision identifiers, used by Alembic.
revision = '2f3192e76e5'
down_revision = '3dbc20af3c9'

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy_searchable import sync_trigger


def upgrade():
    conn = op.get_bind()
    sync_trigger(conn, 'word', 'search_vector', ["singular", "plural", "infinitive", "past_tense",
                                                 "present_perfect_tense", "positive", "comparative", "superlative",
                                                 "adverb", "conjunction", "preposition", "meaning", "examples"])
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('word', sa.Column('search_vector', sqlalchemy_utils.TSVectorType(), nullable=True))
    op.create_index('ix_word_search_vector', 'word', ['search_vector'], unique=False, postgresql_using='gin')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_word_search_vector', table_name='word')
    op.drop_column('word', 'search_vector')
    ### end Alembic commands ###
