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

56 lines
2.6 KiB
Python
Raw Normal View History

2015-04-08 14:41:09 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
2015-04-29 13:55:22 +00:00
import django.utils.timezone
import django.db.models.deletion
2015-04-29 14:32:38 +00:00
from django.conf import settings
2015-04-08 14:41:09 +00:00
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
2015-04-29 13:55:22 +00:00
('services', '__first__'),
2015-04-29 14:32:38 +00:00
('contenttypes', '0002_remove_content_type_name'),
2015-04-08 14:41:09 +00:00
]
operations = [
migrations.CreateModel(
name='MetricStorage',
fields=[
2015-04-29 14:32:38 +00:00
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
('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=[
2015-04-29 14:32:38 +00:00
('id', models.AutoField(serialize=False, auto_created=True, verbose_name='ID', primary_key=True)),
2015-04-08 14:41:09 +00:00
('object_id', models.PositiveIntegerField(null=True)),
2015-04-29 13:55:22 +00:00
('registered_on', models.DateField(default=django.utils.timezone.now, verbose_name='registered')),
2015-04-29 14:32:38 +00:00
('cancelled_on', models.DateField(blank=True, verbose_name='cancelled', null=True)),
('billed_on', models.DateField(blank=True, verbose_name='billed', null=True)),
('billed_until', models.DateField(blank=True, verbose_name='billed until', null=True)),
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, verbose_name='account', related_name='orders', to=settings.AUTH_USER_MODEL)),
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, verbose_name='service', related_name='orders', to='services.Service')),
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, verbose_name='order', related_name='metrics', to='orders.Order'),
2015-04-08 14:41:09 +00:00
),
]