Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add index for notification history #2004

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions migrations/versions/0439_add_index_n_history.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""

Revision ID: 0439_add_index_n_history
Revises: 0438_sms_templates_msgs_left
Create Date: 2023-10-05 00:00:00

"""
from datetime import datetime

from alembic import op

revision = "0439_add_index_n_history"
down_revision = "0438_sms_templates_msgs_left"


# option 1
def upgrade():
op.execute("COMMIT")
op.create_index(
op.f("ix_notification_history_created_by_id"), "notification_history", ["created_by_id"], postgresql_concurrently=True
)


def downgrade():
op.drop_index(op.f("ix_notification_history_created_by_id"), table_name="notification_history")
Loading