diff --git a/migrations/versions/af77ca6a89d0_news_index.py b/migrations/versions/af77ca6a89d0_news_index.py new file mode 100644 index 000000000..3af1fb41c --- /dev/null +++ b/migrations/versions/af77ca6a89d0_news_index.py @@ -0,0 +1,41 @@ +"""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" +down_revision = "e97b2a10f86c" +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 ###