2015-04-08 14:41:09 +00:00
# -*- coding: utf-8 -*-
2024-07-12 09:41:44 +00:00
# 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
2024-07-12 09:41:44 +00:00
from django . conf import settings
from django . db import migrations , models
2021-04-22 12:18:01 +00:00
import django . db . models . deletion
2015-04-29 13:55:22 +00:00
import orchestra . core . validators
2015-04-08 14:41:09 +00:00
class Migration ( migrations . Migration ) :
dependencies = [
2015-04-29 13:55:22 +00:00
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
2024-07-12 09:41:44 +00:00
( ' services ' , ' 0001_initial ' ) ,
2015-04-08 14:41:09 +00:00
]
operations = [
migrations . CreateModel (
name = ' ContractedPlan ' ,
fields = [
2024-07-12 09:41:44 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' account ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' plans ' , to = settings . AUTH_USER_MODEL , verbose_name = ' account ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
options = {
' verbose_name_plural ' : ' plans ' ,
} ,
) ,
migrations . CreateModel (
name = ' Plan ' ,
fields = [
2024-07-12 09:41:44 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' name ' , models . CharField ( max_length = 32 , unique = True , validators = [ orchestra . core . validators . validate_name ] , verbose_name = ' name ' ) ) ,
( ' verbose_name ' , models . CharField ( blank = True , max_length = 128 , verbose_name = ' verbose_name ' ) ) ,
( ' is_active ' , models . BooleanField ( default = True , help_text = ' Designates whether this account should be treated as active. Unselect this instead of deleting accounts. ' , verbose_name = ' active ' ) ) ,
( ' is_default ' , models . BooleanField ( default = False , help_text = ' Designates whether this plan is used by default or not. ' , verbose_name = ' default ' ) ) ,
( ' is_combinable ' , models . BooleanField ( default = True , help_text = ' Designates whether this plan can be combined with other plans or not. ' , verbose_name = ' combinable ' ) ) ,
( ' allow_multiple ' , models . BooleanField ( default = False , help_text = ' Designates whether this plan allow for multiple contractions. ' , verbose_name = ' allow multiple ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
) ,
migrations . CreateModel (
name = ' Rate ' ,
fields = [
2024-07-12 09:41:44 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' quantity ' , models . PositiveIntegerField ( blank = True , help_text = ' See rate algorihm help text. ' , null = True , verbose_name = ' quantity ' ) ) ,
2015-04-29 14:32:38 +00:00
( ' price ' , models . DecimalField ( decimal_places = 2 , max_digits = 12 , verbose_name = ' price ' ) ) ,
2024-07-12 09:41:44 +00:00
( ' plan ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' rates ' , to = ' plans.Plan ' , verbose_name = ' plan ' ) ) ,
( ' service ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' rates ' , to = ' services.Service ' , verbose_name = ' service ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
) ,
migrations . AddField (
model_name = ' contractedplan ' ,
name = ' plan ' ,
2024-07-12 09:41:44 +00:00
field = models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' contracts ' , to = ' plans.Plan ' , verbose_name = ' plan ' ) ,
2015-04-08 14:41:09 +00:00
) ,
migrations . AlterUniqueTogether (
name = ' rate ' ,
unique_together = set ( [ ( ' service ' , ' plan ' , ' quantity ' ) ] ) ,
) ,
2024-07-12 09:41:44 +00:00
migrations . AlterField (
model_name = ' rate ' ,
name = ' plan ' ,
field = models . ForeignKey ( blank = True , null = True , on_delete = django . db . models . deletion . CASCADE , related_name = ' rates ' , to = ' plans.Plan ' , verbose_name = ' plan ' ) ,
) ,
migrations . AlterField (
model_name = ' rate ' ,
name = ' plan ' ,
field = models . ForeignKey ( blank = True , null = True , on_delete = django . db . models . deletion . SET_NULL , related_name = ' rates ' , to = ' plans.Plan ' , verbose_name = ' plan ' ) ,
) ,
2015-04-08 14:41:09 +00:00
]