mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 15:06:19 -05:00
Creating index for archive.url.
This commit is contained in:
parent
7db4ea73f2
commit
d689f3b5e7
1 changed files with 33 additions and 0 deletions
33
alembic/versions/13542a230c78_archive_url_index.py
Normal file
33
alembic/versions/13542a230c78_archive_url_index.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"""Archive url index.
|
||||
|
||||
Revision ID: 13542a230c78
|
||||
Revises: c72d305cf11e
|
||||
Create Date: 2022-11-02 15:19:42.408462
|
||||
|
||||
"""
|
||||
import os
|
||||
|
||||
from alembic import op
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '13542a230c78'
|
||||
down_revision = 'c72d305cf11e'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False
|
||||
|
||||
|
||||
def upgrade():
|
||||
bind = op.get_bind()
|
||||
session = Session(bind=bind)
|
||||
|
||||
session.execute('CREATE INDEX IF NOT EXISTS archive_url_idx ON archive(url)')
|
||||
|
||||
|
||||
def downgrade():
|
||||
bind = op.get_bind()
|
||||
session = Session(bind=bind)
|
||||
|
||||
session.execute('DROP INDEX IF EXISTS archive_url_idx')
|
||||
Loading…
Add table
Add a link
Reference in a new issue