ScoDocMM/migrations/versions/af77ca6a89d0_news_index.py

42 lines
1.2 KiB
Python
Raw Normal View History

2022-04-26 12:57:41 +02:00
"""news index
Revision ID: af77ca6a89d0
Revises: e97b2a10f86c
Create Date: 2022-04-26 12:56:22.862451
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "af77ca6a89d0"
2022-04-28 05:28:24 +02:00
down_revision = "d5b3bdd1d622"
2022-04-26 12:57:41 +02:00
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_index(
op.f("ix_scolar_news_authenticated_user"),
"scolar_news",
["authenticated_user"],
unique=False,
)
op.create_index(op.f("ix_scolar_news_date"), "scolar_news", ["date"], unique=False)
op.create_index(
op.f("ix_scolar_news_object"), "scolar_news", ["object"], unique=False
)
op.create_index(op.f("ix_scolar_news_type"), "scolar_news", ["type"], unique=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f("ix_scolar_news_type"), table_name="scolar_news")
op.drop_index(op.f("ix_scolar_news_object"), table_name="scolar_news")
op.drop_index(op.f("ix_scolar_news_date"), table_name="scolar_news")
op.drop_index(op.f("ix_scolar_news_authenticated_user"), table_name="scolar_news")
# ### end Alembic commands ###