2023-09-01 15:47:43 +00:00
# Generated by Django 2.2.28 on 2023-08-17 09:45
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
initial = True
2015-04-08 14:41:09 +00:00
dependencies = [
2023-09-01 15:47:43 +00:00
( ' orchestration ' , ' __first__ ' ) ,
( ' domains ' , ' __first__ ' ) ,
2015-04-29 13:55:22 +00:00
migrations . swappable_dependency ( settings . AUTH_USER_MODEL ) ,
2023-09-01 15:47:43 +00:00
( ' webapps ' , ' __first__ ' ) ,
# ('webapps', '0004_auto_20230817_1108'),
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 ' ) ) ,
( ' comments ' , models . TextField ( blank = True , default = ' ' ) ) ,
( ' 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 ' ) ) ,
2023-09-01 15:47:43 +00:00
( ' domains ' , models . ManyToManyField ( blank = True , related_name = ' websites ' , to = ' domains.Domain ' , verbose_name = ' domains ' ) ) ,
( ' target_server ' , models . ForeignKey ( on_delete = django . db . models . deletion . CASCADE , related_name = ' websites ' , to = ' orchestration.Server ' , verbose_name = ' Target Server ' ) ) ,
2015-04-08 14:41:09 +00:00
] ,
2023-09-01 15:47:43 +00:00
options = {
' unique_together ' : { ( ' name ' , ' account ' ) } ,
} ,
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
) ,
migrations . AlterUniqueTogether (
name = ' content ' ,
2023-09-01 15:47:43 +00:00
unique_together = { ( ' website ' , ' path ' ) } ,
2015-04-08 14:41:09 +00:00
) ,
]