Run query on DB
This commit is contained in:
parent
73e4396edd
commit
61738dde9e
|
@ -28,7 +28,7 @@ env:
|
||||||
before_script:
|
before_script:
|
||||||
- psql -c "create database lemur;" -U postgres
|
- psql -c "create database lemur;" -U postgres
|
||||||
- psql -c "create user lemur with password 'lemur;'" -U postgres
|
- psql -c "create user lemur with password 'lemur;'" -U postgres
|
||||||
- psql -c "create extension pg_trgm with schema pg_catalog;" -U postgres
|
- psql lemur -c "create extension IF NOT EXISTS pg_trgm with schema pg_catalog;" -U postgres
|
||||||
- npm config set registry https://registry.npmjs.org
|
- npm config set registry https://registry.npmjs.org
|
||||||
- npm install -g bower
|
- npm install -g bower
|
||||||
- pip install --upgrade setuptools
|
- pip install --upgrade setuptools
|
||||||
|
|
|
@ -14,12 +14,8 @@ from alembic import op
|
||||||
from sqlalchemy.exc import ProgrammingError
|
from sqlalchemy.exc import ProgrammingError
|
||||||
|
|
||||||
def upgrade():
|
def upgrade():
|
||||||
try:
|
connection = op.get_bind()
|
||||||
connection = op.get_bind()
|
connection.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm")
|
||||||
connection.execute("CREATE EXTENSION pg_trgm")
|
|
||||||
except ProgrammingError as e:
|
|
||||||
# Extension is most likely already enabled
|
|
||||||
connection.execute("ROLLBACK")
|
|
||||||
|
|
||||||
op.create_index('ix_certificates_cn', 'certificates', ['cn'], unique=False, postgresql_ops={'cn': 'gin_trgm_ops'},
|
op.create_index('ix_certificates_cn', 'certificates', ['cn'], unique=False, postgresql_ops={'cn': 'gin_trgm_ops'},
|
||||||
postgresql_using='gin')
|
postgresql_using='gin')
|
||||||
|
|
Loading…
Reference in New Issue