2024-07-12 09:41:44 +00:00
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2021-04-22 11:25
from __future__ import unicode_literals
2015-04-08 14:41:09 +00:00
from django . conf import settings
2023-09-01 15:47:43 +00:00
from django . db import migrations , models
2021-04-22 12:18:01 +00:00
import django . db . models . deletion
2015-04-29 14:32:38 +00:00
import orchestra . core . validators
2015-04-08 14:41:09 +00:00
class Migration ( migrations . Migration ) :
2023-09-01 15:47:43 +00:00
2015-04-08 14:41:09 +00:00
dependencies = [
2024-07-12 09:41:44 +00:00
( ' domains ' , ' 0001_initial ' ) ,
( ' webapps ' , ' 0001_initial ' ) ,
2023-09-01 15:47:43 +00:00
( ' orchestration ' , ' __first__ ' ) ,
2015-04-29 13:55:22 +00:00
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
2015-04-08 14:41:09 +00:00
]
operations = [
migrations . CreateModel (
name = ' Content ' ,
fields = [
2023-09-01 15:47:43 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' path ' , models . CharField ( blank = True , max_length = 256 , validators = [ orchestra . core . validators . validate_url_path ] , verbose_name = ' path ' ) ) ,
( ' webapp ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , to = ' webapps.WebApp ' , verbose_name = ' web application ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
) ,
migrations . CreateModel (
name = ' Website ' ,
fields = [
2023-09-01 15:47:43 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' name ' , models . CharField ( max_length = 128 , validators = [ orchestra . core . validators . validate_name ] , verbose_name = ' name ' ) ) ,
( ' protocol ' , models . CharField ( choices = [ ( ' http ' , ' HTTP ' ) , ( ' https ' , ' HTTPS ' ) , ( ' http/https ' , ' HTTP and HTTPS ' ) , ( ' https-only ' , ' HTTPS only ' ) ] , default = ' http ' , help_text = ' Select the protocol(s) for this website<br><tt>HTTPS only</tt> performs a redirection from <tt>http</tt> to <tt>https</tt>. ' , max_length = 16 , verbose_name = ' protocol ' ) ) ,
( ' is_active ' , models . BooleanField ( default = True , verbose_name = ' active ' ) ) ,
( ' account ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' websites ' , to = settings . AUTH_USER_MODEL , verbose_name = ' Account ' ) ) ,
2015-04-29 14:32:38 +00:00
( ' contents ' , models . ManyToManyField ( through = ' websites.Content ' , to = ' webapps.WebApp ' ) ) ,
2024-07-12 09:41:44 +00:00
( ' domains ' , models . ManyToManyField ( related_name = ' websites ' , to = ' domains.Domain ' , verbose_name = ' domains ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
) ,
migrations . CreateModel (
name = ' WebsiteDirective ' ,
fields = [
2023-09-01 15:47:43 +00:00
( ' id ' , models . AutoField ( auto_created = True , primary_key = True , serialize = False , verbose_name = ' ID ' ) ) ,
( ' name ' , models . CharField ( choices = [ ( None , ' ------- ' ) , ( ' HTTPD ' , [ ( ' redirect ' , ' Redirection ' ) , ( ' proxy ' , ' Proxy ' ) , ( ' error-document ' , ' ErrorDocumentRoot ' ) ] ) , ( ' SSL ' , [ ( ' ssl-ca ' , ' SSL CA ' ) , ( ' ssl-cert ' , ' SSL cert ' ) , ( ' ssl-key ' , ' SSL key ' ) ] ) , ( ' ModSecurity ' , [ ( ' sec-rule-remove ' , ' SecRuleRemoveById ' ) , ( ' sec-engine ' , ' SecRuleEngine Off ' ) ] ) , ( ' SaaS ' , [ ( ' wordpress-saas ' , ' WordPress SaaS ' ) , ( ' dokuwiki-saas ' , ' DokuWiki SaaS ' ) , ( ' drupal-saas ' , ' Drupdal SaaS ' ) , ( ' moodle-saas ' , ' Moodle SaaS ' ) ] ) ] , db_index = True , max_length = 128 , verbose_name = ' name ' ) ) ,
( ' value ' , models . CharField ( blank = True , max_length = 256 , verbose_name = ' value ' ) ) ,
( ' website ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' directives ' , to = ' websites.Website ' , verbose_name = ' web site ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
) ,
migrations . AddField (
model_name = ' content ' ,
name = ' website ' ,
2023-09-01 15:47:43 +00:00
field = models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , to = ' websites.Website ' , verbose_name = ' web site ' ) ,
2015-04-08 14:41:09 +00:00
) ,
2024-07-12 09:41:44 +00:00
migrations . AlterField (
model_name = ' website ' ,
name = ' domains ' ,
field = models . ManyToManyField ( blank = True , related_name = ' websites ' , to = ' domains.Domain ' , verbose_name = ' domains ' ) ,
) ,
migrations . AddField (
model_name = ' website ' ,
name = ' target_server ' ,
field = models . ForeignKey ( default = 1 , on_delete = django . db . models . deletion . CASCADE , related_name = ' websites ' , to = ' orchestration.Server ' , verbose_name = ' Target Server ' ) ,
preserve_default = False ,
) ,
migrations . AddField (
model_name = ' website ' ,
name = ' comments ' ,
field = models . TextField ( blank = True , default = ' ' ) ,
) ,
migrations . AlterUniqueTogether (
name = ' website ' ,
unique_together = set ( [ ( ' name ' , ' account ' ) ] ) ,
) ,
2015-04-08 14:41:09 +00:00
migrations . AlterUniqueTogether (
name = ' content ' ,
2024-07-12 09:41:44 +00:00
unique_together = set ( [ ( ' website ' , ' path ' ) ] ) ,
2015-04-08 14:41:09 +00:00
) ,
]