@@ -0,0 +1,1301 @@
+%22%22%22Add meta_search table%0A%0ARevision ID: 1a73867b1e79%0ARevises: 1c6e2fb3d3b6%0ACreate Date: 2019-04-29 11:47:04.783168%0A%0A%22%22%22%0Afrom alembic import op%0Aimport sqlalchemy as sa%0Afrom sqlalchemy.dialects import postgresql%0Afrom sqlalchemy.orm.session import sessionmaker%0Afrom api.actions import update_meta_search%0A# revision identifiers, used by Alembic.%0Arevision = '1a73867b1e79'%0Adown_revision = '1c6e2fb3d3b6'%0Abranch_labels = None%0Adepends_on = None%0A%0A%0Adef upgrade():%0A    # ### commands auto generated by Alembic - please adjust! ###%0A    op.create_table('meta_search',%0A        sa.Column('schema', sa.String(length=100), nullable=False),%0A        sa.Column('table', sa.String(length=100), nullable=False),%0A        sa.Column('comment', postgresql.TSVECTOR(), nullable=True),%0A        sa.PrimaryKeyConstraint('schema', 'table'),%0A        schema='public'%0A    )%0A    conn = op.get_bind()%0A    meta = sa.MetaData(bind=conn)%0A    meta.reflect()%0A    Session = sessionmaker()%0A    session = Session(bind=conn)%0A    try:%0A        for table in meta.tables.values():%0A            update_meta_search(session, table.name, table.schema, insert_only=True)%0A        session.commit()%0A    except:%0A        session.rollback()%0A        raise%0A    finally:%0A        session.close()%0A%0A%0Adef downgrade():%0A    op.drop_table('meta_search', schema='public')%0A%0A

Add meta_search to alembic