cleanup migrations
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
This commit is contained in:
parent
ed40b21d16
commit
f7b14bf507
22 changed files with 148 additions and 198 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 3.0.6 on 2020-06-21 12:34
|
||||
# Generated by Django 3.0.6 on 2020-08-01 16:38
|
||||
|
||||
from django.conf import settings
|
||||
import django.core.validators
|
||||
|
|
@ -23,9 +23,9 @@ class Migration(migrations.Migration):
|
|||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('creation_date', models.DateTimeField(auto_now_add=True)),
|
||||
('starting_date', models.DateTimeField()),
|
||||
('ending_date', models.DateTimeField()),
|
||||
('due_date', models.DateField()),
|
||||
('starting_date', models.DateTimeField(default=uncloud_pay.models.start_of_this_month)),
|
||||
('ending_date', models.DateTimeField(default=uncloud_pay.models.end_of_this_month)),
|
||||
('due_date', models.DateField(default=uncloud_pay.models.default_payment_delay)),
|
||||
('valid', models.BooleanField(default=True)),
|
||||
],
|
||||
),
|
||||
|
|
@ -53,10 +53,12 @@ class Migration(migrations.Migration):
|
|||
('starting_date', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('ending_date', models.DateTimeField(blank=True, null=True)),
|
||||
('recurring_period', models.IntegerField(choices=[(31536000, 'Per 365 days'), (2592000, 'Per 30 days'), (604800, 'Per Week'), (86400, 'Per Day'), (3600, 'Per Hour'), (60, 'Per Minute'), (1, 'Per Second'), (0, 'Onetime')], default=2592000)),
|
||||
('one_time_price', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, validators=[django.core.validators.MinValueValidator(0)])),
|
||||
('recurring_price', models.DecimalField(decimal_places=2, default=0.0, max_digits=10, validators=[django.core.validators.MinValueValidator(0)])),
|
||||
('billing_address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.BillingAddress')),
|
||||
('depends_on', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='parent_of', to='uncloud_pay.Order')),
|
||||
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
('replaced_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='supersede', to='uncloud_pay.Order')),
|
||||
('replaces', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='replaced_by', to='uncloud_pay.Order')),
|
||||
],
|
||||
),
|
||||
migrations.CreateModel(
|
||||
|
|
@ -115,7 +117,7 @@ class Migration(migrations.Migration):
|
|||
name='BillRecord',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('usage_count', models.IntegerField(default=1)),
|
||||
('quantity', models.IntegerField(default=1)),
|
||||
('creation_date', models.DateTimeField(auto_now_add=True)),
|
||||
('starting_date', models.DateTimeField()),
|
||||
('ending_date', models.DateTimeField()),
|
||||
|
|
@ -137,4 +139,8 @@ class Migration(migrations.Migration):
|
|||
model_name='billingaddress',
|
||||
constraint=models.UniqueConstraint(condition=models.Q(active=True), fields=('owner',), name='one_active_billing_address_per_user'),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='bill',
|
||||
constraint=models.UniqueConstraint(fields=('owner', 'starting_date', 'ending_date'), name='one_bill_per_month_per_user'),
|
||||
),
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,33 +0,0 @@
|
|||
# Generated by Django 3.0.6 on 2020-06-21 13:35
|
||||
|
||||
from django.db import migrations, models
|
||||
import uncloud_pay.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('uncloud_pay', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='bill',
|
||||
name='due_date',
|
||||
field=models.DateField(default=uncloud_pay.models.default_payment_delay),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='bill',
|
||||
name='ending_date',
|
||||
field=models.DateTimeField(default=uncloud_pay.models.end_of_this_month),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='bill',
|
||||
name='starting_date',
|
||||
field=models.DateTimeField(default=uncloud_pay.models.start_of_this_month),
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name='bill',
|
||||
constraint=models.UniqueConstraint(fields=('owner', 'starting_date', 'ending_date'), name='one_bill_per_month_per_user'),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
# Generated by Django 3.0.6 on 2020-06-21 14:42
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('uncloud_pay', '0002_auto_20200621_1335'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='billrecord',
|
||||
old_name='usage_count',
|
||||
new_name='quantity',
|
||||
),
|
||||
]
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# Generated by Django 3.0.6 on 2020-08-01 16:04
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('uncloud_pay', '0003_auto_20200621_1442'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='order',
|
||||
name='replaced_by',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='replaces',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='replaced_by', to='uncloud_pay.Order'),
|
||||
),
|
||||
]
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
# Generated by Django 3.0.6 on 2020-08-01 16:26
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('uncloud_pay', '0004_auto_20200801_1604'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='one_time_price',
|
||||
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=10, validators=[django.core.validators.MinValueValidator(0)]),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='recurring_price',
|
||||
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=10, validators=[django.core.validators.MinValueValidator(0)]),
|
||||
),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue