Skip to content

Commit

Permalink
Replace old migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
jieter committed Sep 22, 2021
1 parent d005811 commit a1a6756
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 67 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
python-version: [3.6, 3.7, 3.8, 3.9]
django-version: [2.2, 3.1, 3.2, 4.0a1]
exclude:
- python-version: 3.5
django-version: 3.1
- python-version: 3.5
django-version: 3.2
- python-version: 3.5
django-version: 4.0a1
- python-version: 3.6
django-version: 4.0a1
- python-version: 3.7
Expand Down
2 changes: 1 addition & 1 deletion requirements/common.pip
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ tablib[xls,yaml]
# https://bitbucket.org/openpyxl/openpyxl/issues/1373/broken-writer-with-lxml-defusedxml
openpyxl==2.6.4
mock==3.0.5
psycopg2-binary==2.8.5
psycopg2-binary==2.9.1
django-filter==2.3.0
90 changes: 50 additions & 40 deletions tests/app/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 2.0 on 2019-09-23 17:47
# Generated by Django 4.0a1 on 2021-09-22 18:51

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -8,35 +8,25 @@ class Migration(migrations.Migration):

initial = True

dependencies = [("contenttypes", "0002_remove_content_type_name")]
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
]

operations = [
migrations.CreateModel(
name="Group",
fields=[
(
"id",
models.AutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
("name", models.CharField(max_length=200)),
],
),
migrations.CreateModel(
name="Occupation",
fields=[
(
"id",
models.AutoField(
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
("name", models.CharField(max_length=200)),
("boolean", models.NullBooleanField()),
("boolean", models.BooleanField(null=True)),
(
"boolean_with_choices",
models.NullBooleanField(choices=[(True, "Yes"), (False, "No")]),
models.BooleanField(choices=[(True, "Yes"), (False, "No")], null=True),
),
],
),
Expand All @@ -45,7 +35,7 @@ class Migration(migrations.Migration):
fields=[
(
"id",
models.AutoField(
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
Expand All @@ -71,7 +61,7 @@ class Migration(migrations.Migration):
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="contenttypes.ContentType",
to="contenttypes.contenttype",
),
),
("friends", models.ManyToManyField(to="app.Person")),
Expand All @@ -81,66 +71,86 @@ class Migration(migrations.Migration):
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="people",
to="app.Occupation",
to="app.occupation",
verbose_name="occupation of the person",
),
),
],
options={"verbose_name": "person", "verbose_name_plural": "people"},
options={
"verbose_name": "person",
"verbose_name_plural": "people",
},
),
migrations.CreateModel(
name="PersonInformation",
name="Region",
fields=[
(
"id",
models.AutoField(
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
("name", models.CharField(max_length=200)),
(
"person",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="info_list",
to="app.Person",
verbose_name="Information",
"mayor",
models.OneToOneField(
null=True, on_delete=django.db.models.deletion.CASCADE, to="app.person"
),
),
],
options={
"ordering": ["name"],
},
),
migrations.CreateModel(
name="Region",
name="PersonInformation",
fields=[
(
"id",
models.AutoField(
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
("name", models.CharField(max_length=200)),
(
"mayor",
models.OneToOneField(
null=True, on_delete=django.db.models.deletion.CASCADE, to="app.Person"
"person",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="info_list",
to="app.person",
verbose_name="Information",
),
),
],
options={"ordering": ["name"]},
),
migrations.AddField(
model_name="occupation",
name="region",
field=models.ForeignKey(
null=True, on_delete=django.db.models.deletion.CASCADE, to="app.Region"
null=True, on_delete=django.db.models.deletion.CASCADE, to="app.region"
),
),
migrations.AddField(
model_name="group", name="members", field=models.ManyToManyField(to="app.Person")
migrations.CreateModel(
name="Group",
fields=[
(
"id",
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
("name", models.CharField(max_length=200)),
("members", models.ManyToManyField(to="app.Person")),
],
),
migrations.CreateModel(
name="PersonProxy",
fields=[],
options={"ordering": ("last_name",), "proxy": True, "indexes": []},
options={
"ordering": ("last_name",),
"proxy": True,
"indexes": [],
"constraints": [],
},
bases=("app.person",),
),
]
19 changes: 0 additions & 19 deletions tests/app/migrations/0002_auto_20200812_0958.py

This file was deleted.

1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ basepython =
py37: python3.7
py38: python3.8
py39: python3.9
py310: python3.10
usedevelop = true
pip_pre = true
setenv =
Expand Down

0 comments on commit a1a6756

Please sign in to comment.