django-orchestra/orchestra/contrib/orders/migrations/0001_initial.py

63 lines
3.1 KiB
Python

# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2021-04-22 11:09
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('services', '__first__'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='MetricStorage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('value', models.DecimalField(decimal_places=2, max_digits=16, verbose_name='value')),
('created_on', models.DateField(auto_now_add=True, verbose_name='created')),
('updated_on', models.DateTimeField(verbose_name='updated')),
],
options={
'get_latest_by': 'id',
},
),
migrations.CreateModel(
name='Order',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('object_id', models.PositiveIntegerField(null=True)),
('registered_on', models.DateField(db_index=True, default=django.utils.timezone.now, verbose_name='registered')),
('cancelled_on', models.DateField(blank=True, null=True, verbose_name='cancelled')),
('billed_on', models.DateField(blank=True, null=True, verbose_name='billed')),
('billed_until', models.DateField(blank=True, null=True, verbose_name='billed until')),
('ignore', models.BooleanField(default=False, verbose_name='ignore')),
('description', models.TextField(blank=True, verbose_name='description')),
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL, verbose_name='account')),
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
('service', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='orders', to='services.Service', verbose_name='service')),
('content_object_repr', models.CharField(editable=False, help_text='Used for searches.', max_length=256, verbose_name='content object representation')),
('billed_metric', models.DecimalField(blank=True, decimal_places=2, max_digits=16, null=True, verbose_name='billed metric')),
],
options={
'get_latest_by': 'id',
},
),
migrations.AddField(
model_name='metricstorage',
name='order',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='metrics', to='orders.Order', verbose_name='order'),
),
migrations.AlterIndexTogether(
name='order',
index_together=set([('content_type', 'object_id')]),
),
]