12345678910111213141516171819202122 |
- from dateutil.relativedelta import relativedelta
- from psqlextra.partitioning import (
- PostgresCurrentTimePartitioningStrategy,
- PostgresPartitioningManager,
- PostgresTimePartitionSize,
- )
- from psqlextra.partitioning.config import PostgresPartitioningConfig
- from apps.issue_events.models import IssueEvent
- manager = PostgresPartitioningManager(
- [
- PostgresPartitioningConfig(
- model=IssueEvent,
- strategy=PostgresCurrentTimePartitioningStrategy(
- size=PostgresTimePartitionSize(weeks=1),
- count=2,
- max_age=relativedelta(months=3),
- ),
- ),
- ]
- )
|