geriou-bir/grids/migrations/0001_initial.py

115 lines
3.5 KiB
Python
Raw Permalink Normal View History

2023-09-12 15:07:47 +00:00
# Generated by Django 4.2.5 on 2023-09-12 12:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Grid",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
],
),
migrations.CreateModel(
name="Level",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("level_numer", models.IntegerField()),
("string_number", models.CharField(max_length=50)),
],
),
migrations.CreateModel(
name="Word",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("word", models.CharField(max_length=50)),
("definition", models.CharField(max_length=255)),
(
"level",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="words",
to="grids.level",
),
),
],
),
migrations.CreateModel(
name="Placement",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("coordinates_first_letter", models.CharField(max_length=10)),
(
"direction",
models.SmallIntegerField(
choices=[(1, "Right"), (2, "Bottom")], default=1
),
),
(
"grid",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="grids.grid"
),
),
(
"word",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="grids.word"
),
),
],
),
migrations.AddField(
model_name="grid",
name="level",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="grids",
to="grids.level",
),
),
migrations.AddField(
model_name="grid",
name="words",
field=models.ManyToManyField(through="grids.Placement", to="grids.word"),
),
]