Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start squash migrations 5.0.8 #198

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def status(line):
cmd("black dash test_runner")

status("Running ruff")
cmd("ruff dash")
cmd("ruff check dash")

status("Running isort")
cmd("isort dash")
Expand Down
284 changes: 284 additions & 0 deletions dash/categories/migrations/0001_squashed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
# Generated by Django 5.0.8 on 2024-08-22 09:06

import functools

import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models

import dash.utils


class Migration(migrations.Migration):

replaces = [
("categories", "0001_initial"),
("categories", "0002_auto_20140820_1415"),
("categories", "0003_categoryimage"),
("categories", "0004_auto_20140904_0927"),
("categories", "0005_auto_20140922_1514"),
("categories", "0006_auto_20141008_1955"),
("categories", "0007_auto_20170301_0914"),
("categories", "0008_alter_category_options"),
("categories", "0009_auto_20210910_1450"),
("categories", "0010_alter_category_created_by_alter_category_modified_by_and_more"),
("categories", "0011_alter_category_unique_together_and_more"),
]

initial = True

dependencies = [
("orgs", "0005_orgbackground"),
("orgs", "0033_rename_orgs_orgbac_org_id_607508_idx_orgs_orgbac_org_slug_idx_and_more"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name="Category",
fields=[
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"is_active",
models.BooleanField(
default=True, help_text="Whether this item is active, use this instead of deleting"
),
),
(
"created_on",
models.DateTimeField(auto_now_add=True, help_text="When this item was originally created"),
),
("modified_on", models.DateTimeField(auto_now=True, help_text="When this item was last modified")),
("name", models.CharField(help_text="The name of this category", max_length=64)),
(
"image",
models.ImageField(
blank=True,
help_text="An optional image that can describe this category",
null=True,
upload_to="categories",
),
),
(
"created_by",
models.ForeignKey(
help_text="The user which originally created this item",
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
(
"modified_by",
models.ForeignKey(
help_text="The user which last modified this item",
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
(
"org",
models.ForeignKey(
help_text="The organization this category applies to",
on_delete=django.db.models.deletion.PROTECT,
to="orgs.org",
),
),
],
options={
"verbose_name_plural": "Categories",
},
),
migrations.CreateModel(
name="CategoryImage",
fields=[
("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
(
"is_active",
models.BooleanField(
default=True, help_text="Whether this item is active, use this instead of deleting"
),
),
(
"created_on",
models.DateTimeField(auto_now_add=True, help_text="When this item was originally created"),
),
("modified_on", models.DateTimeField(auto_now=True, help_text="When this item was last modified")),
("name", models.CharField(help_text="The name to describe this image", max_length=64)),
("image", models.ImageField(help_text="The image file to use", upload_to="categories")),
(
"category",
models.ForeignKey(
help_text="The category this image represents",
on_delete=django.db.models.deletion.PROTECT,
to="categories.category",
),
),
(
"created_by",
models.ForeignKey(
help_text="The user which originally created this item",
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
(
"modified_by",
models.ForeignKey(
help_text="The user which last modified this item",
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"abstract": False,
},
),
migrations.AlterField(
model_name="category",
name="created_by",
field=models.ForeignKey(
help_text="The user which originally created this item",
on_delete=django.db.models.deletion.PROTECT,
related_name="categories_category_creations",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AlterField(
model_name="category",
name="modified_by",
field=models.ForeignKey(
help_text="The user which last modified this item",
on_delete=django.db.models.deletion.PROTECT,
related_name="categories_category_modifications",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AlterField(
model_name="categoryimage",
name="category",
field=models.ForeignKey(
help_text="The category this image represents",
on_delete=django.db.models.deletion.PROTECT,
related_name="images",
to="categories.category",
),
),
migrations.AlterField(
model_name="category",
name="org",
field=models.ForeignKey(
help_text="The organization this category applies to",
on_delete=django.db.models.deletion.PROTECT,
related_name="categories",
to="orgs.org",
),
),
migrations.AlterField(
model_name="category",
name="created_on",
field=models.DateTimeField(
blank=True,
default=django.utils.timezone.now,
editable=False,
help_text="When this item was originally created",
),
),
migrations.AlterField(
model_name="category",
name="modified_on",
field=models.DateTimeField(
blank=True,
default=django.utils.timezone.now,
editable=False,
help_text="When this item was last modified",
),
),
migrations.AlterField(
model_name="categoryimage",
name="created_on",
field=models.DateTimeField(
blank=True,
default=django.utils.timezone.now,
editable=False,
help_text="When this item was originally created",
),
),
migrations.AlterField(
model_name="categoryimage",
name="modified_on",
field=models.DateTimeField(
blank=True,
default=django.utils.timezone.now,
editable=False,
help_text="When this item was last modified",
),
),
migrations.AlterModelOptions(
name="category",
options={"ordering": ["name"], "verbose_name_plural": "Categories"},
),
migrations.AlterField(
model_name="category",
name="image",
field=models.ImageField(
blank=True,
help_text="An optional image that can describe this category",
null=True,
upload_to=functools.partial(dash.utils.generate_file_path, *("categories",), **{}),
),
),
migrations.AlterField(
model_name="categoryimage",
name="image",
field=models.ImageField(
help_text="The image file to use",
upload_to=functools.partial(dash.utils.generate_file_path, *("categories",), **{}),
),
),
migrations.AlterField(
model_name="category",
name="created_by",
field=models.ForeignKey(
help_text="The user which originally created this item",
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_creations",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AlterField(
model_name="category",
name="modified_by",
field=models.ForeignKey(
help_text="The user which last modified this item",
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_modifications",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AlterField(
model_name="categoryimage",
name="created_by",
field=models.ForeignKey(
help_text="The user which originally created this item",
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_creations",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AlterField(
model_name="categoryimage",
name="modified_by",
field=models.ForeignKey(
help_text="The user which last modified this item",
on_delete=django.db.models.deletion.PROTECT,
related_name="%(app_label)s_%(class)s_modifications",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AddConstraint(
model_name="category",
constraint=models.UniqueConstraint(fields=("name", "org"), name="categories_category_name_unique"),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 5.0.8 on 2024-08-21 16:03

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("categories", "0010_alter_category_created_by_alter_category_modified_by_and_more"),
("orgs", "0033_rename_orgs_orgbac_org_id_607508_idx_orgs_orgbac_org_slug_idx_and_more"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.AlterUniqueTogether(
name="category",
unique_together=set(),
),
migrations.AddConstraint(
model_name="category",
constraint=models.UniqueConstraint(fields=("name", "org"), name="categories_category_name_unique"),
),
]
2 changes: 1 addition & 1 deletion dash/categories/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __str__(self):

class Meta:
ordering = ["name"]
unique_together = ("name", "org")
constraints = [models.UniqueConstraint(fields=["name", "org"], name="categories_category_name_unique")]
verbose_name_plural = _("Categories")


Expand Down
Loading