Debian Codegraph @

sandbox/shared_public/migrations/0001_initial.py

raw
1 # Generated by Django 2.1.4 on 2019-01-13 03:07
2
3 import django.db.models.deletion
4 from django.db import migrations, models
5
6 import django_pgschemas.schema
7 import django_pgschemas.utils
8
9
10 class Migration(migrations.Migration):
11 initial = True
12
13 dependencies = []
14
15 operations = [
16 migrations.CreateModel(
17 name="Domain",
18 fields=[
19 (
20 "id",
21 models.AutoField(
22 auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
23 ),
24 ),
25 ("domain", models.CharField(db_index=True, max_length=253)),
26 ("folder", models.SlugField(blank=True, max_length=253)),
27 ("is_primary", models.BooleanField(default=True)),
28 ],
29 options={"abstract": False},
30 ),
31 migrations.CreateModel(
32 name="Catalog",
33 fields=[
34 (
35 "id",
36 models.AutoField(
37 auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
38 ),
39 )
40 ],
41 ),
42 migrations.CreateModel(
43 name="Tenant",
44 fields=[
45 (
46 "id",
47 models.AutoField(
48 auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
49 ),
50 ),
51 (
52 "schema_name",
53 models.CharField(
54 max_length=63,
55 unique=True,
56 validators=[django_pgschemas.utils.check_schema_name],
57 ),
58 ),
59 ],
60 options={"abstract": False},
61 bases=(django_pgschemas.schema.Schema, models.Model),
62 ),
63 migrations.AddField(
64 model_name="domain",
65 name="tenant",
66 field=models.ForeignKey(
67 on_delete=django.db.models.deletion.CASCADE,
68 related_name="domains",
69 to="shared_public.Tenant",
70 ),
71 ),
72 migrations.AlterUniqueTogether(name="domain", unique_together={("domain", "folder")}),
73 ]