123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- # Generated by Django 5.0.3 on 2024-03-18 14:49
- import django.db.models.deletion
- import psqlextra.backend.migrations.operations.add_default_partition
- import psqlextra.backend.migrations.operations.create_partitioned_model
- import psqlextra.manager.manager
- import psqlextra.models.partitioned
- import psqlextra.types
- from django.db import migrations, models
- from glitchtip.model_utils import TestDefaultPartition
- class Migration(migrations.Migration):
- dependencies = [
- ("projects", "0013_merge_20231017_1350"),
- ]
- operations = [
- psqlextra.backend.migrations.operations.create_partitioned_model.PostgresCreatePartitionedModel(
- name="IssueEventProjectHourlyStatistic",
- fields=[
- (
- "id",
- models.BigAutoField(
- auto_created=True,
- primary_key=True,
- serialize=False,
- verbose_name="ID",
- ),
- ),
- ("date", models.DateTimeField()),
- ("count", models.PositiveIntegerField()),
- (
- "project",
- models.ForeignKey(
- on_delete=django.db.models.deletion.CASCADE,
- to="projects.project",
- ),
- ),
- ],
- options={
- "abstract": False,
- "unique_together": {("project", "date")},
- },
- partitioning_options={
- "method": psqlextra.types.PostgresPartitioningMethod["RANGE"],
- "key": ["date"],
- },
- bases=(psqlextra.models.partitioned.PostgresPartitionedModel,),
- managers=[
- ("objects", psqlextra.manager.manager.PostgresManager()),
- ],
- ),
- migrations.AlterModelManagers(
- name="transactioneventprojecthourlystatistic",
- managers=[
- ("objects", psqlextra.manager.manager.PostgresManager()),
- ],
- ),
- TestDefaultPartition(
- model_name="IssueEventProjectHourlyStatistic",
- name="default",
- ),
- migrations.DeleteModel(
- name="EventProjectHourlyStatistic",
- ),
- migrations.DeleteModel(
- name="TransactionEventProjectHourlyStatistic",
- ),
- psqlextra.backend.migrations.operations.create_partitioned_model.PostgresCreatePartitionedModel(
- name="TransactionEventProjectHourlyStatistic",
- fields=[
- (
- "id",
- models.BigAutoField(
- auto_created=True,
- primary_key=True,
- serialize=False,
- verbose_name="ID",
- ),
- ),
- ("date", models.DateTimeField()),
- ("count", models.PositiveIntegerField()),
- (
- "project",
- models.ForeignKey(
- on_delete=django.db.models.deletion.CASCADE,
- to="projects.project",
- ),
- ),
- ],
- options={
- "abstract": False,
- "unique_together": {("project", "date")},
- },
- partitioning_options={
- "method": psqlextra.types.PostgresPartitioningMethod["RANGE"],
- "key": ["date"],
- },
- bases=(psqlextra.models.partitioned.PostgresPartitionedModel,),
- managers=[
- ("objects", psqlextra.manager.manager.PostgresManager()),
- ],
- ),
- TestDefaultPartition(
- model_name="TransactionEventProjectHourlyStatistic",
- name="default",
- ),
- ]
|