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

55 lines
2.4 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
from django.conf import settings
2015-04-29 13:55:22 +00:00
import django.utils.timezone
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
('contenttypes', '0002_remove_content_type_name'),
('services', '__first__'),
2015-04-08 14:41:09 +00:00
]
operations = [
migrations.CreateModel(
name='MetricStorage',
fields=[
2015-04-29 13:55:22 +00:00
('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
('value', models.DecimalField(max_digits=16, decimal_places=2, verbose_name='value')),
('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 13:55:22 +00:00
('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=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')),
('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')),
2015-04-08 14:41:09 +00:00
('description', models.TextField(blank=True, verbose_name='description')),
2015-04-29 13:55:22 +00:00
('account', models.ForeignKey(to=settings.AUTH_USER_MODEL, related_name='orders', verbose_name='account')),
2015-04-08 14:41:09 +00:00
('content_type', models.ForeignKey(to='contenttypes.ContentType')),
2015-04-29 13:55:22 +00:00
('service', models.ForeignKey(to='services.Service', related_name='orders', verbose_name='service')),
2015-04-08 14:41:09 +00:00
],
options={
'get_latest_by': 'id',
},
),
migrations.AddField(
model_name='metricstorage',
name='order',
2015-04-29 13:55:22 +00:00
field=models.ForeignKey(to='orders.Order', related_name='metrics', verbose_name='order'),
2015-04-08 14:41:09 +00:00
),
]