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

63 lines
3.1 KiB
Python
Raw Normal View History

2015-04-08 14:41:09 +00:00
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2021-04-22 11:09
2015-04-08 14:41:09 +00:00
from __future__ import unicode_literals
2015-04-29 14:32:38 +00:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
2015-04-08 14:41:09 +00:00
class Migration(migrations.Migration):
dependencies = [
2015-04-29 14:32:38 +00:00
('contenttypes', '0002_remove_content_type_name'),
('services', '__first__'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
2015-04-08 14:41:09 +00:00
]
operations = [
migrations.CreateModel(
name='MetricStorage',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
2015-04-29 14:32:38 +00:00
('value', models.DecimalField(decimal_places=2, max_digits=16, verbose_name='value')),
2015-04-29 13:55:22 +00:00
('created_on', models.DateField(auto_now_add=True, verbose_name='created')),
2015-04-08 14:41:09 +00:00
('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')),
2015-04-08 14:41:09 +00:00
('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')),
2015-04-29 13:55:22 +00:00
('ignore', models.BooleanField(default=False, verbose_name='ignore')),
2015-04-08 14:41:09 +00:00
('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')),
2015-04-08 14:41:09 +00:00
],
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')]),
2015-04-08 14:41:09 +00:00
),
]