simple-login/migrations/versions/2021_080409_9014cca7097c_.py
Adrià Casajús 046748c443
Update pre-commit (#1138)
* Update pre-commit

* Upgrade djlint, remove flake8 and add pylint

* Reformat with new djlint version

* Run pre-commit on CI

* Use only python3.10 on CI

* Reformat files with pre-commit

* Run pre-commit against all files

* Reformat

* Added global excludes

* Added pre-commit to the contributing file

* Set python 3.9 as default

* Set language version to python3

Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
Co-authored-by: Carlos Quintana <carlos.quintana@proton.ch>
2022-07-04 16:01:04 +02:00

42 lines
1 KiB
Python

"""empty message
Revision ID: 9014cca7097c
Revises: ffa75d04e6ef
Create Date: 2021-08-04 09:28:26.620053
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9014cca7097c'
down_revision = 'ffa75d04e6ef'
branch_labels = None
depends_on = None
from sqlalchemy.orm import sessionmaker
Session = sessionmaker()
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
bind = op.get_bind()
session = Session(bind=bind)
session.execute("""
ALTER TABLE alias ADD COLUMN ts_vector tsvector GENERATED ALWAYS
AS (to_tsvector('english', note)) STORED;
""")
op.create_index('ix_video___ts_vector__', 'alias', ['ts_vector'], unique=False, postgresql_using='gin')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index('ix_video___ts_vector__', table_name='alias')
op.drop_column('alias', 'ts_vector')
# ### end Alembic commands ###