Skip to content

Don't exclude migrations from black #2138

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ repos:
rev: 25.1.0
hooks:
- id: black
exclude: '(\/migrations\/)'
- repo: https://github.com/rbubley/mirrors-prettier
rev: "v3.6.2"
hooks:
Expand Down
77 changes: 62 additions & 15 deletions aggregator/migrations/0004_add_local_django_community.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,75 @@
class Migration(migrations.Migration):

dependencies = [
('aggregator', '0003_increase_url_max_length'),
("aggregator", "0003_increase_url_max_length"),
]

operations = [
migrations.CreateModel(
name='LocalDjangoCommunity',
name="LocalDjangoCommunity",
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=120)),
('description', models.TextField()),
('slug', models.SlugField(max_length=125)),
('city', models.CharField(max_length=85)),
('country', django_countries.fields.CountryField(max_length=2)),
('continent', models.CharField(choices=[('Africa', 'Africa'), ('North America', 'North America'), ('South America', 'South America'), ('Europe', 'Europe'), ('Asia', 'Asia'), ('Oceania', 'Oceania'), ('Antarctica', 'Antarctica')], max_length=15)),
('website_url', models.URLField(blank=True, default=None, max_length=250, null=True)),
('event_site_url', models.URLField(blank=True, default=None, max_length=250, null=True)),
('is_active', models.BooleanField(default=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=120)),
("description", models.TextField()),
("slug", models.SlugField(max_length=125)),
("city", models.CharField(max_length=85)),
("country", django_countries.fields.CountryField(max_length=2)),
(
"continent",
models.CharField(
choices=[
("Africa", "Africa"),
("North America", "North America"),
("South America", "South America"),
("Europe", "Europe"),
("Asia", "Asia"),
("Oceania", "Oceania"),
("Antarctica", "Antarctica"),
],
max_length=15,
),
),
(
"website_url",
models.URLField(
blank=True, default=None, max_length=250, null=True
),
),
(
"event_site_url",
models.URLField(
blank=True, default=None, max_length=250, null=True
),
),
("is_active", models.BooleanField(default=True)),
("created_at", models.DateTimeField(auto_now_add=True)),
],
),
migrations.AddConstraint(
model_name='localdjangocommunity',
constraint=models.CheckConstraint(condition=models.Q(models.Q(('event_site_url__isnull', False), ('website_url__isnull', False)), models.Q(('event_site_url__isnull', False), ('website_url__isnull', True)), models.Q(('event_site_url__isnull', True), ('website_url__isnull', False)), _connector='OR'), name='website_url_and_or_event_site_url'),
model_name="localdjangocommunity",
constraint=models.CheckConstraint(
condition=models.Q(
models.Q(
("event_site_url__isnull", False),
("website_url__isnull", False),
),
models.Q(
("event_site_url__isnull", False), ("website_url__isnull", True)
),
models.Q(
("event_site_url__isnull", True), ("website_url__isnull", False)
),
_connector="OR",
),
name="website_url_and_or_event_site_url",
),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
class Migration(migrations.Migration):

dependencies = [
('aggregator', '0004_add_local_django_community'),
("aggregator", "0004_add_local_django_community"),
]

operations = [
migrations.AddIndex(
model_name='feeditem',
index=models.Index(fields=['-date_modified'], name='aggregator__date_mo_d6dfa1_idx'),
model_name="feeditem",
index=models.Index(
fields=["-date_modified"], name="aggregator__date_mo_d6dfa1_idx"
),
),
]
6 changes: 3 additions & 3 deletions aggregator/migrations/0006_localdjangocommunity_plural.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
class Migration(migrations.Migration):

dependencies = [
('aggregator', '0005_feeditem_add_index_date_modified'),
("aggregator", "0005_feeditem_add_index_date_modified"),
]

operations = [
migrations.AlterModelOptions(
name='localdjangocommunity',
options={'verbose_name_plural': 'Local Django Communities'},
name="localdjangocommunity",
options={"verbose_name_plural": "Local Django Communities"},
),
]
45 changes: 36 additions & 9 deletions blog/migrations/0004_imageupload.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,50 @@
class Migration(migrations.Migration):

dependencies = [
('blog', '0003_entry_content_format_markdown'),
("blog", "0003_entry_content_format_markdown"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='ImageUpload',
name="ImageUpload",
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(help_text='Not published anywhere, just used internally', max_length=100)),
('image', models.FileField(upload_to='blog/images/%Y/%m/')),
('alt_text', models.TextField(help_text='Make the extra effort, it makes a difference 💖')),
('uploaded_on', models.DateTimeField(auto_now_add=True)),
('uploaded_by', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"title",
models.CharField(
help_text="Not published anywhere, just used internally",
max_length=100,
),
),
("image", models.FileField(upload_to="blog/images/%Y/%m/")),
(
"alt_text",
models.TextField(
help_text="Make the extra effort, it makes a difference 💖"
),
),
("uploaded_on", models.DateTimeField(auto_now_add=True)),
(
"uploaded_by",
models.ForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
],
options={
'ordering': ('-uploaded_on',),
"ordering": ("-uploaded_on",),
},
),
]
14 changes: 10 additions & 4 deletions blog/migrations/0005_entry_social_media_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@
class Migration(migrations.Migration):

dependencies = [
('blog', '0004_imageupload'),
("blog", "0004_imageupload"),
]

operations = [
migrations.AddField(
model_name='entry',
name='social_media_card',
field=models.ForeignKey(blank=True, help_text='For maximum compatibility, the image should be < 5 MB and at least 1200x627 px.', null=True, on_delete=django.db.models.deletion.PROTECT, to='blog.imageupload'),
model_name="entry",
name="social_media_card",
field=models.ForeignKey(
blank=True,
help_text="For maximum compatibility, the image should be < 5 MB and at least 1200x627 px.",
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="blog.imageupload",
),
),
]
Loading