Paginate activity history and aggregate dashboard totals in SQL
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
"""Index athlete activity history and shared profile pagination."""
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = "09a7c863b521"
|
||||
down_revision = "f08db2902a74"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.create_index("ix_activity_owner_started_id", "activity", ["owner_id", "started_at", "id"])
|
||||
op.create_index(
|
||||
"ix_activity_owner_visibility_started_id",
|
||||
"activity",
|
||||
["owner_id", "visibility", "started_at", "id"],
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_index("ix_activity_owner_visibility_started_id", table_name="activity")
|
||||
op.drop_index("ix_activity_owner_started_id", table_name="activity")
|
||||
Reference in New Issue
Block a user