text: """Add tsvector to user table
  
  Revision ID: 0002
  Revises: 0001
  Create Date: 2019-01-30 13:32:15.071281
  
  """
  from alembic import op
  import sqlalchemy as sa
  from sqlalchemy.dialects import postgresql
  
  # revision identifiers, used by Alembic.
  revision = '0002'
  down_revision = '0001'
  branch_labels = None
  depends_on = None
  
  
  def upgrade():
      op.add_column('user', sa.Column('tsvector', postgresql.TSVECTOR(), nullable=True))
      op.execute('UPDATE public.user SET tsvector=to_tsvector(first_name) || to_tsvector(last_name) || to_tsvector(username)')
  
  
  def downgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_column('user', 'tsvector')
      # ### end Alembic commands ###
  