Add random endpoints

This commit is contained in:
2021-12-27 22:01:00 +03:00
parent 1117e36046
commit a7805fe468
5 changed files with 43 additions and 1 deletions

View File

@@ -20,6 +20,11 @@ def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_index(op.f('ix_books_title'), 'books', ['title'], unique=False)
op.create_index(op.f('ix_sequences_name'), 'sequences', ['name'], unique=False)
op.create_index(op.f('tgrm_books_title'), 'books', ['title'], postgresql_using='gin', postgresql_ops={'description': 'gin_trgm_ops'})
op.create_index(op.f('tgrm_sequences_name'), 'sequences', ['name'], postgresql_using='gin', postgresql_ops={'description': 'gin_trgm_ops'})
op.create_index(op.f('tgrm_authors_lfm'), 'authors', [sa.text("(last_name || ' ' || first_name || ' ' || middle_name)")] ,postgresql_using='gin', postgresql_ops={'description': 'gin_trgm_ops'})
op.create_index(op.f('tgrm_authors_lf'), 'authors', [sa.text("(last_name || ' ' || first_name)")] ,postgresql_using='gin', postgresql_ops={'description': 'gin_trgm_ops'})
op.create_index(op.f('tgrm_authors_l'), 'authors', ['last_name'] ,postgresql_using='gin', postgresql_ops={'description': 'gin_trgm_ops'})
# ### end Alembic commands ###
@@ -27,4 +32,9 @@ def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_sequences_name'), table_name='sequences')
op.drop_index(op.f('ix_books_title'), table_name='books')
op.drop_index(op.f('tgrm_books_title'), table_name='books')
op.drop_index(op.f('tgrm_sequences_name'), table_name='books')
op.drop_index(op.f('tgrm_authors_lfm'), table_name='books')
op.drop_index(op.f('tgrm_authors_lf'), table_name='books')
op.drop_index(op.f('tgrm_authors_l'), table_name='books')
# ### end Alembic commands ###